[REBOL] context of a function - Enhancement request Re:(3)
From: rebol:techscribe at: 22-Aug-2000 12:12
Hi Frank,
Aha, you wish to determine the equivalence of the BINDed word to the word
the same word IN the object's body. You then must know the index of the
local word you are comparing to in the object body i.e. your expression
first second second o
you wrote:
> >> o: make object! [sth: [a] a: 9]
> >> same? first second second o bind 'a in o 'self
> == true
The equivalent also works with my in-func:
>> f: cfunc [a] [a]
>> same? second second :f in-func :f 'a
== true
I trust that the in-func function I proposed in my previous email, together
with cfunc and get-context-block help solve your serialization problem? Or
is there something I have overlooked?
Take Care,
At 02:21 PM 8/22/00 +0200, you wrote:
>
>On Mon, 21 Aug 2000 [rebol--techscribe--com] wrote:
>
>> BTW
>>
>> >same? first second :f in :f 'a
>> >== true
>>
>> does not work for objects:
>>
>> >> o: make object! [a: none b: none]
>> >> second first :o
>> == a
>> >> in :o 'a
>> == a
>> >> same? (second first :o) (in :o 'a)
>> == false
>>
>> so I wouldn't expect it to work for functions either.
>
>second :f functions body. So I woulc expect, that same? would
>return true. Equivalent to object would be:
>
> >> o: make object! [sth: [a] a: 9]
> >> same? first second second o bind 'a in o 'self
> == true
>
>CU,
>Frank
>
;- Elan [ : - ) ]
author of REBOL: THE OFFICIAL GUIDE
REBOL Press: The Official Source for REBOL Books
http://www.REBOLpress.com
visit me at http://www.TechScribe.com