[Nix-dev] confused using the <obj> ? <string> operator with non literal operators

Samuel samuelrivas at gmail.com
Mon May 9 15:25:08 CEST 2016


Am I holding some false assumption here? It seems the ? operator has
different behaviour depending on how the right hand side is evaluated:

nix-repl> foo = { bar = "baz"; }

nix-repl> quux = "bar"

nix-repl> foo ? "bar"
true

nix-repl> foo ? quux
false

nix-repl> foo ? "${quux}"
true

nix-repl> quux == "${quux}"
true

nix-repl> builtins.typeOf quux
"string"

-- 
Samuel


More information about the nix-dev mailing list