[REBOL] Re: patching an object
From: dhsunanda:gma:il at: 9-Jul-2007 17:46
Brian:
> Sunanda; I'm probably 'not getting it', but
>
> my-api: make my-api [b: 12 f1: [a - b]]
Thanks for the reply.
The differences in your code are:
1. I was using two objects
2. f1 was a function in both cases
If I put those characteristics back, and then try your make trick
(rather than my original construct/with approach), I get....
my-api: make object! [
a: 1
b: 2
f1: func [] [print a + b]
]
patch: make object! [b: 12 f1: func [][print a - b]]
my-api: make my-api third patch
** Script Error: a has no value
** Near: print a - b
.... which is the original issue, restated.
***
This will work with your approach:
my-api: make my-api load mold third patch
But it hardly seems elegant to my mind.
Any other approaches out there?
Thanks,
Sunanda