On Tue Nov 18 16:55:30 2008, [EMAIL PROTECTED] wrote:
> Given this PIR:
> 
>       .sub 'foo' :anon :immediate
>           $P0 = newclass 'Bar'
>       .end
> 
>       .sub 'main' :main
>           $P0 = new 'Bar'
>           $P0.'hi'()
>       .end
> 
>       .namespace [ 'Bar' ]
> 
>       .sub 'hi' :method
>           say "Hi!"
>       .end
> 
> ... the result is:
> 
>       Hi!
> 
> Now compile it to PBC:
> 
>       $ ./parrot -o no_thaw.pbc no_thaw.pir
>       $ ./parrot no_thaw.pbc
> 
>       Class 'Bar' not found
>       current instr.: 'main' pc 6 (no_thaw.pir:6)
> 
> See t/compilers/imcc/syn/hll.t #2 for a failing test.

It's my understanding (from pdd19 and docs/pmc/subs.pod) that the above
is in fact the correct behavior -- :immediate subs only run
automatically when compiled, and not when "loaded" from either the
command line or via a load_bytecode op.

To get the above to work even when run from the command line, add the
:init flag to 'foo'.

Pm
_______________________________________________
http://lists.parrot.org/mailman/listinfo/parrot-dev

Reply via email to