ucblogo-code
ucblogo-code copied to clipboard
optional inputs notation
In the manual section "8.1 Procedure Definition", optional inputs are represented by the following notation:
[:inputname default.value.expression]
The following notation is on the other side valid:
[inputname default.value.expression]
as can be seen in the following example:
to add [num 2]
output sum 3 :num
end
to add1 [:num 2]
output sum 3 :num
end
? show add
5
? show add1
5
? show text "add
[[[num 2]] [output sum 3 :num]]
? show text "add1
[[[num 2]] [output sum 3 :num]]
Please note that "fulltext" preserves the differences:
? show fulltext "add
[to add [num 2] output sum 3 :num end]
? show fulltext "add1
[to add1 [:num 2] output sum 3 :num end]
I wonder if this alternative notation could be explainded in the manual. Yours Guido Gay