[REBOL] Re: to/make datatype!
From: joel:neely:fedex at: 16-Oct-2002 14:52
Thanks, Scott!
G. Scott Jones
wrote:
> From: "Joel Neely"
> ...
> >
> > 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?
>
...
> to-datatype: func [s [string!]] [
> do join s either #"!" = last s [""]["!"]
> ]
>
> ;where
> type? to-datatype "string" ;== datatype!
> to to-datatype "string" "12" ;== "12"
>
That's certainly an improvement, IMHO! Anybody know why it has to be
so hard?
-jn-
--
----------------------------------------------------------------------
Joel Neely joelDOTneelyATfedexDOTcom 901-263-4446