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

Language usage of the "?" character #18

Open
WayneSherman opened this issue Jan 31, 2024 · 0 comments
Open

Language usage of the "?" character #18

WayneSherman opened this issue Jan 31, 2024 · 0 comments

Comments

@WayneSherman
Copy link

WayneSherman commented Jan 31, 2024

The first occurrence of the "?" character is in the table of language operators. As an operator, the "?" usage is defined as:
set ? attribute Test whether attribute set contains an attribute

The second occurrence of "?" is used is for the example code:
{ name, age ? 42 }: "${name} is ${toString age} years old"

I found this confusing because this usage does not agree with the operator definition.

Since the "?" character can also be used to define default values in function parameter declarations, please add a comment, note, or definition of that usage.

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