On Thu, Dec 19, 2002 at 08:03:14AM -0800, David Storrs wrote:
> On Tue, Dec 17, 2002 at 02:51:04PM -0500, Dan Sugalski wrote:
> > At 9:54 AM -0800 12/17/02, Michael Lazzaro wrote:
> > >We _must_ (for some value of "must" that is real close to being a 
> > >100% drop-dead requirement) support --> (L2R), in the form of
> > >
> > >   @a.grep( {...} )
> > >       .map( {...} )
> > >         .sort;
> > 
> > Those are simple method calls, so there's no reason we shouldn't 
> > support them, though they will *only* work if each returns an actual 
> > array, rather than a list. 
> 
> Question on this: for me, one of the trickiest things when teaching
> Perl5 has always been explaining the difference between an array and a
> list, when you need one versus the other, why they aren't precisely
> the same, and where the differences are.
> 
> What exactly are the advantages of having both in Perl6?  Is it
> possible that we could put them together and have only one or the
> other without losing anything (that we aren't willing to lose)?

I was under the impression that the distinction between array and list
was going away in perl 6.  Surely if (1,2,3) creates an anonymous
array reference, then (1,2,3).foo will work for any foo able to
operate on an array.

> >    @b = (*@a, *@b, foobar()) grep {} map {} sort {};
> > 
> > That can't work as methods of the list, unless we're wildly 
> > redefining how lists work, which I don't think we're going to do.
> 
> I don't know enough to see why this is a problem.  Can you explain it?

So, the above would be written a little punctuatively different:

        @b = (*@a, *@b, foobar()).grep({}).map({}).sort({});

-Scott
-- 
Jonathan Scott Duff
[EMAIL PROTECTED]

Reply via email to