lix/src/libexpr
Adam Joseph dc205c75a2 src/libexpr/primops.cc: correct definition for intersectAttrs
The current definition of `intersectAttrs` is incorrect:

> Return a set consisting of the attributes in the set e2 that also exist in the
> set e1.

Recall that (Nix manual, section 5.1):

> An attribute set is a collection of name-value-pairs (called attributes)

According to the existing description of `intersectAttrs`, the following should
evaluate to the empty set, since no key-value *pair* (i.e. attribute) exists in
both sets:

```
builtins.intersectAttrs { x=3; } {x="foo";}
```

And yet:

```
nix-repl> builtins.intersectAttrs { x=3; } {x="foo";}
{ x = "foo"; }
```

Clearly the intent here was for the *names* of the resulting attribute set to be
the intersection of the *names* of the two arguments, and for the values of the
resulting attribute set to be the values from the second argument.

This commit corrects the definition, making it match the implementation and intent.
2022-09-24 23:51:09 -07:00
..
flake lockfile -> lock file for consistency 2022-09-06 19:20:31 +02:00
primops fetchGit: document shallow argument 2022-06-26 12:00:00 +00:00
tests src/libexpr/tests/primops.cc: Quote Nix expressions 2022-06-29 11:37:25 +02:00
attr-path.cc rename SymbolIdx -> Symbol, Symbol -> SymbolStr 2022-04-25 15:37:01 +02:00
attr-path.hh replace most Pos objects/ptrs with indexes into a position table 2022-04-21 21:46:06 +02:00
attr-set.cc Don't pass Symbol by reference 2022-04-26 13:25:17 +02:00
attr-set.hh Don't pass Symbol by reference 2022-04-26 13:25:17 +02:00
eval-cache.cc Fix evaluation cache 2022-08-24 21:19:43 +02:00
eval-cache.hh Make nix::eval_cache::int_t more idiomatic 2022-05-16 16:36:21 +02:00
eval-inline.hh incorporate PosIdx changes, symbol changes. 2022-04-29 10:02:17 -06:00
eval.cc Fix NIX_COUNT_CALLS=1 2022-08-03 17:46:51 +02:00
eval.hh Merge branch 'master' into ignore-try 2022-07-11 11:29:22 -06:00
fetchurl.nix fetchurl.nix: change other use of __impure 2022-09-16 01:54:24 -07:00
function-trace.cc Revert the enum struct change 2020-06-18 22:11:26 +00:00
function-trace.hh replace most Pos objects/ptrs with indexes into a position table 2022-04-21 21:46:06 +02:00
get-drvs.cc Respect the outputSpecified attribute 2022-05-30 11:34:47 +02:00
get-drvs.hh Remove pre-C++11 hackiness 2022-05-26 12:40:01 +02:00
imported-drv-to-derivation.nix Move some corepkgs into the nix binary 2020-03-11 16:57:48 +01:00
json-to-value.cc return string_views from forceString* 2022-01-27 17:15:43 +01:00
json-to-value.hh return string_views from forceString* 2022-01-27 17:15:43 +01:00
lexer.l Handle EOFs in string literals correctly 2022-05-25 17:58:13 +02:00
local.mk Merge pull request #5175 from Pamplemousse/make 2021-08-30 12:44:29 +02:00
nix-expr.pc.in pkg-config files: Use c++17 2019-03-14 14:11:12 +01:00
nixexpr.cc remove redundant 'debugMode' flag 2022-05-22 21:45:24 -06:00
nixexpr.hh Shut up clang warnings 2022-06-02 21:19:54 +02:00
parser.y Forbid the tilde expansion in pure eval mode 2022-06-21 14:08:18 +02:00
primops.cc src/libexpr/primops.cc: correct definition for intersectAttrs 2022-09-24 23:51:09 -07:00
primops.hh replace most Pos objects/ptrs with indexes into a position table 2022-04-21 21:46:06 +02:00
symbol-table.hh EvalCache AttrKey: Use Symbol instead of std::string 2022-04-26 14:16:20 +02:00
value-to-json.cc JSON: print paths as strings without copying them to the store 2022-08-22 15:01:35 +02:00
value-to-json.hh JSON: print paths as strings without copying them to the store 2022-08-22 15:01:35 +02:00
value-to-xml.cc store Symbols in a table as well, like positions 2022-04-21 21:56:31 +02:00
value-to-xml.hh replace most Pos objects/ptrs with indexes into a position table 2022-04-21 21:46:06 +02:00
value.hh JSON: print paths as strings without copying them to the store 2022-08-22 15:01:35 +02:00