Nix Language Quirks: Difference between revisions

imported>Roberth
Correct and explain the most egregious stuff
Qyriad (talk | contribs)
Clarify that tab characters are not stripped in indented strings
Line 125: Line 125:
Not really surprising, but ...
Not really surprising, but ...


Leading whitespace is removed also in single-line Indented Strings
Leading spaces are removed also in single-line Indented Strings


<syntaxHighlight lang=nix>
<syntaxHighlight lang=nix>
Line 138: Line 138:
'' == "s\n"
'' == "s\n"
</syntaxHighlight>
</syntaxHighlight>
Though note that [https://en.wikipedia.org/wiki/Tab_key#Tab_characters tab characters] are ''not'' stripped:
<syntaxhighlight lang=nix>
''
s
'' ==  " s\n"
</syntaxhighlight>
See [https://github.com/NixOS/nix/issues/7834 NixOS/nix#7834] and [https://github.com/NixOS/nix/pull/9971 NixOS/nix#9971] for more information.


== Integer precision ==
== Integer precision ==