In Rebol 3 you can dynamically add keys and values to objects with append:
>> foo: object [x: 10]
>> append foo [y: 20 z: 30]
== make object! [
x: 10
y: 20
z: 30
]
But if you try that with functions, it doesn't seem to work:
>> foo: object [x: 10]
>> append foo reduce [y: does [print "y"] z: does [print "z"]]
** Script error: invalid argument: make function! [[][print "y"]]
** Where: append
** Near: append foo reduce [y: does [print "y"] z: does [print "z"]]
You can add a function with extend:
>> foo: object [x: 10]
>> extend foo 'y does [print "y"]
>> foo/y
y
But that only lets you add one at a time. How can you add a block of arbitrary keys/values to an object, with some of them functions?