darren chamberlain <[EMAIL PROTECTED]> wrote:
>James G Smith <[EMAIL PROTECTED]> said something to this effect on 07/03/2001:
>> sub use : immediate {
>>   # do stuff here if logging
>>   return CORE::use(@_);
>> }
>
>To go OT here, what would 'immediate' be doing here, if Perl
>supported it?

It would be run at compile time when the compiler ran into it 
instead of waiting for run-time.  Basically, the following 
invocations of &foo and &bar would be equivalent.  The 
`immediate' modifier could wrap an implicit BEGIN { } around any 
invocation of the subroutine.

sub bar { do something; }

sub foo : immediate {
  bar(@_);
}

foo($a, $b);

BEGIN {
  bar($a, $b);
}

This is used in FORTH to support such things as if-then-else and 
do-while constructs since they are just entries in the dictionary 
like any other definition.  FORTH actually uses it to build up 
the entire language since there are no reserved words.
-- 
James Smith <[EMAIL PROTECTED]>, 979-862-3725
Texas A&M CIS Operating Systems Group, Unix

Reply via email to