Nix Language Quirks: Difference between revisions

DoggoBit (talk | contribs)
m propose merge
DHCP (talk | contribs)
m No negative number literals: use "console" syntaxhighlight and "$" prefix for shell command
 
Line 153: Line 153:
Negative numbers are parsed as "zero minus positive"
Negative numbers are parsed as "zero minus positive"


<pre>
<syntaxhighlight lang="console">
nix-instantiate --parse --expr '(-1)'
$ nix-instantiate --parse --expr '(-1)'
(__sub 0 1)
  (__sub 0 1)
</pre>
</syntaxhighlight>


So this throws, because the positive number is out of range
So this throws, because the positive number is out of range