(->thunk f)Create a thunk for trampolining
Create a thunk for trampolining
(force-thunk t)Run a Thunk's deferred fn — one trampoline bounce. Companion to thunk?;
keeps the Thunk type reference inside this namespace (see thunk?).
Run a Thunk's deferred fn — one trampoline bounce. Companion to `thunk?`; keeps the `Thunk` type reference inside this namespace (see `thunk?`).
(thunk? x)Whether x is a trampoline Thunk.
Emitted CPS code (the async macro + await-handler) MUST call this fn rather
than inline (instance? Thunk x): a fn is referenced by an ns-qualified VAR
(is.simm.partial-cps.runtime/thunk?), which resolves under any macro
re-scoping. The dotted TYPE symbol is.simm.partial_cps.runtime.Thunk is a
property-access form on cljs that some macros (e.g. cljs.test/async)
re-scope to cljs.test.is.simm… → undefined at runtime. spindel hit exactly
this and worked around it locally (seq/core.cljc); centralizing it here lets
that workaround go away.
Whether `x` is a trampoline Thunk. Emitted CPS code (the `async` macro + await-handler) MUST call this fn rather than inline `(instance? Thunk x)`: a fn is referenced by an ns-qualified VAR (`is.simm.partial-cps.runtime/thunk?`), which resolves under any macro re-scoping. The dotted TYPE symbol `is.simm.partial_cps.runtime.Thunk` is a property-access form on cljs that some macros (e.g. `cljs.test/async`) re-scope to `cljs.test.is.simm…` → `undefined` at runtime. spindel hit exactly this and worked around it locally (seq/core.cljc); centralizing it here lets that workaround go away.
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 |