[REBOL] Re(2): Setting Block Data
From: arolls:bigpond:au at: 28-Nov-2000 20:18
Hello,
REBOL/View 0.10.38.3.1 31-Oct-2000
This is what I just tried (first two lines just the same).
set-field: func [a v] [do form reduce [to-set-path a v]]
info: [db [[detail "detail one"] [detail "detail two"]]]
set-field "info db 1 detail" #"q"
Goodbye console!?!
Other letters or strings give a script error - "hello" has no value,
#"a" has no value, etc.
A bug? Anyone?
--- That was five days ago, this is now (works):
set-field: func [a v] [form reduce [to-set-path a v]]
info: [db [[detail "detail one"] [detail "detail two"]]]
do set-field "info db 1 detail" {"well hello there"}
>> info
== [db [[detail "well hello there"] [detail "detail two"]]]
b: [I am a block]
do set-field "info db 2 detail" {b}
>> info
== [db [[detail "well hello there"] [detail [I am a block]]]]
do set-field "info db 2 1" {'maTete}
>> info
== [db [[detail "well hello there"] [maTete "two"]]]
I couldn't figure out how to 'bind 'info into the function's context,
so the trick is to have 'set-field return what should be done, then
just 'do it.
-Anton.