1
0
Fork 0
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:
Eelco Dolstra 2013-08-02 17:35:59 +02:00
parent 159e621d1a
commit 5d147e125c
3 changed files with 11 additions and 4 deletions

View file

@ -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)
];
}