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

[REBOL] Re: to/make datatype!

From: g:santilli:tiscalinet:it at: 17-Oct-2002 0:58

Hi Joel, On Wednesday, October 16, 2002, 8:30:37 PM, you wrote: JN> So far the most simplest way I've come up with to create a DATATYPE! JN> value from a STRING! value is JN> to-datatype: func [s [string!]] [ JN> first reduce load rejoin [ JN> "[" s either #"!" = last s ["]"] ["!]"] JN> ] JN> ] I cannot think of anything better than: to-datatype: func [s [string!]] [ get to-word either #"!" = last s [s] [join s "!"] ] or if you don't like depending on the fact that there are some words referring to datatypes: to-datatype: func [s [string!]] [ load rejoin ["#[datatype! " s either #"!" = last s ["]"] ["!]"]] ] (The latter doesn't work on old versions.) Regards, Gabriele. -- Gabriele Santilli <[g--santilli--tiscalinet--it]> -- REBOL Programmer Amigan -- AGI L'Aquila -- REB: http://web.tiscali.it/rebol/index.r