[REBOL] Re: Adding functions to an object.
From: al:bri:xtra at: 27-Feb-2002 18:12
Anton wrote:
> I want to modify the existing object in place. Is that possible?
Not directly. But try something like this:
>> o: make object! [
[ Name: "My Object!"
[ Extensions: make block! 10
[ ]
>> repend o/Extensions bind ['Test func [x][print [x name "!!"]]] in o 'self
== [Test func [x][print [x name "!!"]]]
>> o/extensions/test 4
4 My Object! !!
>> name
** Script Error: name has no value
** Near: name
>> test
** Script Error: test has no value
** Near: test
>>
I hope that helps!
Andrew Martin
ICQ: 26227169 http://valley.150m.com/