[REBOL] Re: R: Re: switch and datatype
From: g:santilli:tiscalinet:it at: 7-Jul-2001 14:52
On 06-Lug-01, you wrote:
RT> tipo: string! switch to-word mold tipo [string! [print
Is there any reason you can't use:
tipo: type?/word value-to-check
RT> tipo: string! switch tipo compose [ (reduce string!) [print
You can remove the REDUCE here.
RT> Compose reduce a little.
Hmm... I don't this it will be any faster (slower, maybe). Anyway,
you'll usually do this only once so this is not a problem.
Also, notice that:
>> switch string! ["" [print "A-ha!"]]
which is probably simples, provided you're dealing with types
that can be represented literally (lexically?).
Gabriele Santilli <[giesse--writeme--com]> - Amigan - REBOL programmer
Amiga Group Italia sez. L'Aquila -- http://www.amyresource.it/AGI/