mirror of
https://github.com/NixOS/nix
synced 2025-07-07 14:21:48 +02:00
Add a unary integer negation operator
This allows saying "-1" instead of "builtins.sub 0 1".
This commit is contained in:
parent
159e621d1a
commit
5d147e125c
3 changed files with 11 additions and 4 deletions
|
@ -16,6 +16,11 @@ let {
|
|||
range = range_ [];
|
||||
*/
|
||||
|
||||
body = sum (range 1 50) + 123 + 456;
|
||||
x = 12;
|
||||
|
||||
body = sum
|
||||
[ (sum (range 1 50))
|
||||
(123 + 456)
|
||||
(0 + -10 + -(-11) + -x)
|
||||
];
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue