lix/src/libexpr
Eelco Dolstra 37d7abd694 * New language feature: with expressions.
The expression `with E1; E2' evaluates to E2 with all bindings in
  the attribute set E1 substituted.  E.g.,

    with {x = 123;}; x

  evaluates to 123.  That is, the attribute set E1 is in scope in E2.

  This is particularly useful when importing files containing lots
  definitions.  E.g., instead of

    let {
      inherit (import ./foo.nix) a b c d e f;

      body = ... a ... f ...;
    }

  we can now say

    with import ./foo.nix;

    ... a ... f ...

  I.e., we don't have to say what variables should be brought into scope.
2004-10-25 16:54:56 +00:00
..
eval.cc * New language feature: with expressions. 2004-10-25 16:54:56 +00:00
eval.hh * Allow certain operations to succeed even if we don't have write 2004-10-25 14:38:23 +00:00
lexer.l * New language feature: with expressions. 2004-10-25 16:54:56 +00:00
Makefile.am * Allow primops with more that 1 arguments. 2004-08-04 10:59:20 +00:00
nixexpr.cc * New language feature: with expressions. 2004-10-25 16:54:56 +00:00
nixexpr.hh * Allow primops with more that 1 arguments. 2004-08-04 10:59:20 +00:00
parser.cc * A very dirty hack to make setuid installations a bit nicer to use. 2004-09-09 21:12:53 +00:00
parser.hh * Use a map to lookup primops. 2004-02-04 16:03:29 +00:00
parser.y * New language feature: with expressions. 2004-10-25 16:54:56 +00:00
primops.cc * New language feature: with expressions. 2004-10-25 16:54:56 +00:00