Larry Wall larry-at-wall.org |Perl 6| wrote:
Basically, (ignoring STD's definition of name) I view @a[0] as a
name, in the sense of identifying a unique object.  It just happens
to contain navigational elements like a URL.
OK, that that might be what was meant in the synopses when it was penned 9 years ago, before formal terminology was better fixed.


Of course, if @a is declared to hold only a compact array of native
types, binding a pointer into one of the entries isn't going to fly.
One of my thoughts, exactly.

But we're defining the differences between the behavior of $a and @a in
terms of how it desugars in context, so there's no need for the actual
binding to distinguish any extra levels of indirection.  All it needs
to know is where to poke the pointer to the object.  And normally @a
contains a list of poke-able pointers, so @a[0] := $x is fair game.

And if $x is the wrong type, it errors. So if @a is the "wrong type" in a larger sense of not being able to support that, it errors. E.g. it is a compact array, or some user-defined collection, or is otherwise read-only.

--John


Reply via email to