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

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

Thread Next
From:
Chip Salzenberg
Date:
June 14, 2005 07:12
Subject:
&?CALLER::BLOCK vs. any hope of efficient compilation
Message ID:
20050614141308.GP19372@tytlal.topaz.cx
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 <chip@pobox.com>

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About