[REBOL] Re: How do I handle an unset! item as a parameter to other words
From: gerardcote:sympatico:ca at: 2-Dec-2002 21:34
Hello Jan,
You wrote :
> That's the expected behaviour. Function 'what accepts nothing
> and returns nothing. In C or Java parlance it's return type would
> be 'void.
> It does print something on the console, but that's a side effecting
> operation. Other (static!) languages would spell it very clearly:
> Ocaml ------ what: ( )
> Haskell ----- what :: IO ( )
> but unfortunately Rebol does not care that much for the
> return types, because it can only figure them out dynamicly;
> that is, after executing statements or expressions.
> That's what the 'type? function is telling you:
> type? what
> == unset
> It means that there is no real object returned from the 'what
> function.
> If you want to intercept output from functions like this then
> you need to deal with the standard output itself. Look at the script
> library - consoleio.r, keyb.r, etc.
Thank you very much for the explanation. I'll look at these other scripts you suggest.
Cheers,
Gerard