[REBOL] Re: string to object - was: Ask
From: ammoncooke:yaho:o at: 28-Sep-2001 2:11
Not all of what I said was true:
>> type? system/options
== object!
so it is in fact an object! I do have a *cure*:
get-path-obj: func [str [string!]][
return-val: copy[]
tmp-val: parse copy str "/"
for i 1 ((length? tmp-val) - 1) 1[
append return-val [ get in ]
]
append return-val [ get ]
foreach val tmp-val[
append return-val compose [ to-word (:val)]
]
return do compose return-val
]
test that with:
>>probe get in do get-path-obj "system/options/cgi" to-word "server-name"
that should return 'none. It will also work like this:
>> probe do get-path-obj "system/options/cgi"
make object! [
server-software: none
<<cut for room>>
other-headers: []
]
HTH!
Ammon