Hi Andrew,

I like the use of "-" but I feel it will cause confusion if a negative is
used in the range.

-1--10

".." does indicate in English text that something has not been left out. But
it is confusing if a decimal is used in the range.

.1...10

So what other suggestions could we have for the operator?

how about?
1to10
-1to-10
.1to.10

Is using n"to"n that different from using n"x"n for pairs? It is immediately
obvious that it is a range, ( in English at least).

Other ideas?

Cheers,

Allen K


----- Original Message -----
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Monday, August 21, 2000 3:55 PM
Subject: [REBOL] Enhancement Request - Range! datatype Re:(4)


> Gary wrote:
> > I like the range idea but would suggest the use of a different operator
> than '-' - possibly '..' which is used in several other languages?
>
> Gabriele wrote:
> > The dash is what is used in human languages, so I agree with Andrew
here.
> What's the problem with it?
>
> Gary wrote:
> > It would seem that trying to distinguish between a range literal and a
> word (which can have dash characters), or an issue literal which uses
dashes
> presents a problem for both people and REBOL.
>
> I tried it with Rebol. First here's a range! literal:
>
> >> r: 1-10
> ** Syntax Error: Invalid date -- 1-10.
> ** Where: (line 1) r: 1-10
>
> Of course, it doesn't work, 'cause it's an invalid time.
>
> Here's a valid time. Note that I need to put in a year:
>
> >> r: 1-10-95
> == 1-Oct-1995
>
> Now here's an issue. Note that the issue needs a "#" mark, as used in
human
> languages:
>
> >> r: #1-10
> == #1-10
>
> Now here's what Rebol would produce, with a 'range! datatype, and some
> common operator words refinements:
>
> >> r: 1-10
> == 1-10
>
> >> type? r
> == range!
>
> >> first r
> == 1
>
> >> second r
> == 10
>
> >> source r
> r: 1-10
>
> >> r/first
> == 1
> >> r/last
> == 10
>
> I think it looks nice. Of course, there could be some problem I haven't
seen
> yet with it. Can anyone think of anything?
>
> Andrew Martin
> ICQ: 26227169
> http://members.xoom.com/AndrewMartin/
> -><-
>
>

Reply via email to