Hi,
Elan wrote:
>to word! and make word! work:
>
>>> new-word: to word! :item
>== word
>>> new-word
>== word
>>> new-word: make word! :item
>== word
>>> new-word
>== word
>
>whereas to-word fails:
>
>>> new-word: to-word :item
>** Script Error: word needs a value.
>** Where: to word! value
Gabriele pointed out this or a similar problem with the to- functions.
They should really all be rewritten like this:
>> source to-word
to-word: func ["Converts to word value." value "Value to convert"]
[to word! value]
>> to-word first [this: that]
** Script Error: this needs a value.
** Where: to word! value
>> to-word: func ["Converts to word value." value "Value to convert"]
[to word! :value] ; last item should be a get-word
>> to-word first [this: that]
== this
This is a problem for (at least) value arguments that are set-words, parens
and paths. Another example:
>> to-block first [this/is/just/a/path]
** Script Error: this has no value.
** Where: to block! value
>> source to-block
to-block: func ["Converts to block value." value "Value to convert"]
[to block! value]
>> to-block: func ["Converts to block value." value "Value to convert"]
[to block! :value]
>> to-block first [this/is/just/a/path]
== [this is just a path]
See you,
Eric