[REBOL] Re: Problems with block of datatype!s
From: ryanc:iesco-dms at: 12-Sep-2001 10:31
Hey Tim,
datatypes seem strange this way. I found the same thing
with 'select some time ago. I eventually somehow figured
out that the trick is to pass the datatype as a word.
I just now noticed that this can be tricky if you need to
convert your datatype, example:
>> to word! string!
** Script Error: Expected one of: word! - not: datatype!
** Where: do-boot
** Near: to word! string!
>>
Ho, ho, ho. Merry feedback. After goofing around for
awhile I came up with this quick fix for you...
>> datatype-to-word: func [dt [datatype!]] [first to-block
join dt "!"]
>> type? probe datatype-to-word string!
string!
== word!
>>
I will send a copy of this to feedback.
--Ryan
Tim Johnson wrote:
> I would like to be able to test a word for a
> match in a block whose members are datatypes.
>
> The example code doesn't do what I want it to do:
> >> types: [string! number!]
> == [string! number!]
> >> find types string!
> == none ; was hoping for [string! number!]
> >> types/1 = string!
> == false ; was hoping for 'true
> Just curious: what else do I need to do here?
> TIA
> tj
> --
> To unsubscribe from this list, please send an email to
> [rebol-request--rebol--com] with "unsubscribe" in the
> subject, without the quotes.
--
Ryan Cole
Programmer Analyst
www.iesco-dms.com
707-468-5400