Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

optional inputs notation #183

Open
guidoBenvenuto opened this issue Jun 1, 2024 · 1 comment
Open

optional inputs notation #183

guidoBenvenuto opened this issue Jun 1, 2024 · 1 comment

Comments

@guidoBenvenuto
Copy link

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
Copy link
Author

Sorry, I didn't notice this clear explanation in the manual (pages 4-5, Introduction):

One final point: The TO command in Logo has always been a special case; the rest of the
line starting with TO is not evaluated as ordinary Logo expressions are. In particular, the
colons used to mark the names of inputs to the procedure do not cause THING to be invoked.
They are merely mnemonic aids, reminding the Logo user that these words are names of
variables. ... Berkeley Logo therefore makes the colons optional:
TO FOO :IN1 :IN2
and
TO FOO IN1 IN2
are both allowed.

Yours
Guido Gay

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant