lix/src
John Ericson 19c5394971 Change "while evaluating <fun>" to "while *calling*" in trace
The old way was not correct.

Here is an example:
```
 $ nix-instantiate --eval --expr 'let x = a: throw "asdf"; in x 1' --show-trace
error: asdf

       … while evaluating 'x'

       at «string»:1:9:

            1| let x = a: throw "asdf"; in x 1
             |         ^

       … from call site

       at «string»:1:29:

            1| let x = a: throw "asdf"; in x 1
             |                             ^
```
and yet also:
```
 $ nix-instantiate --eval --expr 'let x = a: throw "asdf"; in x' --show-trace
<LAMBDA>
```

Here is the thing: in both cases we are evaluating `x`!

Nix is a higher-order languages, and functions are a sort of value. When
we write `x = a: ...`, `a: ...` is the expression that `x` is being
defined to be, and that is already a value. Therefore, we should *never*
get an trace that says "while evaluating `x`", because evaluating `a:
...` is *trival* and nothing happens during it!

What is actually happening here is we are applying `x` and evaluating
its *body* with arguments substituted for parameters. I think the
simplest way to say is just "while *calling* `x`", and so that is what I
changed it to.
2022-12-02 09:14:12 -05:00
..
build-remote build-remote: Add brackets to error message 2022-11-04 10:49:44 -07:00
libcmd Merge pull request #3600 from NixOS/auto-uid-allocation 2022-11-29 14:01:42 +01:00
libexpr Change "while evaluating <fun>" to "while *calling*" in trace 2022-12-02 09:14:12 -05:00
libfetchers Merge pull request #7039 from Mic92/libfetchers-variant 2022-10-31 11:48:51 +01:00
libmain Move savedArgv into libmain 2022-10-28 12:19:37 +02:00
libstore Merge pull request #3600 from NixOS/auto-uid-allocation 2022-11-29 14:01:42 +01:00
libutil Merge pull request #3600 from NixOS/auto-uid-allocation 2022-11-29 14:01:42 +01:00
nix Really fix 'nix store make-content-addressed --json' 2022-12-01 16:29:09 +01:00
nix-build nix-build: remove unused --add-root arg 2022-09-27 00:07:42 +02:00
nix-channel Fix segfault in headerCallback() 2022-03-03 11:11:16 +01:00
nix-collect-garbage Add missing rethrows in conditional exception handlers 2022-06-10 10:52:41 -07:00
nix-copy-closure copyPaths: Pass store by reference 2021-07-22 09:59:51 +02:00
nix-env Replace src/libutil/json.cc with nlohmann json generation 2022-11-16 16:50:50 +01:00
nix-instantiate Revert to copyStore = true for nix-instantiate and nix-env 2022-08-23 14:40:27 +02:00
nix-store Fix indentation 2022-11-04 13:29:39 +01:00
resolve-system-dependencies Get rid of most .at calls (#6393) 2022-05-04 07:44:32 +02:00
toml11 Replace cpptoml with toml11 2021-12-17 22:03:33 +01:00