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

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

Thread Previous
From:
Autrijus Tang
Date:
May 11, 2005 14:11
Subject:
Re: (1,(2,3),4)[2]
Message ID:
20050511210806.GA18511@aut.dyndns.org
On Wed, May 11, 2005 at 03:00:15PM -0600, Luke Palmer 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.

You're totally right, and I was clearly wahnsinnig.  It now returns 3.

Thanks,
/Autrijus/

Thread Previous


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