Re: [Nix-dev] with, ++, //, and laziness

2012-03-25 Thread Nicolas Pierron
Hi Again, On Sat, Mar 24, 2012 at 21:38, Nicolas Pierron nicolas.b.pier...@gmail.com wrote: Hi Shea, On Fri, Mar 23, 2012 at 11:01, Shea Levy s...@shealevy.com wrote: Based on my understanding of Nix semantics, I expected the following to all evaluate to 2: let   a = { c = 1; d = b.c; };

Re: [Nix-dev] with, ++, //, and laziness

2012-03-25 Thread Shea Levy
On 03/25/2012 12:38 AM, Nicolas Pierron wrote: rec { a = withATTRNAMES;LAZY { c = 1; d =LAZY c; }; b =LAZY a //LAZY { c = 2; }; } in b.d oul ATTRNAMES implies that we need to be able to iterate over the with clause attribute set to bind names such as c. Even accepting that for

Re: [Nix-dev] with, ++, //, and laziness

2012-03-25 Thread Shea Levy
On 03/25/2012 06:44 PM, Nicolas Pierron wrote: sed -i 's/callPackage/with pkgs; callPackage/' all-packages.nix Eh, at that point I'd rather just go and prefix everything with pkgs. ___ nix-dev mailing list nix-dev@lists.science.uu.nl

Re: [Nix-dev] with, ++, //, and laziness

2012-03-25 Thread Nicolas Pierron
Hi, On Sun, Mar 25, 2012 at 20:18, Shea Levy s...@shealevy.com wrote: On 03/25/2012 12:38 AM, Nicolas Pierron wrote: rec {   a = withATTRNAMES;LAZY  { c = 1; d =LAZY  c; };   b =LAZY  a //LAZY  { c = 2; }; } in b.d oul ATTRNAMES  implies that we need to be able to iterate over the with

Re: [Nix-dev] with, ++, //, and laziness

2012-03-24 Thread Nicolas Pierron
Hi Shea, On Fri, Mar 23, 2012 at 11:01, Shea Levy s...@shealevy.com wrote: Based on my understanding of Nix semantics, I expected the following to all evaluate to 2: let   a = { c = 1; d = b.c; };   b = a // { c = 2; }; in b.d a let is like arec { … } rec { a = LAZY { c = 1; d =

[Nix-dev] with, ++, //, and laziness

2012-03-23 Thread Shea Levy
Hello, Based on my understanding of Nix semantics, I expected the following to all evaluate to 2: let a = { c = 1; d = b.c; }; b = a // { c = 2; }; in b.d let a = with b; { c = 1; d = c; }; b = a // { c = 2; }; in b.d with (throw an error); 2 with ({a = 2;}); with (throw an