Nix Language Quirks: Difference between revisions

Add quirk related to builtins.toString handling of true vs false
Line 246: Line 246:


There is an example in <code>coq</code> package code [https://github.com/NixOS/nixpkgs/blob/5185539c51ba658e70b29e01c0c320a85f4e2098/pkgs/build-support/coq/extra-lib.nix#L98 here] where someone used this behavior to build a reusable function <code>switch</code>.
There is an example in <code>coq</code> package code [https://github.com/NixOS/nixpkgs/blob/5185539c51ba658e70b29e01c0c320a85f4e2098/pkgs/build-support/coq/extra-lib.nix#L98 here] where someone used this behavior to build a reusable function <code>switch</code>.
== builtins.toString true and false handling are inconsistent ==
<syntaxHighlight lang=nix>
nix-repl> builtins.toString true
"1"
nix-repl> builtins.toString false
""
</syntaxHighlight>


== Nix Language FAQ ==
== Nix Language FAQ ==