[REBOL] Backwards Navigation on path
From: ammoncooke::yahoo::com at: 10-Oct-2001 21:39
Hi,
How can I access a global word from inside a context? Or backwards navigate one:
>> a: make object! [
[ b: make object! [
[ c: "Object"
[ ]
[ d: make object! [
[ e: ../b/c
[ ]
[ ]
** Script Error: .. has no value
** Near: e: ../b/c
>>
Wait... Parent-Face, maybe it's Parent-Object?
>> a: make object! [
[ b: make object! [
[ c: "Object"
[ ]
[ d: make object! [
[ e: self/parent-object/b/c
[ ]
[ ]
** Script Error: Invalid path value: parent-object
** Near: e: self/parent-object/b/c
hmm... No good. I know, let's try getting from a:
>> a: make object! [
[ b: make object! [
[ c: "Object"
[ ]
[ d: make object! [
[ e: a/b/c
[ ]
[ ]
** Script Error: a has no value
** Near: e: a/b/c
Scrap!... Well, I guess I can go:
>> a: make object! [
[ b: make object! [
[ c: "Object"
[ ]
[ d: make object! [
[ e: ""
[ ]
[ ]
>> a/d/e: a/b/c
== "Object"
>> a/d/e
== "Object"
So I got it, so what? I didn't get what I was after. Is there no other way to set a
word in an object to the value of a word in another context in the same object?
I think that when I am done I will submit an article concerning Objects, & Manipulation
to the Zine. (that is if I can find the submital addy again...)
Thanks!!
Ammon