Matt Diephouse <[EMAIL PROTECTED]> wrote:
> here's a simpler snippet that displays the same failure:
>
> .sub _main :main
>   .local pmc pir
>   pir = compreg "PIR"
>
>   new_pad 0
>
> $S0 = <<"END_PIR"
> .sub a
>   $P1 = find_lex 1, '$a'
> .end
> END_PIR
>   $P2 = pir($S0) # using find_name to get the the PMC for a makes it work
>   store_global "b", $P2
>
>   c()
> .end
>
> .sub c
>   new_pad -1
>   b() # changing this to a() also makes it work
> .end

I tracked down the reason for this failure last night: Eval objects
are Closures. That is also why using find_name worked: it returns a
Sub instead of an Eval. A one word change (changing Evals to be Subs
instead of Closures) will fix this and several Tcl tests.

Is it okay to change Evals to inherit from Subs? Both behaviors are
probably desirable at different times, but I don't think Closures
should be the default: you suspect you would still be able to create a
closure from the Eval if you wanted to do so.

Thanks,

--
matt diephouse
http://matt.diephouse.com

Reply via email to