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


Reply via email to