Trampoline for the annotate helpers.
End state (Phase 7): every annotate helper has signature
(Ctx, AnnotatedNode) -> Step, where Step is the sum type below.
[:done annotated-node]
[:call helper-fn ctx node k]
run is a loop over a heap-allocated stack of continuations. During
the Phase 2-6 migration window, some helpers still return plain
AnnotatedNode values; step? / normalize plus the [:done v]
auto-wrap branch inside run carry those through. All three are
migration-window cruft and are deleted in Phase 7 contraction.
Trampoline for the annotate helpers.
End state (Phase 7): every annotate helper has signature
`(Ctx, AnnotatedNode) -> Step`, where `Step` is the sum type below.
[:done annotated-node]
[:call helper-fn ctx node k]
`run` is a loop over a heap-allocated stack of continuations. During
the Phase 2-6 migration window, some helpers still return plain
AnnotatedNode values; `step?` / `normalize` plus the [:done v]
auto-wrap branch inside `run` carry those through. All three are
migration-window cruft and are deleted in Phase 7 contraction.(call helper-fn ctx node k)Inputs: [helper-fn :- (s/pred fn?) ctx :- s/Any node :- aas/AnnotatedNode k :- (s/pred fn?)] Returns: Step
Inputs: [helper-fn :- (s/pred fn?) ctx :- s/Any node :- aas/AnnotatedNode k :- (s/pred fn?)] Returns: Step
Dispatch step. Run (helper-fn ctx node); the trampoline pushes k
onto the continuation stack and resumes with (k v) once that
invocation terminates with [:done v].
Dispatch step. Run `(helper-fn ctx node)`; the trampoline pushes `k` onto the continuation stack and resumes with `(k v)` once that invocation terminates with `[:done v]`.
(done node)Inputs: [node :- aas/AnnotatedNode] Returns: Step
Inputs: [node :- aas/AnnotatedNode] Returns: Step
Terminal step. The carried value is structurally polymorphic — it
is whatever the next continuation expects. The OUTERMOST [:done v]
popped by run carries an AnnotatedNode (enforced by run's return
schema).
Terminal step. The carried value is structurally polymorphic — it is whatever the next continuation expects. The OUTERMOST [:done v] popped by `run` carries an AnnotatedNode (enforced by `run`'s return schema).
(reduce-children ctx state children step-fn final-k)Inputs: [ctx :- s/Any state :- s/Any children :- [aas/AnnotatedNode] step-fn :- (s/pred fn?) final-k :- (s/pred fn?)] Returns: Step
Inputs: [ctx :- s/Any state :- s/Any children :- [aas/AnnotatedNode] step-fn :- (s/pred fn?) final-k :- (s/pred fn?)] Returns: Step
(run helper-fn ctx node)Inputs: [helper-fn :- (s/pred fn?) ctx :- s/Any node :- aas/AnnotatedNode] Returns: aas/AnnotatedNode
Inputs: [helper-fn :- (s/pred fn?) ctx :- s/Any node :- aas/AnnotatedNode] Returns: aas/AnnotatedNode
(sequence-children ctx children final-k)Inputs: [ctx :- s/Any children :- [aas/AnnotatedNode] final-k :- (s/pred fn?)] Returns: Step
Inputs: [ctx :- s/Any children :- [aas/AnnotatedNode] final-k :- (s/pred fn?)] Returns: Step
Sum type returned by every step-shaped annotate helper at end state. Exactly two variants: DoneStep | CallStep.
Sum type returned by every step-shaped annotate helper at end state. Exactly two variants: DoneStep | CallStep.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |