Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[REBOL] Re: No return Value???

From: rebol:techscribe at: 28-Nov-2003 14:25

Hi Tim. 1. You can use unset? to check for words that do not return values .
>> unset? print ""
== true
>> 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 ""
== true
>>
BUT the argument to print was NOT "==true" it was "". Hope this helps. Elan Tim Johnson wrote: