ucblogo-code
ucblogo-code copied to clipboard
Unclear output of IF "FALSE
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