infinisil changed the topic of #nix-lang to: Channel for discussing Nix as a language - https://nixos.org/nix/manual/#chap-writing-nix-expressions - Logs: https://logs.nix.samueldr.com/nix-lang/
ddellacosta has quit [Ping timeout: 258 seconds]
ddellacosta has joined #nix-lang
hmpffff has quit [Quit: nchrrrr…]
ddellacosta has quit [Ping timeout: 248 seconds]
__monty__ has joined #nix-lang
hmpffff has joined #nix-lang
andi- has quit [Ping timeout: 250 seconds]
andi- has joined #nix-lang
andi- has quit [Excess Flood]
andi- has joined #nix-lang
andi- has quit [Excess Flood]
andi- has joined #nix-lang
andi- has quit [Excess Flood]
andi- has joined #nix-lang
andi- has quit [Ping timeout: 252 seconds]
andi- has joined #nix-lang
andi- has quit [Ping timeout: 264 seconds]
andi- has joined #nix-lang
noonien has quit [Quit: Connection closed for inactivity]
ddellacosta has joined #nix-lang
<Taneb> I'd like to do something like "let x = 1; in let x = x + 1; in x" and get 2. Is there a clean way to do this? (override a variable from an outer scope with a value dependent on the outer scope's value)
<infinisil> Taneb: I can't think of any clean way
<Taneb> I ended up changing the name of the variable in the outer scope, which in this case is better
<infinisil> Yeah that's what I'd do too
<infinisil> Also probably less confusing
ddellacosta has quit [Ping timeout: 268 seconds]
ddellacosta has joined #nix-lang
<srhb> > let x = 1; in { x = 1 + 1; }.x
<{^_^}> 2
<srhb> But please don't...
<srhb> :-P
<srhb> Woops
<srhb> x + 1 of course..
<pie_> ooh
<pie_> Taneb: yeah not having a nonrecursive let can be annoying
<srhb> Well, attrsets are basically just as good..
<Taneb> > let x = 1; in with {x = x + 1;}; x
<{^_^}> 1
<Taneb> That feels wrong to me
<infinisil> "with" has different semantics
<infinisil> Yeah it's a bit weird..
<pie_> > let x = 1; in let inherit ({x = x + 1;}); in x
<{^_^}> 1
<pie_> i wonder what happens if
<pie_> > let x = 1; let inherit ({x = x + 1;}); in x
<{^_^}> error: syntax error, unexpected LET, at (string):255:12
<pie_> derp
<pie_> > let x = 1; inherit ({x = x + 1;}); in x
<{^_^}> 1
<pie_> still derp
<pie_> > let x = 1; inherit ({x = x + 1;}) x; in x
<{^_^}> error: attribute 'x' at (string):255:34 already defined at (string):255:5
<pie_> nice
ddellacosta has quit [Ping timeout: 268 seconds]
ddellacosta has joined #nix-lang
ddellacosta has quit [Ping timeout: 258 seconds]
hmpffff_ has joined #nix-lang
hmpffff has quit [Ping timeout: 252 seconds]
ddellacosta has joined #nix-lang
__monty__ has quit [Quit: leaving]