or keyword
The or
keyword is used to provide a default value when accessing an attribute in Nix setsᛦ.
Example
{ a = "Foo"; b = "Bar"; }.c or "Xyzzy"
This evaluates to "Xyzzy"
since the set has no c
attribute.
The or
keyword is used to provide a default value when accessing an attribute in Nix setsᛦ.
{ a = "Foo"; b = "Bar"; }.c or "Xyzzy"
This evaluates to "Xyzzy"
since the set has no c
attribute.