Skip to main content

Module chan_yield_lint

Module chan_yield_lint 

Source
Expand description

chan.yield Reachability Lint

Errors when chan.yield is called from a word with no cooperative peer — i.e. a word that is not reachable from any strand.spawn or strand.weave. Such a call is a no-op masquerading as concurrency machinery and almost always indicates a deleted/forgotten spawn.

§Cooperative set

A user word is cooperative iff at least one of the following holds:

  1. Its body contains a strand.spawn or strand.weave call (the “spawner-self” rule — yielding from the same word that just spawned a peer is canonical).
  2. It appears as a literal-quotation body passed directly to strand.spawn / strand.weave (the seed roots).
  3. It is transitively called by some cooperative word.

Quotations passed to other combinators (if, when, map, dip, …) inherit their enclosing word’s classification; we do not try to track quotations stored in data and later invoked via call. The design doc accepts that conservatism as a false-positive risk that has not appeared in practice.

Structs§

ChanYieldAnalyzer