On Wed, 9 Oct 2002, Nicholas Clark wrote:
: On Tue, Oct 08, 2002 at 06:07:09PM -0700, Larry Wall wrote:
: > There's this basic rule that says you can't have an operator for both binary
: > and postfix, since it's expecting an operator in either case, rather than a
: > term (which is how we recognize prefix operators).  The one exception I can
: > think of is that we might allow .. as a postfix operator, but only if followed
: > by a right bracket.  That would let us say
: > 
: >     @a[0..]
: > 
: > rather than
: > 
: >     @a[0..Inf]
: > 
: > But that's a special case.
: 
: 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]

: (0..)  # pass infinite lists as parameters with less typing
: {0..}  # not sure, but it follows on

I meant those too when I said "bracket".

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

Larry

Reply via email to