On Thu, May 18, 2006 at 01:01:13PM +0200, Klaas-Jan Stol wrote:
> hi,
> 
> if I understand correctly, the :immediate pragma makes the sub which has 
> this pragma run immediately after parsing (well, at least before running 
> the program)
> 
> Suppose I have this code:
> 
>    .sub loadstuff :immediate
>       # load stuff
>    .end
> 
>    .sub main
>        dostuff( )
>        end
>    .end
> 
> Then, running this code will start running the loadstuff( ) again 
> (because main doesn't have the :main pragma, and loadstuff() is at the 
> top of the file).
> My concern is, is this the desired effect? Shouldn't the :immediate subs 
> only be run once? So, in effect shouldn't they be skipped (if they're at 
> the top of the file, where execution starts when :main is missing) when 
> running the program?

I'm a fan of explicitness and orthogonality -- I don't see that 
":immediate" should silently imply "and don't use this sub as :main".  
If a sub other than the first one listed is main, mark it as ":main" 
and be done with it.

Pm

Reply via email to