about summary refs log tree commit diff
path: root/tvix/eval/src/value
diff options
context:
space:
mode:
authorAdam Joseph <adam@westernsemico.com>2023-12-11T08·43-0800
committerclbot <clbot@tvl.fyi>2023-12-12T14·35+0000
commitc956138ee6c158c12f5c5eb3568aea1b0aea7494 (patch)
treea2b33d7f00d219e63295a09d4e22d9beba4e6ffa /tvix/eval/src/value
parentddba4d4e173e13d69274b39dd6add1a3efe2343f (diff)
docs(tvix/eval): clarify difference between ThunkSet and Blackhole r/7174
The comment explaining ThunkSet makes it seem like it does the same
think as ThunkRepr::Blackhole.  In fact neither one is a substitute
for the other.  Let's explain the difference.

Change-Id: I89ceaaa9d3c499edbc7d48f70ca5d11f97666c43
Reviewed-on: https://cl.tvl.fyi/c/depot/+/10250
Tested-by: BuildkiteCI
Reviewed-by: tazjin <tazjin@tvl.su>
Autosubmit: Adam Joseph <adam@westernsemico.com>
Diffstat (limited to 'tvix/eval/src/value')
-rw-r--r--tvix/eval/src/value/thunk.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/tvix/eval/src/value/thunk.rs b/tvix/eval/src/value/thunk.rs
index 345903237b76..cafa8275dec6 100644
--- a/tvix/eval/src/value/thunk.rs
+++ b/tvix/eval/src/value/thunk.rs
@@ -413,8 +413,11 @@ impl TotalDisplay for Thunk {
     }
 }
 
-/// A wrapper type for tracking which thunks have already been seen in a
-/// context. This is necessary for cycle detection.
+/// A wrapper type for tracking which thunks have already been seen
+/// in a context. This is necessary for printing and deeply forcing
+/// cyclic non-diverging data structures like `rec { f = [ f ]; }`.
+/// This is separate from the ThunkRepr::Blackhole mechanism, which
+/// detects diverging data structures like `(rec { f = f; }).f`.
 ///
 /// The inner `HashSet` is not available on the outside, as it would be
 /// potentially unsafe to interact with the pointers in the set.