Skip to content

Language usage of the "?" character #18

@WayneSherman

Description

@WayneSherman

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions