Re: iterators and functions (and lists)

2004-12-10 Thread Luke Palmer
Michele Dondi writes: > On Mon, 6 Dec 2004, Larry Wall wrote: > > >to return an infinite list, or even > > > > return 0..., 0...; > > > >to return a surreal list. Either of those may be bound to an array > > Hope not to bark something utterly stupid, but... if one iterates over > such a list,

Re: iterators and functions (and lists)

2004-12-10 Thread Matthew Walton
Michele Dondi wrote: On Sun, 5 Dec 2004, Matthew Walton wrote: At least we had the sense to call them subroutines instead of functions. Of course, that also upset the mathematicians, who wanted to call them functions anyway. Go figure. That might be because the mathematicians haven't heard of a v

Re: iterators and functions (and lists)

2004-12-10 Thread Michele Dondi
On Mon, 6 Dec 2004, Larry Wall wrote: to return an infinite list, or even return 0..., 0...; to return a surreal list. Either of those may be bound to an array Hope not to bark something utterly stupid, but... if one iterates over such a list, may it be that on the first C one really starts ov

Re: iterators and functions (and lists)

2004-12-10 Thread Michele Dondi
On Sun, 5 Dec 2004, Matthew Walton wrote: At least we had the sense to call them subroutines instead of functions. Of course, that also upset the mathematicians, who wanted to call them functions anyway. Go figure. That might be because the mathematicians haven't heard of a variant of a function

Re: iterators and functions (and lists)

2004-12-07 Thread Matthew Walton
Larry Wall wrote: On Sun, Dec 05, 2004 at 12:05:46AM +, Matthew Walton wrote: : I'm sorry, but from a C++ background, overriding postcircumfix:<( )> : feels far more natural to me than setting 'is default' on some method. That only works for disambiguation if you know which .() to call in th

Re: iterators and functions (and lists)

2004-12-06 Thread Smylers
Larry Wall writes: > As far as I can recall we haven't renamed C<.specs> to anything else yet. That sounds like a challenge ... Smylers

Re: iterators and functions (and lists)

2004-12-06 Thread Larry Wall
On Mon, Dec 06, 2004 at 06:14:56PM -0500, Austin Hastings wrote: (B: Luke Palmer wrote: (B: (B: >Larry Wall writes: (B: > (B: > (B: >>Any foo() can return a list. That list can be a Lazy list. So the (B: >>ordinary return can say: (B: >> (B: >> return 0...; (B: >> (B: >>to return a

Re: iterators and functions (and lists)

2004-12-06 Thread Austin Hastings
Luke Palmer wrote: Larry Wall writes: Any foo() can return a list. That list can be a Lazy list. So the ordinary return can say: return 0...; to return an infinite list, or even return 0..., 0...; Is it just me, or did you just return Ï*2? http://en.wikipedia.org/wiki/Ordinal#Arit

Re: iterators and functions (and lists)

2004-12-06 Thread Luke Palmer
Larry Wall writes: > Any foo() can return a list. That list can be a Lazy list. So the > ordinary return can say: > > return 0...; > > to return an infinite list, or even > > return 0..., 0...; Is it just me, or did you just return Ï*2? http://en.wikipedia.org/wiki/Ordinal#Arithmeti

Re: iterators and functions (and lists)

2004-12-06 Thread Larry Wall
On Sun, Dec 05, 2004 at 12:05:46AM +, Matthew Walton wrote: : I'm sorry, but from a C++ background, overriding postcircumfix:<( )> : feels far more natural to me than setting 'is default' on some method. That only works for disambiguation if you know which .() to call in the first place. It

Re: iterators and functions (and lists)

2004-12-04 Thread Matthew Walton
Larry Wall wrote: : of course, that analogy isn't going to work for "true" functions, which : returns the same all the time, for some given set of arguments. Oh, well, we pissed off the mathematicians long ago. :-) At least we had the sense to call them subroutines instead of functions. Of cour

Re: iterators and functions (and lists)

2004-12-04 Thread Larry Wall
On Sat, Dec 04, 2004 at 08:03:53PM +0300, Alexey Trofimenko wrote: : hm.. consider that: : : perl5: :open $fh, 'file'; :$first_line = <$fh>; :@remaining = <$fh>; : : perl6: :$fh = open 'file'; :$first_line = $fh(); :@remaining = $fh(); : : I thought about parallels betwee

iterators and functions (and lists)

2004-12-04 Thread Alexey Trofimenko
hm.. consider that: perl5: open $fh, 'file'; $first_line = <$fh>; @remaining = <$fh>; perl6: $fh = open 'file'; $first_line = $fh(); @remaining = $fh(); I thought about parallels between arrays and iterators, and realized that they aren't very close to each other: iterators are