Autrijus Tang skribis 2005-04-23 18:51 (+0800):
> Now, those two semantics directly clash when the RHS can be
> interpreted both ways.

Not if methods for attributes like .chars promise to always return the
same variable, which would make even more sense if they were lvalue
methods. They can be put to use, like

    .chars = 5;  # truncate or pad

or they can be made read-only lvalues, as is a numeric literal:

    $foo := 5;
    $foo++;     # error.

> 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.

But when do you do when the index is non-literal?

    $foo := @bar[$bar];

Does this work like creating an lvalue closure { @bar[$bar] } and
calling it, does it bind to the @bar with $bar as it was at the moment
of binding?

Is it true that every thunking thing is essentially a compile time
bind, and linking(aliasing) is a runtime thing? If so, can the semantics
each have their own operator? :=, ::=. I don't know if this makes any
sense, but that has something to do with me never understanding the
purpose of ::=.


Reply via email to