> > Oops, a correction. [..] should mean 'the set of all integers'. _Not_ the > > univeral set. So my code snippet should be: > > @i = [..]; # @i contains the integers > > $s = sum (grep 0<__<=100 @i); > > print "The sum of the 1st 100 integers is: $s"; > > > > I still think it would be cool to be able to specify other infinite sets > > somehow (with rationals, with complex, etc) but [..] isn't the right way. > > Sorry about that. > > If we're going to do THAT, why not predeclare functions (or static > lists) of different mathematical terms, like the set of all real > numbers, the set of all natural numbers, the set of integers, etc.? No > sense in mangling the .. operator (not to mention the anonymous array > reference) to suit a specific purpose like that. > Sure. But when I see: @positiveInts = (1..); @negativeInts = (..-1); isn't it rather perlish to expect that I can then write: @allTheInts = (..); BTW, I didn't really mean to use array _references_. When I said [..], I meant (..) I'll issue another correction.
- RFC 24 (v1) Semi-finite (lazy) lists Perl6 RFC Librarian
- Re: RFC 24 (v1) Semi-finite (lazy) lists Ariel Scolnicov
- Re: RFC 24 (v1) Semi-finite (lazy) lists Chaim Frenkel
- Re: RFC 24 (v1) Semi-finite (lazy) lists Damian Conway
- Re: RFC 24 (v1) Semi-finite (lazy) lists Ted Ashton
- Re: RFC 24 (v1) Semi-finite (lazy) lists Jeremy Howard
- Re: RFC 24 (v1) Semi-finite (lazy) lists Damian Conway
- Re: RFC 24 (v1) Semi-finite (lazy) lists Jeremy Howard
- Re: RFC 24 (v1) Semi-finite (lazy) lists Jeremy Howard
- Re: RFC 24 (v1) Semi-finite (lazy) lists Mike Pastore
- Re: RFC 24 (v1) Semi-finite (lazy) lists Jeremy Howard
- Re: RFC 24 (v1) Semi-finite (lazy) lists Jeremy Howard
- Re: RFC 24 (v1) Semi-finite (lazy) lists Ariel Scolnicov
- Re: RFC 24 (v1) Semi-finite (lazy) lists Jeremy Howard
- Re: RFC 24 (v1) Semi-finite (lazy) li... Ariel Scolnicov
- Re: RFC 24 (v1) Semi-finite (laz... Jeremy Howard
- Re: RFC 24 (v1) Semi-finite ... Ariel Scolnicov
- Infinite lists (was Re: ... Jeremy Howard
- Re: Infinite lists (was ... Ken Fox
- Re: Infinite lists (was ... Jeremy Howard
- Re: Infinite lists (was ... John Porter