[REBOL] Re: Embedded Object and Scope - again...
From: arolls::bigpond::net::au at: 10-May-2001 3:53
I really don't know the answer.
I think we need a make/deep or something.
I think the embedded-object words are still bound to
the ancestor-object context. That means global-obj-prop
is still bound to the ancestor-object.
Does this modification help?:
print-global-obj-prop: func [obj][
print get in obj 'global-obj-prop
]
; try it out
ancestor-object/init 10 ; == 10
ancestor-object/embedded-object/print-global-obj-prop
ancestor-object ; == 10 - good
;try it out again
descendant-object/init 20 ; == 20
descendant-object/embedded-object/print-global-obj-prop
descendant-object ; == 20
Anton.