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

[REBOL] R: Re: switch and datatype

From: rotenca:telvia:it at: 6-Jul-2001 23:02

Da: <[sterling--rebol--com]>
> The issue is that [string!] in a block is actually a word: > type? first [string!] > == word!
Thank you!!
> Do either: > switch type?/word "a string" [ > string! [print #switched] > ]
The only method i've found: tipo: string! switch to-word mold tipo [string! [print "switched"]]
> or > switch string! reduce [ > string! [print #switched] > ]
tipo: string! switch tipo compose [ (reduce string!) [print "switched"]]
> The first is better because it does not have to reduce this possibly > large block.
Compose reduce a little.
> Sterling
ciao (my english is bad) romano paolo tenca