Mark J. Reed wrote:

On 2003-02-11 at 17:12:52, Joseph F. Ryan wrote:

(@a,@b,@c).pop

This doesn't make any sense, since pop modifies the pop-ee.
What do you expect should happen here?



[@a,@b,@c].pop
Same as above.

Except that the Perl5 equivalent, ugly as the syntax may be, works fine:

pop @{[@a,@b,@c]}

It creates an anonymous array, then removes the last element, leaving two
elements in the array - which is irrelevant since the array is
then discarded completely.
I don't see any reason to change this behavior for Perl6.

Apologies; when I meant "same as above", I meant "same answer that I gave
for:


>>>>   [1..10].map {...

>>>I think this *should* work, although I'm not sure *how*.

Meaning that "I think this should be possible, but I'm not
sure if that syntax is correct, because it would mean that
the arrayrefs would need to be their own class to allow
a method to be called on it, and this class would need to be
a wrapper around the real array class".

Re-reading my original message, I can see the reason for
the confusion.  In fact, I don't even know what I was thinking
when I thought people would make that connection that I wanted,
as it doesn't even make sense to me now :-)

Hmm... now that I think more about it, making array references
their own class and wrapping it around the real array
class would make it pretty easy to cause all of the "auto
dereferencing when necessary" behaivor that is causing
so many problems, since auto-dereferencing wouldn't have to
happen, it would only seem that way.

Does this sound feasible?


Joseph F. Ryan
[EMAIL PROTECTED]


Reply via email to