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-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 Clast one really

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

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, may it be

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 the

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-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?

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?

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: : 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

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-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 between

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