ucblogo-code icon indicating copy to clipboard operation
ucblogo-code copied to clipboard

Unclear output of IF "FALSE

Open jasonsikes opened this issue 10 months ago • 2 comments

The IF command outputs the result of the instruction list if the condition is TRUE.

That enables the user to, for example:

MAKE "MESSAGE IF :USERNAME = "jsmith ["Welcome!]
PRINT :MESSAGE

What is the output if the condition is FALSE?

Of course, my example IS bad programming practice and probably should result in an error. It's just that the error message is unclear; an empty list is a list.

? show if "false ["hello]
Macro returned [] instead of a list

jasonsikes avatar May 02 '24 18:05 jasonsikes