Re: lazy list syntax?

2005-07-29 Thread Flavio S. Glock
Just wondering - would 'reverse =$foo' call '$foo.previous()' ? - Flavio 2005/7/29, Aankhen <[EMAIL PROTECTED]>: > On 7/29/05, Flavio S. Glock <[EMAIL PROTECTED]> wrote: > > Is "for =" only for filehandles? I tried: > > No, it's for anything that supports iteration... `=$foo` == > `$foo.next()`,

Re: lazy list syntax?

2005-07-29 Thread Aankhen
On 7/29/05, Flavio S. Glock <[EMAIL PROTECTED]> wrote: > Is "for =" only for filehandles? I tried: No, it's for anything that supports iteration... `=$foo` == `$foo.next()`, if I recall correctly. It's probably not yet implemented. Aankhen

Re: lazy list syntax?

2005-07-28 Thread Yuval Kogman
On Thu, Jul 28, 2005 at 19:58:16 -0300, Flavio S. Glock wrote: > 2005/7/28, Yuval Kogman <[EMAIL PROTECTED]>: > > > > I think unary = is what you want: > > > > my @a = $span.lazy; > > > > for [EMAIL PROTECTED] -> $item { > > ... > > } > > > > Ofcourse, my

Re: lazy list syntax?

2005-07-28 Thread Flavio S. Glock
2005/7/28, Yuval Kogman <[EMAIL PROTECTED]>: > > I think unary = is what you want: > > my @a = $span.lazy; > > for [EMAIL PROTECTED] -> $item { > ... > } > > Ofcourse, my @a = $span.lazy will have to be fixed, but what you > tried should be working. Is "f

Re: lazy list syntax?

2005-07-28 Thread Yuval Kogman
On Wed, Jul 27, 2005 at 20:17:41 -0300, Flavio S. Glock wrote: > I have an object representing the sequence "1..Inf". > I tried creating a Coroutine, and then assigning the Coroutine to an > Array, but it only yielded "1": > > my @a = $span.lazy; # "1" > > The coroutine worked fine in a "whil

lazy list syntax?

2005-07-27 Thread Flavio S. Glock
How can I create a lazy list from an object? I have an object representing the sequence "1..Inf". I tried creating a Coroutine, and then assigning the Coroutine to an Array, but it only yielded "1": my @a = $span.lazy; # "1" The coroutine worked fine in a "while" loop, but it didn't work in