On Sat, Apr 23, 2005 at 10:21:56AM -0700, Larry Wall wrote:
> : Now, those two semantics directly clash when the RHS can be
> : interpreted both ways.  One good example would be array dereference:
> : 
> :     my ($x, @a);
> :     $x := @a[-1];
> :     @a = (1..100);
> :     say $x;
> : 
> : Under the linking semantic, there is no location in RHS to bind yet.
> : One possible interpretation is just autovivify it -- but [-1] is not
> : autovivifiable, so it should throw out an fatal exception under the
> : linking semantic right there.  Under the thunking semantic, of course,
> : it will work as expected.
> 
> I would prefer the exception.

Alright.  I wish I had seen this mail earlier -- because I just
implemented the call-by-name semantics with snapshotting of RHS pad.

Oh well.  At least the same code can be salvaged to make iThreads
and serializable continuations work.

So, hm.  What does this do?

    my ($x, @a);
    $x := @a[0];        # vivified or not?
    @a = (1..100);
    say $x;

Thanks,
/Autrijus/

Attachment: pgpCuMI650CeH.pgp
Description: PGP signature

Reply via email to