[REBOL] Re: to/make datatype!
From: al:bri:xtra at: 18-Oct-2002 16:03
Joel Neely wrote:
> So far the most simplest way I've come up with to create a DATATYPE! value
from a STRING! value is
> to-datatype: func [s [string!]] [
> first reduce load rejoin [
> "[" s either #"!" = last s ["]"] ["!]"]
> ]
> ]
>
> >> type? to-datatype "string" == datatype!
> >> make to-datatype "integer" "12" == 12
>
> There's *got* to be a better way! Any suggestions?
I missed seeing this earlier. Here's my solution:
Type: 'string! ; with a lit-word!
Data: 123
to do Type Data
Type: "string!" ; and with a string!
Data: 123
to do Type Data
I hope that helps!
Andrew Martin
ICQ: 26227169 http://valley.150m.com/