Nix Language Quirks: Difference between revisions

Some formatting changes and link to a separate quirk list
DHCP (talk | contribs)
m No negative number literals: use "console" syntaxhighlight and "$" prefix for shell command
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
{{merge|Nix Expression Language|same type of information in the expression language article}}
{{merge|Nix (language)}}


== <code>with</code> and <code>let</code> ==
== <code>with</code> and <code>let</code> ==
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