Problem
The current operators precedence is documented as https://nix.dev/manual/nix/2.24/language/operators
Function application has the second highest precedence.
Only attribute selection is higher.
But i found that this is not actually true.
See below:
nix-repl> a = x: x
nix-repl> [ a 10 ]
[
«lambda @ «string»:1:2»
10
]
Which is exepected. Since in this case we want to create individual tokens within the list.
While the following feels weird
nix-repl> [ -10 ]
error: syntax error, unexpected '-'
at «string»:1:3:
1| [ -10 ]
|
List tokenization seems to have a precedence of 1.5 👀 which i didn't find documented.
nix-repl> set = { a =1; }
nix-repl> [ set.a ]
[ 1 ]
Proposal
Document the behavior properly.
Checklist
Add 👍 to issues you find important.
Problem
The current operators precedence is documented as https://nix.dev/manual/nix/2.24/language/operators
Function application has the second highest precedence.
Only attribute selection is higher.
But i found that this is not actually true.
See below:
Which is exepected. Since in this case we want to create individual tokens within the list.
While the following feels weird
List tokenization seems to have a precedence of
1.5👀 which i didn't find documented.Proposal
Document the behavior properly.
Checklist
Add 👍 to issues you find important.