Bingo.

Do I take it that is not agreement?

As for operations on the container, they are just member functions. Call a suitable one.

So, you are advocating instead of say:

@data[ @ordered[ 0, -1 ] ] = @data[ @ordered[ -1, 0 ] ];

something like this?:

@data.setSlice( items_to_set => [ @ordered.getSlice( 0, @ordered.last ) ], values_to_set => [ @data.getSlice( @ordered.getSlice( @ordered.las +t, 0 ) ], );

Because if you are, it strikes me that is moving much further away from both the syntax and spirit of Perl than the minor correction of the historical inconsistency that you are up in arms about.

From Re^2: [Perl 6] $ and @ - what is it coming to?:

What if an Object is a collection class of some kind? And it only is useful on the top-level, as anything already inside another collection is a scalar.

The elements of a collection are always scalars. There is no ambiguity there.

When I first came to Perl, the unique requirement to use a different sigil when referring to an individual element of a collection, than when referring to the whole collection, or part thereof, was one of the most confusing things I encountered. Totally different from any other language I had used. And from what I've seen here I do not think I am unique in that. Sure you get used to it, but it never made much sense (to me).

For example, there is the whole dichotomy of this (an empty slice) being perfectly legal and useful:

## an empty slice at runtime c:\test>perl -mstrict -wle"my @a='a'..'z'; print @a[ grep $_ == 10, 1. +.9 ];" ## no output and no errors

And this being illegal:

## an empty slice at compile time c:\test>perl -mstrict -wle"my @a='a'..'z'; print @a[ ];" Scalar value @a[ ] better written as $a[ ] at -e line 1. syntax error at -e line 1, near "[ ]" Execution of -e aborted due to compilation errors.

Same for one-element slice:

## a slice of one element at runtime c:\test>perl -mstrict -wle"my @a='a'..'z'; print @a[ grep $_ == 5, 1.. +9 ];" f

And this being illegal:

## a slice of one element at compile time c:\test>perl -mstrict -wle"my @a='a'..'z'; print @a[ 5 ];" Scalar value @a[ 5 ] better written as $a[ 5 ] at -e line 1. f

Both are inconsistent and illogical. It is making a distinction between zero or single element lists and a multi-element lists, when there should be none.


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
"Too many [] have been sedated by an oppressive environment of political correctness and risk aversion."

In reply to Re^7: [Perl 6] $ and @ - what is it coming to? by BrowserUk
in thread [Perl 6] $ and @ - what is it coming to? by John M. Dlugosz

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.