lix/tests/lang
Shea Levy 20866a7031 Delay evaulation of with attrs until a variable lookup needs them
Evaluation of attribute sets is strict in the attribute names, which
means immediate evaluation of `with` attribute sets rules out some
potentially interesting use cases (e.g. where the attribute names of one
set depend in some way on another but we want to bring those names into
scope for some values in the second set).

The major example of this is overridable self-referential package sets
(e.g. all-packages.nix). With immediate `with` evaluation, the only
options for such sets are to either make them non-recursive and
explicitly use the name of the overridden set in non-overridden one
every time you want to reference another package, or make the set
recursive and use the `__overrides` hack. As shown in the test case that
comes with this commit, though, delayed `with` evaluation allows a nicer
third alternative.

Signed-off-by: Shea Levy <shea@shealevy.com>
2013-07-31 11:48:39 +02:00
..
dir1 * Add a Nix expression search path feature. Paths between angle 2011-08-06 16:05:24 +00:00
dir2 * Add a Nix expression search path feature. Paths between angle 2011-08-06 16:05:24 +00:00
dir3 * Add a Nix expression search path feature. Paths between angle 2011-08-06 16:05:24 +00:00
dir4 * Add a Nix expression search path feature. Paths between angle 2011-08-06 16:05:24 +00:00
eval-fail-abort.nix
eval-fail-assert.nix
eval-fail-blackhole.nix
eval-fail-missing-arg.nix
eval-fail-remove.nix
eval-fail-scope-5.nix
eval-fail-substring.nix New primitives: 2007-01-29 14:23:09 +00:00
eval-fail-to-path.nix * Another test. 2006-10-17 11:16:02 +00:00
eval-fail-undeclared-arg.nix
eval-okay-arithmetic.exp * Update the expected test output (no longer an ATerm). 2010-04-21 16:22:03 +00:00
eval-okay-arithmetic.nix * lessThan primitive for integer comparison. 2006-09-24 15:21:48 +00:00
eval-okay-attrnames.exp * Update the expected test output (no longer an ATerm). 2010-04-21 16:22:03 +00:00
eval-okay-attrnames.nix * New built-in function `builtins.attrNames' that returns the 2006-12-12 16:14:31 +00:00
eval-okay-attrs.exp * Update the expected test output (no longer an ATerm). 2010-04-21 16:22:03 +00:00
eval-okay-attrs.nix
eval-okay-attrs2.exp * Update the expected test output (no longer an ATerm). 2010-04-21 16:22:03 +00:00
eval-okay-attrs2.nix
eval-okay-attrs3.exp * Update the expected test output (no longer an ATerm). 2010-04-21 16:22:03 +00:00
eval-okay-attrs3.nix * Some syntactic sugar for attribute sets: allow {x.y.z = ...;} as a 2009-05-15 12:35:23 +00:00
eval-okay-attrs4.exp * Test case. 2011-07-06 10:58:53 +00:00
eval-okay-attrs4.nix * Test case. 2011-07-06 10:58:53 +00:00
eval-okay-attrs5.exp * Allow a default value in attribute selection by writing 2011-07-13 12:19:57 +00:00
eval-okay-attrs5.nix Allow dashes in identifiers 2012-09-27 15:49:20 -04:00
eval-okay-autoargs.exp * Update the expected test output (no longer an ATerm). 2010-04-21 16:22:03 +00:00
eval-okay-autoargs.flags * Option --argstr for passing string arguments easily. (NIX-75) 2007-01-14 12:32:44 +00:00
eval-okay-autoargs.nix * Option --argstr for passing string arguments easily. (NIX-75) 2007-01-14 12:32:44 +00:00
eval-okay-builtins.exp * Update the expected test output (no longer an ATerm). 2010-04-21 16:22:03 +00:00
eval-okay-builtins.nix
eval-okay-closure.exp.xml * Generalised the dependencyClosure primop to builtins.genericClosure, 2008-07-11 13:29:04 +00:00
eval-okay-closure.nix * Generalised the dependencyClosure primop to builtins.genericClosure, 2008-07-11 13:29:04 +00:00
eval-okay-concat.exp * Update the expected test output (no longer an ATerm). 2010-04-21 16:22:03 +00:00
eval-okay-concat.nix
eval-okay-context.exp * Check for duplicate attribute names / function arguments. `make 2010-04-22 11:02:24 +00:00
eval-okay-context.nix * New primop `unsafeDiscardStringContext' to get rid of string 2008-01-04 14:22:49 +00:00
eval-okay-delayed-with.exp Delay evaulation of with attrs until a variable lookup needs them 2013-07-31 11:48:39 +02:00
eval-okay-delayed-with.nix Delay evaulation of with attrs until a variable lookup needs them 2013-07-31 11:48:39 +02:00
eval-okay-empty-args.exp * Update the expected test output (no longer an ATerm). 2010-04-21 16:22:03 +00:00
eval-okay-empty-args.nix * Allow empty argument lists in function definitions (e.g., `{}: 2007-05-15 12:14:37 +00:00
eval-okay-eq-derivations.exp * Add a test case for comparing derivations. 2012-01-19 22:10:24 +00:00
eval-okay-eq-derivations.nix * Add a test case for comparing derivations. 2012-01-19 22:10:24 +00:00
eval-okay-eq.exp.disabled
eval-okay-eq.nix
eval-okay-flatten.exp * Update the expected test output (no longer an ATerm). 2010-04-21 16:22:03 +00:00
eval-okay-flatten.nix
eval-okay-functionargs.exp.xml * Two primops: builtins.intersectAttrs and builtins.functionArgs. 2009-09-15 13:01:46 +00:00
eval-okay-functionargs.nix * Two primops: builtins.intersectAttrs and builtins.functionArgs. 2009-09-15 13:01:46 +00:00
eval-okay-getenv.exp * Update the expected test output (no longer an ATerm). 2010-04-21 16:22:03 +00:00
eval-okay-getenv.nix * Builtin function `getEnv' for getting environment variables. 2006-09-24 17:48:41 +00:00
eval-okay-hash.exp Rename "hash" to "hashString" and handle SHA-1 2013-02-08 19:36:23 +01:00
eval-okay-hash.nix Rename "hash" to "hashString" and handle SHA-1 2013-02-08 19:36:23 +01:00
eval-okay-if.exp * Update the expected test output (no longer an ATerm). 2010-04-21 16:22:03 +00:00
eval-okay-if.nix
eval-okay-ind-string.exp * Update the expected test output (no longer an ATerm). 2010-04-21 16:22:03 +00:00
eval-okay-ind-string.nix * Regression test. 2008-02-05 13:25:18 +00:00
eval-okay-let.exp * Update the expected test output (no longer an ATerm). 2010-04-21 16:22:03 +00:00
eval-okay-let.nix
eval-okay-list.exp * Update the expected test output (no longer an ATerm). 2010-04-21 16:22:03 +00:00
eval-okay-list.nix
eval-okay-listtoattrs.exp * Regression test for listToAttr's behaviour if an attribute name 2010-10-23 22:55:30 +00:00
eval-okay-listtoattrs.nix * Keep attribute sets in sorted order to speed up attribute lookups. 2010-10-24 19:52:33 +00:00
eval-okay-logic.exp * Update the expected test output (no longer an ATerm). 2010-04-21 16:22:03 +00:00
eval-okay-logic.nix
eval-okay-map.exp * Update the expected test output (no longer an ATerm). 2010-04-21 16:22:03 +00:00
eval-okay-map.nix
eval-okay-new-let.exp * Update the expected test output (no longer an ATerm). 2010-04-21 16:22:03 +00:00
eval-okay-new-let.nix * Finally, a real "let" syntax: `let x = ...; ... z = ...; in ...'. 2006-10-02 15:52:44 +00:00
eval-okay-overrides.exp * Regression test for __overrides. 2010-10-22 15:15:12 +00:00
eval-okay-overrides.nix * Regression test for __overrides. 2010-10-22 15:15:12 +00:00
eval-okay-pathexists.exp * Update the expected test output (no longer an ATerm). 2010-04-21 16:22:03 +00:00
eval-okay-pathexists.nix * Fix the tests wrt the AST changes, i.e., Str(s) -> Str(s, []), and 2006-10-17 11:08:59 +00:00
eval-okay-patterns.exp * Update the expected test output (no longer an ATerm). 2010-04-21 16:22:03 +00:00
eval-okay-patterns.nix * Simplify @-patterns: only {attrs}@name' or name@{attrs}' are now 2010-03-25 12:19:41 +00:00
eval-okay-readfile.exp * Update the expected test output (no longer an ATerm). 2010-04-21 16:22:03 +00:00
eval-okay-readfile.nix * New primop `readFile' to get the contents of a file as a string. 2007-11-21 13:49:59 +00:00
eval-okay-remove.exp * Update the expected test output (no longer an ATerm). 2010-04-21 16:22:03 +00:00
eval-okay-remove.nix
eval-okay-scope-1.exp * Update the expected test output (no longer an ATerm). 2010-04-21 16:22:03 +00:00
eval-okay-scope-1.nix
eval-okay-scope-2.exp * Update the expected test output (no longer an ATerm). 2010-04-21 16:22:03 +00:00
eval-okay-scope-2.nix
eval-okay-scope-3.exp * Update the expected test output (no longer an ATerm). 2010-04-21 16:22:03 +00:00
eval-okay-scope-3.nix * Remove ancient Fix tests. 2004-10-27 12:41:53 +00:00
eval-okay-scope-4.exp * Update the expected test output (no longer an ATerm). 2010-04-21 16:22:03 +00:00
eval-okay-scope-4.nix
eval-okay-scope-6.exp * Update the expected test output (no longer an ATerm). 2010-04-21 16:22:03 +00:00
eval-okay-scope-6.nix
eval-okay-scope-7.exp * Update the expected test output (no longer an ATerm). 2010-04-21 16:22:03 +00:00
eval-okay-scope-7.nix * Change the scoping of "inherit (e) ..." in recs so that the 2009-05-15 13:46:13 +00:00
eval-okay-search-path.exp * Allow redirections in search path entries. E.g. if you have a 2011-08-06 17:48:57 +00:00
eval-okay-search-path.flags * Allow redirections in search path entries. E.g. if you have a 2011-08-06 17:48:57 +00:00
eval-okay-search-path.nix * Refactoring: Get rid of a few subdirectories in corepkgs/, and some 2012-01-03 00:16:29 +00:00
eval-okay-string.exp * Update the expected test output (no longer an ATerm). 2010-04-21 16:22:03 +00:00
eval-okay-string.nix * Fix the tests wrt the AST changes, i.e., Str(s) -> Str(s, []), and 2006-10-17 11:08:59 +00:00
eval-okay-strings-as-attrs-names.exp * Allow attribute names to be strings. Based on the 2011-07-13 15:53:24 +00:00
eval-okay-strings-as-attrs-names.nix * Allow attribute names to be strings. Based on the 2011-07-13 15:53:24 +00:00
eval-okay-substring.exp * builtins.substring: if "start" is beyond the end of the string, 2011-01-14 12:47:10 +00:00
eval-okay-substring.nix * builtins.substring: if "start" is beyond the end of the string, 2011-01-14 12:47:10 +00:00
eval-okay-toxml.exp * Sync with the trunk. 2010-05-07 14:46:47 +00:00
eval-okay-toxml.nix Make source location info in the XML output optional. 2010-03-31 12:38:31 +00:00
eval-okay-toxml2.exp * Sync with the trunk. 2010-05-07 14:46:47 +00:00
eval-okay-toxml2.nix * Sync with the trunk. 2010-05-07 14:46:47 +00:00
eval-okay-tryeval.exp * Print attributes in sorted order. 2010-05-12 12:15:49 +00:00
eval-okay-tryeval.nix * Implemented tryEval, the last missing primop in the fast-eval 2010-05-12 11:23:44 +00:00
eval-okay-versions.exp * Update the expected test output (no longer an ATerm). 2010-04-21 16:22:03 +00:00
eval-okay-versions.nix * Export the nix-env derivation name parsing and version comparison 2008-07-01 10:10:32 +00:00
eval-okay-with.exp * Update the expected test output (no longer an ATerm). 2010-04-21 16:22:03 +00:00
eval-okay-with.nix * Doh. 2010-03-23 14:51:32 +00:00
eval-okay-xml.exp.xml * Simplify @-patterns: only {attrs}@name' or name@{attrs}' are now 2010-03-25 12:19:41 +00:00
eval-okay-xml.nix * Added an experimental feature suggested by Andres: ellipses ("...") 2008-08-14 14:00:44 +00:00
lib.nix * Generalised the dependencyClosure primop to builtins.genericClosure, 2008-07-11 13:29:04 +00:00
parse-fail-dup-attrs-1.nix
parse-fail-dup-attrs-2.nix
parse-fail-dup-attrs-3.nix * Check for duplicate attributes and formal parameters in Nix 2005-03-10 11:33:46 +00:00
parse-fail-dup-attrs-4.nix * Some syntactic sugar for attribute sets: allow {x.y.z = ...;} as a 2009-05-15 12:35:23 +00:00
parse-fail-dup-attrs-6.nix * Some syntactic sugar for attribute sets: allow {x.y.z = ...;} as a 2009-05-15 12:35:23 +00:00
parse-fail-dup-attrs-7.nix * Check for duplicate attribute names / function arguments. `make 2010-04-22 11:02:24 +00:00
parse-fail-dup-formals.nix
parse-fail-patterns-1.nix * @-patterns as in Haskell. For instance, in a function definition 2008-08-14 12:53:29 +00:00
parse-fail-regression-20060610.nix
parse-fail-undef-var-2.nix
parse-fail-undef-var.nix * Check for duplicate attributes and formal parameters in Nix 2005-03-10 11:33:46 +00:00
parse-okay-1.nix
parse-okay-crlf.nix
parse-okay-dup-attrs-5.nix * Check for duplicate attribute names / function arguments. `make 2010-04-22 11:02:24 +00:00
parse-okay-regression-20041027.nix
parse-okay-subversion.nix
parse-okay-url.nix