Hi list:

I tried the following:

<snip>

ancestor-object: make object! [
    
    global-obj-prop: make integer! 0
    
    init: func [
        val [integer!]
    ][
        global-obj-prop: make integer! val
    ]
    
    embedded-object: make object! [
            print-global-obj-prop: does [print global-obj-prop]        
    ]
]

</snip>

Ok, so I tried:

>> ancestor-object/init 10
== 10
>> ancestor-object/embedded-object/print-global-obj-prop
10

No problem here :-)

>> descendant-object: make ancestor-object []
>> descendant-object/init 20
== 20
>> descendant-object/embedded-object/print-global-obj-prop
10

Ouch, not what I thought... Let's check... In the "Official Guide", pg 348,
I found:

<quote>
"The ancestor object and the descendant object share the same embedded
object."
</quote>

OK, so I tried something else:

>> descendant-object: make ancestor-object [descendant-embedded-object: make
embedded-object []]
>> descendant-object/init 20
== 20
>> descendant-object/descendant-embedded-object/print-global-obj-prop
10

Again, not what I thought ... I was awaiting 20 !!! ;-(

Here are my questions:

1. Why did RT choose for such implementation ? What are the advantages ?
2. Why did my last try not work - it was -IMHO- logical I should get a
result of 20 ..., as I instanciated the embedded object within the
instanciation of the ancestor object.
2. How can I get my descendant-embedded-object to retrieve the property of
it's container, the descendant-object ?

Thx for answering :-))

chr==




-- 
To unsubscribe from this list, please send an email to
[EMAIL PROTECTED] with "unsubscribe" in the 
subject, without the quotes.

Reply via email to