tazjin/nix-1p

Language usage of the "?" character

Opened this issue · 0 comments

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.