[REBOL] Re: No return Value???
From: rebol:techscribe at: 28-Nov-2003 14:25
1. You can use unset? to check for words that do not return values .
>> unset? print ""
>> if unset? print "" [result: "<<unset>>"]
2. If you need to assign the return value of the tested function to some
local word, you can use set/any to avoid an error.
3. Why doesn't print return a value? Wel;l, I suspect that is because
the purpose of print is to display its argument. If print were to return
a value, it would not only be displaying its argument, it would force
the REBOL interpreter to display print's return value as well. I.e. you
would see a combination of the printed argument and print's return value
on the screen. Instead of
>> print ""
which is the expected result, for instance, you would get
>> print_with_return: func [arg] [ print arg return true ]
>> print_with_return ""
BUT the argument to print was NOT "==true" it was "".
Hope this helps.
Tim Johnson wrote: