tvl-depot/tvix/eval/src/value
Vincent Ambo 60f24c3c53 fix(tvix/eval): detect cycles when printing infinite values
Using the same method as in Thunk::deep_force, detect cycles when
printing values by maintaining a set of already seen thunks.

With this, display of infinite values matches that of Nix:

    > nix-instantiate --eval --strict -E 'let as = { x = 123; y = as; }; in as'
    { x = 123; y = { x = 123; y = <CYCLE>; }; }

    > tvix-eval -E 'let as = { x = 123; y = as; }; in as'
    => { x = 123; y = { x = 123; y = <CYCLE>; }; } :: set

Change-Id: I007b918d5131d82c28884e46e46ff365ef691aa8
Reviewed-on: https://cl.tvl.fyi/c/depot/+/7056
Tested-by: BuildkiteCI
Reviewed-by: grfn <grfn@gws.fyi>
2022-10-23 15:50:35 +00:00
..
attrs feat(tvix/eval): Initial resolution of <...> paths 2022-10-10 20:23:41 +00:00
arbitrary.rs refactor(tvix/eval): Encapsulate Value::Attrs construction 2022-10-08 19:02:25 +00:00
attrs.rs fix(tvix/eval): detect cycles when printing infinite values 2022-10-23 15:50:35 +00:00
builtin.rs refactor(tvix/eval): builtins now contain closures 2022-10-06 15:22:32 +00:00
function.rs feat(tvix/eval): deduplicate overlap between Closure and Thunk 2022-10-19 10:38:54 +00:00
list.rs fix(tvix/eval): detect cycles when printing infinite values 2022-10-23 15:50:35 +00:00
mod.rs fix(tvix/eval): detect cycles when printing infinite values 2022-10-23 15:50:35 +00:00
path.rs refactor(tvix/eval): factor out all calls to canon_path 2022-10-13 09:07:47 +00:00
string.rs feat(tvix/eval): Record formals on lambda 2022-10-17 11:29:49 +00:00
thunk.rs fix(tvix/eval): detect cycles when printing infinite values 2022-10-23 15:50:35 +00:00