We also need to consider the "dimension" of referentiality.  I can see
three levels here.  Given

    @a.mung

the .mung could return

    A) a modified @a (treat @a as mutable)
    B) a new array (treat @a as immutable)
    C) a remapped array whose elements refer back to @a's elements

Currently .rotate is defined as A, but I could easily switch it to B,
so you'd have to write

    @a.=rotate;

to rotate in place.  If we did that, then we could conceivably set
things up with more PDLish C semantics so that

    @a .= mung          # A semantics
    @b  = @a.mung       # B semantics
    @b := @a.mung       # C semantics

This implies, however, that the copy semantics of = are sufficiently
clever to snapshot all the referenced values of @a before clobbering
@a in the case of either:

    @a .= mung
    @a = @a.mung

But list assignment really ought to be doing that in any case.

Maybe .push is really sugar for .=append, and unshift is really sugar
for .=prepend.

Larry

Reply via email to