Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[ALLY] Enhancement Request - Range! datatype

 [1/26] from: al::bri::xtra::co::nz at: 20-Aug-2000 9:24


Currently there's a XY datatype in Rebol/View. Eg: 100x123 for 100 X, 123 Y. It would be nice to have a range, describing two endpoints. For example, Dates: 12/Jan/2000-24/Dec/2000 Integers: 1-10 Time: 09:00-17:00 Money: $10.00-$56.00 These would have refinements like: /Start or /Begin /End or /Finish /First /Last to access the first or last part of the range. 'first on: 12/Jan/2000-24/Dec/2000 like: first 12/Jan/2000-24/Dec/2000 would produce: 12/Jan/2000 and 'last on 12/Jan/2000-24/Dec/2000 like: last 12/Jan/2000-24/Dec/2000 would produce: 24/Dec/2000 Operations like: if now in 12/Jan/2000-24/Dec/2000 [print "mostly in this year!] would be nice as well. This has been CC-ed to [feedback--rebol--com]. Any comments? Andrew Martin ICQ: 26227169 http://members.xoom.com/AndrewMartin/

 [2/26] from: dynalt:dynalt at: 19-Aug-2000 18:43


I like the range idea but would suggest the use of a different operator than '-' - possibly ',,' which is used in several other languages? Thanks, Garold (Gary) L. Johnson DYNAMIC Alternatives [dynalt--dynalt--com]

 [3/26] from: dynalt:dynalt at: 19-Aug-2000 19:06


>I like the range idea but would suggest the use of a different operator
than
> '-' - possibly ',,' which is used in several other languages?
I really meant '..' rather then ',,'. Sorry. Thanks, Garold (Gary) L. Johnson DYNAMIC Alternatives [dynalt--dynalt--com]

 [4/26] from: g:santilli:tiscalinet:it at: 20-Aug-2000 12:59


Hello [dynalt--dynalt--com]! On 20-Ago-00, you wrote: d> I like the range idea but would suggest the use of a different d> operator than '-' - possibly ',,' which is used in several d> other languages? The dash is what is used in human languages, so I agree with Andrew here. What's the problem with it? Regards, Gabriele. -- Gabriele Santilli <[giesse--writeme--com]> - Amigan - REBOL programmer Amiga Group Italia sez. L'Aquila -- http://www.amyresource.it/AGI/

 [5/26] from: dynalt:dynalt at: 20-Aug-2000 13:01


> From: [g--santilli--tiscalinet--it] [mailto:[g--santilli--tiscalinet--it]] > Sent: Sunday, August 20, 2000 3:59 AM
d> I like the range idea but would suggest the use of a different d> operator than '-' - possibly '..' which is used in several d> other languages? g> The dash is what is used in human languages, so I agree with g> Andrew here. What's the problem with it? 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. Thanks, Garold (Gary) L. Johnson DYNAMIC Alternatives [dynalt--dynalt--com]

 [6/26] from: al:bri:xtra at: 21-Aug-2000 17:55


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/

 [7/26] from: allen:rebolforces at: 21-Aug-2000 16:37


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: <[Al--Bri--xtra--co--nz]> To: <[list--rebol--com]> Cc: <[Feedback--rebol--com]>

 [8/26] from: gschwarz:netconnect:au at: 21-Aug-2000 16:56


The "to" has won me. Greg

 [9/26] from: petr:krenzelok:trz:cz at: 21-Aug-2000 9:06


[gschwarz--netconnect--com--au] wrote:
> The "to" has won me.
Yes, and we can even have a fun with shorter version "to" = "2", e.g. 1210 being of type range ;-) -pekr-

 [10/26] from: al:bri:xtra at: 21-Aug-2000 19:23


AllenK wrote:
> I like the use of "-" but I feel it will cause confusion if a negative is
used in the range.
> -1--10
Actually, the lesser value should be first. So this should be: -10--1 It does look a bit odd for negative numbers. Perhaps both ".." and "-" could be allowed? Then: -10..-1 looks better.
> ".." 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
It does look odd. Though it does look slightly clearer if leading zeroes are added: 0.1..0.12 It's better looking with "-": 0.1-0.12
> 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?
I quite like the "to" as a range! datatype indicator. Thanks for the suggestion, Allen. I've CC-ed this to [feedback--rebol--com]. For range! datatype, use one or more of the following: - ; The dash. .. ; Two full stops. to ; The letters to, meaning "to". to indicate a range! datatype. I'd like the ability to have all three as alternatives. But if I'm forced to have only one, I'd prefer "to" as the range! datatype indicator. This shouldn't preclude the use of 'to as a word, just as the pair! datatype doesn't preclude the use of 'x as a word. Andrew Martin ICQ: 26227169 http://members.xoom.com/AndrewMartin/

 [11/26] from: bhandley:zip:au at: 21-Aug-2000 17:25


> 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?
to could be exclusive and "thru" inclusive like parse. Don't know what you do about the range start though. .. is quite concise (if barely legible on my monitor ;) ). So if we were lucky enough to get some range math use a .. b for an inclusive range as suggested before. a <.. b for an exclusive start point and inclusive end point a ..> b you can guess a <..> b a range that does not include the end points Brett.

 [12/26] from: al:bri:xtra at: 21-Aug-2000 19:58


Greg wrote:
> The "to" has won me.
Me too. :-D Does anyone know if "to" in languages other than English, means something different from "to" in English? How about in: Italian German Gaelic German Greek Spanish Geek ;-) As I think that's all the languages with A"to"Z... <- Which leads me into thinking, what about characters and strings? Like: r: "aaa"to"zzz" r: "aaa"-"zzz" r: "aaa".."zzz" r: #"A"to#"Z" I think for strings and characters, the "-" is nicer, as it's visually clearer. So, I'd really, really like all three ["to" "-" ".."] as alternative indicators for the 'range! datatype. Andrew Martin Caution: Prone to sudden fits of inspiration... <- So where does "..." fit in Rebol? :-) ICQ: 26227169 http://members.xoom.com/AndrewMartin/

 [13/26] from: al:bri:xtra at: 21-Aug-2000 20:07


pekr wrote:
> [gschwarz--netconnect--com--au] wrote: > > > The "to" has won me. > > Yes, and we can even have a fun with shorter version "to" = "2", e.g. 1210
being of type range ;-) :-D Does "to" have any special meaning in Czechoslovakian (I hope I spelled that right), pekr? Andrew Martin ICQ: 26227169 http://members.xoom.com/AndrewMartin/

 [14/26] from: jpt:zyxel:no at: 21-Aug-2000 10:20


> -----Original Message----- > From: [Al--Bri--xtra--co--nz] [mailto:[Al--Bri--xtra--co--nz]]
<<quoted lines omitted: 15>>
> Geek ;-) <SNIP>
In norwegian to means 2 ;) -- With kind regards Jan Pedro Tumusok - ZyXEL Communications AS Mølleparken 4 - N-0459 Oslo - Norway Phone (+47) 22 80 61 80 - Fax (+47) 22 80 61 81 Did you visit www.zyxel.no today ?

 [15/26] from: jean:holzammer:faedv-n:bayern at: 21-Aug-2000 10:42


> > Does "to" have any special meaning in Czechoslovakian (I hope I spelled
that
> right), pekr? >
Probably the same as in Spaenglish ;-) (there are 2 (!) languages, one Czech and one Slovakian. You are from the U.S. , aren't you ?) Jean

 [16/26] from: al:bri:xtra at: 21-Aug-2000 20:53


> > Does "to" have any special meaning in Czechoslovakian (I hope I spelled
that right), pekr?
> Probably the same as in Spaenglish ;-) (there are 2 (!) languages, one
Czech and one Slovakian. You are from the U.S. , aren't you ?) No, I'm in New Zealand, where there's Maori and English: [Al--Bri--xtra--co--nz] <- .nz = New Zealand and most of us speak NewZild. ;-) Of course, my question now is, does "to" have any special meaning in Czech or Slovakian? :-) Andrew Martin Newly enlightened ICQ: 26227169 http://members.xoom.com/AndrewMartin/

 [17/26] from: petr:krenzelok:trz:cz at: 21-Aug-2000 11:45


[Al--Bri--xtra--co--nz] wrote:
> pekr wrote: > > [gschwarz--netconnect--com--au] wrote:
<<quoted lines omitted: 6>>
> Does "to" have any special meaning in Czechoslovakian (I hope I spelled that > right), pekr?
to means "it" in Czech language (we divorced with Slovak republic some time ago so now we are separate Czech and Slovak reps ... in case you care :-) As for the topic of discussion, I like also "..", "<.." "..>" idea :-) -pekr-

 [18/26] from: ptretter:charter at: 21-Aug-2000 9:15


I dont think we need a range datatype. Ranges can be quite complex for different and complex values inviting more and more source manipulation for every new type of value. Besides it seems evident that REBOL is more than powerful enough will little code to get the results desired. Paul Tretter

 [19/26] from: lmecir:geocities at: 21-Aug-2000 17:22


By accident, both Czech and Slovak "to" means English "it". Regards Ladislav

 [20/26] from: g:santilli:tiscalinet:it at: 21-Aug-2000 19:14


Hello [dynalt--dynalt--com]! On 20-Ago-00, you wrote: d>> The dash is what is used in human languages, so I agree d>> Andrew here. What's the problem with it? d> It would seem d> that trying to distinguish between a range literal and a word d> (which can have dash characters), or an issue literal which d> uses dashes presents a problem for both people and REBOL. Words and issues can have "x"s too, but REBOL is able to understand that 100x100 is a pair!. I think that Andrew's examples wouldn't create problems for the parser, which already seems to be able to do some magic. Anyway, ".." is a reasonable separator too, so we can leave the choice to Carl. Regards, Gabriele. -- Gabriele Santilli <[giesse--writeme--com]> - Amigan - REBOL programmer Amiga Group Italia sez. L'Aquila -- http://www.amyresource.it/AGI/

 [21/26] from: carlos:lorenz at: 21-Aug-2000 21:40


May I suggest ? How about: 1 ~ 10 ? Lorenz

 [22/26] from: alex:pini:mclink:it at: 22-Aug-2000 20:35


>- Open Your Mind -<
Quoting from [Al--Bri--xtra--co--nz's] message (21-Aug-00 09:23:20). I like the range! idea. My two cents follow... A>> I like the use of "-" but I feel it will cause confusion if a negative is A> used in the range. A>> A>> -1--10 A> A> Actually, the lesser value should be first. So this should be: A> A> -10--1 I dissent. There could be situations needing inverted ranges, for example scientific calculation/simulation. Now that I mention that, the /delta refinement immediately springs to mind.
>> r1: 6-15.6
== 6-15.6
>> r1/delta
== 9.6
>> r2: 4--100
== 4--100
>> r2/delta
== -104 Alessandro Pini ([alex--pini--mclink--it]) Fasten your seatbelt. I'm gonna try something. (Solo)

 [23/26] from: alex:pini:mclink:it at: 22-Aug-2000 20:55


>- Open Your Mind -<
Quoting from [ptretter--charter--net's] message (21-Aug-00 16:15:16). p> I dont think we need a range datatype. Ranges can be quite complex for p> different and complex values inviting more and more source manipulation for p> every new type of value. Besides it seems evident that REBOL is more than p> powerful enough will little code to get the results desired. Very true. But then again we don't need the url! datatype either. (-: Alessandro Pini ([alex--pini--mclink--it]) (strike)

 [24/26] from: alex:pini:mclink:it at: 22-Aug-2000 20:53


>- Open Your Mind -<
Quoting from [Al--Bri--xtra--co--nz's] message (21-Aug-00 09:58:38). A>> The "to" has won me. A> A> Me too. :-D A> A> Does anyone know if "to" in languages other than English, means something A> different from "to" in English? How about in: A> Italian A> German A> Gaelic A> German A> Greek A> Spanish A> Geek ;-) As for Italian, "TO" was short for "Torino" (the city of Turin) on car plates until some years ago; it is un-commonly used as "take this" when you give something (a dish, a slap on the face); finally, it is an interjection of surprise, spelled "to'" or "toh", used for example when you see someone you didn't expect to see or you haven't seen for a long time. Yeah, I think 11to149 is OK for Italians, too. :-))) Alessandro Pini ([alex--pini--mclink--it]) Use the Force, Luke! SOCK! "OW! No..." POW! "OFF! Not like thif!!" KICK! "YOW! Ftop it!!" BRAMMM! "OOOUCH! Cut it! Now!!!" CRACK!

 [25/26] from: deadzaphod:h:otmail at: 23-Aug-2000 18:07


When writing Japanese with the roman alphabet "to" means "and" ;-)

 [26/26] from: meekerdb:rain at: 24-Aug-2000 22:37


Why not use <-> as in -30.2<->.05 . Brent Meeker On 21-Aug-00, [g--santilli--tiscalinet--it] wrote:

Notes
  • Quoted lines have been omitted from some messages.
    View the message alone to see the lines that have been omitted