[Nix-dev] maximal sharing and comparisons.

Michael Raskin 7c6f434c at mail.ru
Sun Nov 23 12:35:33 CET 2008


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Nicolas Pierron wrote:
> Hi,
> 
> I have a problem with the NixOS implementation.  I have remarked the
> following problem:
> 
> let
>   v = {foo=true;bar=false;};
>   a = builtins.trace v v;
>   b = a;
> in
>   assert a == b; true
> 
> where "v" is printed.  "v" should not be printed because unprocessed
> values of "a" and "b" are identical.  Therefore the assertion should
> succeed without evaluating "a" and "b".

Well, exactly this case (where you could get something for nothing) is
rare. Evaluation uses normal form cache. The only side-effects in the
language are output and creating derivations (neither of them actually
creates any problems for the paths intended to be built). So, I do not
see why it is a problem..
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iQEcBAEBAgAGBQJJKUADAAoJEE6tnN0aWvw3AMkIAI6NxZkQzHtqhUBgBfrUv4SZ
F9GkcmBc7eRfP6mH+Br3M/FPnJf3aXBfG25fb8fk3KuXebYBREvgJllr6Gryi2BP
4wSN1zEkaW5CPAQd/ihOVwMZsMmjgJcLaIBWc0Sx+qF6BMsjoRpFAczW8XM/fAl7
FBsFvVo9GXG83fLX9bzZx/ohpCGwXPo0dLwyI0aL8oMhy+akUf+TqW29EKW29rKI
xGfzHRPArIfNFzEwYZfIcroX6Q4nuAAyOFePOFRhwcxn3Zfk0UoKKsmWvW11w809
qgkwfQadwu8fqPZonT94mE1q/KoHwIpLr7NM4V0zRpfg4zMg6qQlOzuUV0rTchs=
=QjxP
-----END PGP SIGNATURE-----



More information about the nix-dev mailing list