Re: $pair[0]?

2005-08-05 Thread Larry Wall
On Fri, Aug 05, 2005 at 12:27:53AM +0200, Ingo Blechschmidt wrote: : Hi, : : Andrew Shitov wrote: : say $pair[0]; # a? : : It looks like $pair is an arrayref while 'say ref $pair' tells 'Pair'. : : right, this is why I asked, IMHO it's bogus. Yes, for bare pairs, it's probably somewhat

Re: $pair[0]?

2005-08-05 Thread Yuval Kogman
On Fri, Aug 05, 2005 at 11:36:16 -0700, Larry Wall wrote: There's something to be said for having a way of indexing into that using numeric subscripts. Certainly Lisp's extensible car/cdr notation is the wrong way to do it, but cdddr is certainly shorter than $pair.value.value.value

Re: $pair[0]?

2005-08-05 Thread Mark Reed
Seems like you left out the degenerate case for when you run out of pairs: sub infix:!! (Scalar $x, 0) { $x } On 2005-08-05 16:24, Yuval Kogman [EMAIL PROTECTED] wrote: On Fri, Aug 05, 2005 at 11:36:16 -0700, Larry Wall wrote: There's something to be said for having a way of indexing

$pair[0]?

2005-08-04 Thread Ingo Blechschmidt
Hi, my $pair = (a = 1); say $pair[0]; # a? say $pair[1]; # 1? I've found this in the Pugs testsuite -- is it legal? --Ingo -- Linux, the choice of a GNU | Black holes result when God divides the generation on a dual AMD | universe by zero. Athlon!|

Re: $pair[0]?

2005-08-04 Thread Ingo Blechschmidt
Hi, Luke Palmer wrote: On 8/4/05, Ingo Blechschmidt [EMAIL PROTECTED] wrote: my $pair = (a = 1); say $pair[0]; # a? say $pair[1]; # 1? I've found this in the Pugs testsuite -- is it legal? Nope. That's: say $pair.key; say $pair.value; Also: say