develooper Front page | perl.perl6.language | Postings from May 2005

Re: (1,(2,3),4)[2]

Thread Previous | Thread Next
From:
Aaron Sherman
Date:
May 11, 2005 15:25
Subject:
Re: (1,(2,3),4)[2]
Message ID:
1115850278.27930.40.camel@pps
On Wed, 2005-05-11 at 17:48, Matt Fowles wrote:

> On 5/11/05, Luke Palmer <lrpalmer@gmail.com> wrote:
> > On 5/11/05, Autrijus Tang <autrijus@autrijus.org> wrote:
> > > In a somewhat related topic:
> > >
> > >     pugs> (1,(2,3),4)[2]
> > >     4
> > >
> > > Because the invocant to .[] assumes a Singular context.
> > 
> > Right, but the *inside* of the invocant is still a list, so it's in
> > list context.  I think that line should return 3.
> 
> I am confused as to why exactly this is the case.  Are you saying that
> nested lists like this flatten?  That would certainly catch me off
> guard.  Would you mind explaining that to me a little more?

I'm confused as well. How does that play with Larry's comment:

http://groups-beta.google.com/group/perl.perl6.language/browse_frm/thread/54a1135c012b97bf/d17b4bc5ae7db058?q=list+comma&rnum=5&hl=en#d17b4bc5ae7db058

-- 
Aaron Sherman <ajs@ajs.com>
Senior Systems Engineer and Toolsmith
"It's the sound of a satellite saying, 'get me down!'" -Shriekback



Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About