DEFINE allows impossible default number of inputs to be specified, result is...
A Logo programming environment for Microsoft Windows
Brought to you by:
david_costanzo
DEFINE is documented as allowing the same inputs/format as TO. TO doesn't allow the default number of inputs to be specified as something greater than the number of inputs. DEFINE allows the default input number to be any number. If this happens to be larger than the number of inputs, the result is not callable.
How Reproducible:
Every Time
Steps to Reproduce:
DEFINE "BAD_PROC [ [a 2] [ OUTPUT :a ] ]
What Happens:
No error is thrown, and BAD_PROC is defined, but you can't call it.
BAD_PROC 1
not enough inputs to BAD_PROC
(BAD_PROC 1)
not enough inputs to BAD_PROC
(BAD_PROC 1 2)
too much inside ()'s
Expected Result:
DEFINE throws a "doesn't like input" error, as UCBLogo 6.2.5 does:
? DEFINE "BAD_PROC [ [a 2] [ OUTPUT :a ] ]
DEFINE doesn't like 2 as input
Notes:
TO behaves correctly:
TO BAD_PROC :a 2
TO doesn't like 2 as input