in reply to Re^7: [Perl 6] $ and @ - what is it coming to?
in thread [Perl 6] $ and @ - what is it coming to?
The use of [] subscript is a member function on the underlying object. It is called postcurcumfix:<[]> or something like that. The symbol operator syntax is just syntax.
My point is that the compiler doesn't "know" that @x is an array and $y isn't, but simply compiles a call to that member function on the underlying object.
Also, in Perl 6 the negative subscript is no longer right-to-left indexing, unless used with *. If I recall, $x[-1] becomes @x[* -1].
|
|---|