>> "set" means "assign a value to," as when
>>  you declare a variable and then assign it a value.
>> 
>> You were trying to assign a value to a variable that
>>  did not exist.
>
>Yes, but that IS the purpose of "set"

Where did you derive that definition from? The PURPOSE of 'set is to assign
a value to a word. It just so happens that, in the case of a word that does
not yet exists, that word is "created".

When you attempt to create a new word as an element of an object, it is
clear why your approach doesn't work once you understand the meaning of the
functions you are performing: eg:

set in some-obj 'some-word some-value

can also be written: set (in some-obj 'some-word) some-value

'in will return a word within the context of the given object. This word is
used in turn by 'set. If the given word does not exist in the object, 'in
has nothing that it can return and thus 'set will receive nothing (actually,
none!).

>>> set 'test-word "test words"
>== "test words"
>>> print test-word
>test words
>>>
>
>I have just assigned a value to a variable that previously did not exist.
>
>Thus, reading that I can...
>
>>>set in object 'word value
>
>makes perfect sense.

Too bad we do not live in a perfect world ;)

AFAIK once you create an object, you cannot change the definition. If you
are lucky enough to be able to collect all of the needed elements beforehand
(and this my be at run time) your REBOL script can create a string of the
definition then 'do it.

- Michael Jelinek

Reply via email to