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

optional inputs notation

Open guidoBenvenuto opened this issue 9 months ago • 1 comments

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

guidoBenvenuto avatar Jun 01 '24 16:06 guidoBenvenuto