>From S29:

: =item end
:
:  our Any method end (@array: ) is export
:
: Returns the final subscript of the first dimension; for a one-dimensional
: array this simply the index of the final element.  For fixed dimensions
: this is the declared maximum subscript.  For non-fixed dimensions
(undeclared
: or explicitly declared with C<*>), the actual last element is used.


The last sentence  seems to suggest that not the index of the last
element is returned, but the element itself. (Which I think is pretty weird)


And S02:

: The C<$#foo> notation is dead.  Use C<@foo.end> or C<@foo[*-1]> instead.
: (Or C<@foo.shape[$dimension]> for multidimensional arrays.)

That doesn't clean it up totally either.

So what should <a b c>.end return? 2 or 'c'?
(Currently pugs and elf return 2, rakudo 'c').

Cheers,
Moritz

Reply via email to