On Wed, Oct 09, 2002 at 10:35:32AM -0700, Larry Wall wrote:
> On Wed, 9 Oct 2002, Nicholas Clark wrote:
> : On Tue, Oct 08, 2002 at 06:07:09PM -0700, Larry Wall wrote:
> : Would that mean that three other special cases of postfix .. might exist?
> :
> : 0..; # useful for return 0..;
>
> I bet the PDLers want to be able to say: @a[0..; 0..:10; 0..:100]
Logically does that mean , also gets in on the special case?
I think it makes sense, as I presume one could pass a couple of infinite lists
to a function that way.
> : (0..) # pass infinite lists as parameters with less typing
> : {0..} # not sure, but it follows on
>
> I meant those too when I said "bracket".
Oops - sorry. I'm so used to American texts that use bracket, brace and
parentheses to mean [] {} () (in that order, IIRC), so I assumed that you
were strictly following that convention.
> If only we had Unicode editors, we could just force everyone to use
> the infinity symbol where they mean it. It seems a shame to make a
> special case of the .. operator. Maybe we should ... to mean "and so
> on forever":
>
> @a[0...; 0...:10; 0...:100]
>
> Except then we couldn't use it to mean what Ruby means by it, which
> might be handier in real life. (It means to exclude the endpoint,
> so 0...4 is the same as 0..3. But then, that's kind of odd too.)
I think it would be clearer with .. Inf, and however many "special cases" make
sense. Presumably ] } ) ; : , are all symbols that can't be unary prefix
operators?
And if ... is exclude the endpoint, there's little difference between
0 .. Inf and 0 ... Inf, so the mathematicians can write 0 ... and be happy,
can't they?
Nicholas Clark
--
Even better than the real thing: http://nms-cgi.sourceforge.net/