Re: Does this mean we get Ruby/CLU-style iterators?

2002-01-19 Thread Michael G Schwern
On Fri, Jan 18, 2002 at 08:03:41PM -0800, Larry Wall wrote: > : allow this: > : > : File.foreach('/usr/dict/words') { print } > > File.foreach('/usr/dict/words', { print }) > > or even (presuming the prototype is available for parsing): > > File.foreach '/usr/dict/words' { print }

Re: Does this mean we get Ruby/CLU-style iterators?

2002-01-18 Thread Piers Cawley
Larry Wall <[EMAIL PROTECTED]> writes: > Michael G Schwern writes: > : Reading this in Apoc 4 > : > : sub mywhile ($keyword, &condition, &block) { > : my $l = $keyword.label; > : while (&condition()) { > : &block(); > : CATCH { > : my $

Re: Does this mean we get Ruby/CLU-style iterators?

2002-01-18 Thread Larry Wall
Piers Cawley writes: : Hmm... making up some syntax on the fly. I sort of like the idea of : being able to do : : class File; : sub foreach ($file, &block) is Control { : # 'is Control' declares this as a control sub, which, amongst : # other things 'hides' itself from cal

Re: Does this mean we get Ruby/CLU-style iterators?

2002-01-18 Thread Larry Wall
Michael G Schwern writes: : Reading this in Apoc 4 : : sub mywhile ($keyword, &condition, &block) { : my $l = $keyword.label; : while (&condition()) { : &block(); : CATCH { : my $t = $!.tag; : when X::Control::next { die

Re: Does this mean we get Ruby/CLU-style iterators?

2002-01-18 Thread Piers Cawley
Dan Sugalski <[EMAIL PROTECTED]> writes: > At 3:37 PM + 1/18/02, Piers Cawley wrote: >>Michael G Schwern <[EMAIL PROTECTED]> writes: >> >>Hmm... making up some syntax on the fly. I sort of like the idea of >>being able to do >> >> class File; >> sub foreach ($file, &block) is Control {

Re: Does this mean we get Ruby/CLU-style iterators?

2002-01-18 Thread Dan Sugalski
At 3:37 PM + 1/18/02, Piers Cawley wrote: >Michael G Schwern <[EMAIL PROTECTED]> writes: > >Hmm... making up some syntax on the fly. I sort of like the idea of >being able to do > > class File; > sub foreach ($file, &block) is Control { > # 'is Control' declares this as a contr

Re: Does this mean we get Ruby/CLU-style iterators?

2002-01-18 Thread Piers Cawley
Michael G Schwern <[EMAIL PROTECTED]> writes: > Reading this in Apoc 4 > > sub mywhile ($keyword, &condition, &block) { > my $l = $keyword.label; > while (&condition()) { > &block(); > CATCH { > my $t = $!.tag; > when X::

Does this mean we get Ruby/CLU-style iterators?

2002-01-18 Thread Michael G Schwern
Reading this in Apoc 4 sub mywhile ($keyword, &condition, &block) { my $l = $keyword.label; while (&condition()) { &block(); CATCH { my $t = $!.tag; when X::Control::next { die if $t && $t ne $l); next } w