Hello [EMAIL PROTECTED],
On 04-Jul-00, You wrote:
> Your results differ from mine, I would suggest you to try once
> more...
How embarassing! The differences are because of a typo and wrong
cutting/pasteing, sorry!
--- Start --
>> a: 0 f: func [] [a]
>> o1: make object! [a: 1 g: func [] [a]] o1/g
== 1
>> o2: make object! append [a: 2 g:] [:f] o2/g
== 0
>> o3: make object! append [a: 3 g:] compose/deep [first [(:f)]] o3/g
== 0
>> o4: make object! append [a: 4 g:] reduce ['first reduce [:f]] o4/g
== 0
>> o5: make object! append [a: 5 g:] reduce ['func first :f second :f] o5/g
== 5
>> print [o1/g o2/g o3/g o4/g o5/g a]
1 5 5 5 5 0
--- End ---
That is what You get? I hope so :)
But still o2/g, o3/g, o4/g evaluates to zero before defining o5 and
to 5 after I set o5. As far as I see this can only be because of setting
a to 5 in o5's spec.
First I thought this changes 'a in the global context, but the line where I
'print [...] all values at once proves that I'm wrong here.
Maybe it's just that trying to understand objects, contexts, binding all at
once is to heavy for me. Maybe here the lesser is the more ...
But, each time I believe having understood something, I walk into another trap.
Like this one:
-- Start --
>> o: make object! [a: 5]
>> protect in o 'a
>> set in o 'a 6
** Script Error: Word a is protected, cannot modify.
** Where: set in o 'a 6
>> o/a: 6
== 6
-- End --
Why does the path notation doesn't throw the above error, too?
> Regarding universality/contexts. You can try a mixed approach:
>
> append spec either function? :f reduce [
> ['func third :f second :f]
> ] [
> ['first reduce [:f]]
> ]
>
> Ladislav
I decided to use ecactly this code after having slept over what I'm learned
from you! Despite of the above mentioned problems, that works fine now!
Regards
Christian
[EMAIL PROTECTED]