Re: Strange interaction between pairs and named binding

2005-07-22 Thread Damian Conway
Larry wrote: : If the Bare code object (including pointy and non-pointy) default their : parameter types to "Any" (that is, Item|Pair|Junction), then all of : these would work: : : for [1..10].pairs { say(.value) } : for [1..10].pairs { say($^x.value) } : for [1..10].pairs -> $x {

Re: Strange interaction between pairs and named binding

2005-07-22 Thread Larry Wall
On Tue, Jul 19, 2005 at 12:25:02PM +0800, Autrijus Tang wrote: : On Mon, Jul 18, 2005 at 03:48:55PM -0700, Brent 'Dax' Royal-Gordon wrote: : > Autrijus Tang <[EMAIL PROTECTED]> wrote: : > > This currently works in Pugs: : > > : > > for [1..10].pairs -> Pair $x { say $x.value } : > > : > > But t

Re: Strange interaction between pairs and named binding

2005-07-18 Thread Autrijus Tang
On Mon, Jul 18, 2005 at 03:48:55PM -0700, Brent 'Dax' Royal-Gordon wrote: > Autrijus Tang <[EMAIL PROTECTED]> wrote: > > This currently works in Pugs: > > > > for [1..10].pairs -> Pair $x { say $x.value } > > > > But this does not: > > > > for [1..10].pairs -> $x { say $x.value } > > > > Be

Re: Strange interaction between pairs and named binding

2005-07-18 Thread Brent 'Dax' Royal-Gordon
Autrijus Tang <[EMAIL PROTECTED]> wrote: > This currently works in Pugs: > > for [1..10].pairs -> Pair $x { say $x.value } > > But this does not: > > for [1..10].pairs -> $x { say $x.value } > > Because the ruling that pairs must not be bound to parameters that are > not explicitly declared

Re: Strange interaction between pairs and named binding

2005-07-18 Thread Larry Wall
On Mon, Jul 18, 2005 at 08:42:24PM +0800, Autrijus Tang wrote: : This currently works in Pugs: : : for [1..10].pairs -> Pair $x { say $x.value } : : But this does not: : : for [1..10].pairs -> $x { say $x.value } : : Because the ruling that pairs must not be bound to parameters that are

Strange interaction between pairs and named binding

2005-07-18 Thread Autrijus Tang
This currently works in Pugs: for [1..10].pairs -> Pair $x { say $x.value } But this does not: for [1..10].pairs -> $x { say $x.value } Because the ruling that pairs must not be bound to parameters that are not explicitly declared to handle them. Is this a desirable behaviour? Thanks,