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

[REBOL] Re: Updates to hof script

From: g:santilli:tiscalinet:it at: 16-Nov-2002 19:14

Hi Jan, On Saturday, November 16, 2002, 5:45:53 PM, you wrote: JS> [[3 "a"] [7 "c"] [10 "d"]]? In a PARSE-alike notation, one could write: [some [into [integer! string!]]] This notation has the IMO non-trivial advantage that you can use PARSE to check for validity:
>> parse [[3 "a"] [7 "c"] [10 "d"]] [some [into [integer! string!]]]
== true
>> parse [[3 "a"] [7 8] [10 "d"]] [some [into [integer! string!]]]
== false
>> parse [[3 "a"] 7 "c" [10 "d"]] [some [into [integer! string!]]]
== false Also, one could even be more specific on the valid content one can get; if you can accept empty blocks too, you can use ANY instead of SOME; if your blocks can contain from 4 to 8 integers, you can use the notation [4 8 integer!], and so on. Regards, Gabriele. -- Gabriele Santilli <[g--santilli--tiscalinet--it]> -- REBOL Programmer Amigan -- AGI L'Aquila -- REB: http://web.tiscali.it/rebol/index.r