[Nix-dev] lazy evaluation and 'with'

Lluís Batlle viriketo at gmail.com
Fri Jan 15 11:56:05 CET 2010


Hello,

let
  a = { x = 1; c = 2;};
in
with a;
if a ? b then b else "b not found"

This ends up in:
error: undefined variable `b'

I thought it would evaluate to "b not found".

If I use:
if a ? a.b then b else "b not found"

all works.

I'm curious about this behaviour. Can any expert explain a bit about it?

Regards,
Lluís.



More information about the nix-dev mailing list