tricu

An interpreted language for exploring Tree Calculus
Log | Files | Refs | README | LICENSE

pathWithState.scp (542B)


      1 !export pathWithState
      2 -- As pathName, but pass an explicit environment to the delegated handler.
      3 -- Input: (target, environment); state: (prefixer, handler) descriptors.
      4 -- Prefixer sees only target and uses its own initial state. Handler sees its
      5 -- selected result as input and environment as state. `become` is a tail
      6 -- delegation; it does not resume this consumer after the handler returns.
      7 consumer pathWithState
      8   (target, environment) @ (prefixer, handler) => call prefixer target as selected in become handler selected @ environment