Tail recursive function ignores empty list in IF instruction
A Logo programming environment for Microsoft Windows
Brought to you by:
david_costanzo
An operation like
TO SHOWBUG :list
IF EMPTY? :list [[] STOP]
OUTPUT FPUT FIRST :list SHOWBUG BUTFIRST :list
END
Has a bug on the first line. It should be
IF EMPTY? :list [STOP]
In FMSLogo, this runs fine
SHOW SHOWBUG "abc
[a b c]
In UCBLogo 6.2, it throws an error
? SHOW SHOWBUG [a b c]
You don't say what to do with [] in SHOWBUG
[IF EMPTY? :list [[] STOP]]
The UCBLogo behavior is the correct behavior.