develooper Front page | perl.perl6.language | Postings from June 2005

&?CALLER::BLOCK vs. any hope of efficient compilation

Thread Next
Chip Salzenberg
June 14, 2005 07:12
&?CALLER::BLOCK vs. any hope of efficient compilation
Message ID:
I'd like a ruling that &?CALLER::BLOCK is not a general-purpose
block promoter, but only works if the calling block already marked
itself as callable, perhaps by mentioning &?BLOCK in its body.

First, I like the idea that all blocks act as if they were subs WRT
being callable and accepting parameters.  However, the "as if" part of
that statement is very important to a compiler.

AFAICT, to achieve reasonable performance, a compiler must be able to
assume that in the absence of markers or predeclaration, a given block
need not be given all the accoutrements and instrumentation of a full
subroutine, because nobody is going to call it _as_ a subroutine.

It therefore would a Bad Thing if &?CALLER::BLOCK worked generally.
If the caller _is_ a block that was already marked at compile time as
requiring full sub properties then, of course, it's no problem to use
the syntax &?CALLER::BLOCK to denote it.
Chip Salzenberg <>

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About