[REBOL] Re: dbms3.r 01
From: rotenca:telvia:it at: 19-Jan-2002 14:18
Hi Robert,
> > Can an object's spec block be extended, or
> > modified, after it is created?
>
> Hi, yes it can:
>
> extend-object: func ['obj-word [word!] 'word [word!] value [any-type!]
/local
> the-obj][
> all [not object? the-obj: get obj-word make error! "No object provided."]
>
> if in the-obj word [
> set in the-obj word value
> return the-obj
> ]
>
> set obj-word make the-obj reduce [to-set-word word value]
> ]
No, it can't. What your rotine do is to create a new object:
>> x: x1: context [a: 1]
>> y: extend-object x b 2
>> probe x1
make object! [
a: 1
]
---
Ciao
Romano