[REBOL] Re: Business Object Versioning
From: robert:muench:robertmuench at: 6-Apr-2002 15:22
> -----Original Message-----
> From: [rebol-bounce--rebol--com] [mailto:[rebol-bounce--rebol--com]]On Behalf Of
> Gabriele Santilli
> Sent: Friday, April 05, 2002 9:19 PM
> To: Robert M. Muench
> Subject: [REBOL] Re: Business Object Versioning
> Well, I think you already know we can only workaround currently.
;-) Yep...
> etc. so I'll try with a different approach. :)
>
> add-word: func [
> "Create a new object like the old one but with a word added"
> object [object!]
> word [word!]
> ] [
> make object reduce [to-set-word word none]
> ]
Here is my solution:
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]
]
Looks pretty the same :-))
> rename-word: func [
> ...
>
> remove-word: func [
> ...
Great stuff! Thanks a lot.
> template: clear [] ; not recursive, use copy if you need it to recurse
I didn't get it here. Can you explain it a bit more? Robert