for loop list of lists: flattening arguments to pointy sub

2005-12-25 Thread Andrew Savige
Flattening argument lists is not yet working in Pugs, so I can't easily play around with this one, hence this question. In Pugs, you can process a simple list of lists like this: my @lol = ( [ '1a', '1b' ], [ '2a', '2b' ], [ '3a', '3b' ] ); for @lol -> $t { say "1st='$t[0]' 2nd='$t[1]'" } Yet th

Re: for loop list of lists: flattening arguments to pointy sub

2005-12-25 Thread Ingo Blechschmidt
Hi, Andrew Savige wrote: > In Pugs, you can process a simple list of lists like this: > > my @lol = ( [ '1a', '1b' ], [ '2a', '2b' ], [ '3a', '3b' ] ); > for @lol -> $t { say "1st='$t[0]' 2nd='$t[1]'" } > > Yet the $t[0] and $t[1] look untidy to me, so I'd prefer to specify > that the for closur

Re: binding arguments

2005-12-25 Thread Ingo Blechschmidt
Hi, Juerd wrote: > The next thing I thought was: hey, argument *passing* is actually > *binding* to variables in the sub, so why not use the := operator? > That works very well, because binding as an expression makes no sense > anyway, it being a language thing. And luckily, named arguments are >

Re: Iterating over complex structures

2005-12-25 Thread Rob Kinyon
On 12/22/05, Michele Dondi <[EMAIL PROTECTED]> wrote: > Suppose I want to navigate a tree and print out info contained in each of > its leaves along with info gathered from the position in the tree of the > list itself? Can I do it in a "universal" manner as hinted above that > would work for other