Hi Rebols,
while playing around with objects, I trapped into this:
>> f: func [] [print "Hello!"]
>> f
Hello!
>> spec: []
== []
>> append spec to-set-word 'attribute
== [attribute:]
>> append spec 5
== [attribute: 5]
>> append spec to-set-word 'function
== [attribute: 5 function:]
>> append spec :f
== [attribute: 5 function: func [][print "Hello!"]]
Okay, looks like I'm now having an appropriate specification block for
making an object, but:
>> probe object: make object! spec
Hello!
** Script Error: function needs a value.
** Where: function: func [][print "Hello!"]
What's this? Shouldn't the above return something like
make object! [
attribute: 5
function: func [][print "Hello!"]
]
The same error occurs if I'm printing spec:
>> print spec
Hello!
** Script Error: function needs a value.
** Where: function: func [][print "Hello!"]
where one would expect
5 ?function?
I'm guessing that the error occurs because of wrong contexts of the words in
the spec block. Am I right? And what am I doing wrong here?
Even studying the Rebol.org threads on Contexts and Rebol internals & implementation
(recently mentioned on the list) gave me no idea ...
Christian
[EMAIL PROTECTED]