ucall (inputs... callable -- outputs...)
Inputs
inputs...: Objects carried below the inline callable.callable: Already-selected object orRefwhose dereferenced input isBlockor knownText.
Outputs
outputs...: Objects left by inline processing ofcallable.
Processes one already-selected Block or known Text inline in the current scope. No name lookup or field selection happens inside the builtin.
Inline processing leaves locals created by the processed code available afterward.
Behavior
- The callable must already be on the data stack.
- Any remaining data inputs required by that callable must already be below it on the data stack.
- Supported inputs are Block and known Text only.
- A known
NILText input is invalid. - Stored Block objects are obtained via
.@NAMEor@NAMEwhen the stored Block itself must be pushed. Plain.NAMEorNAMEmay already process the stored Block beforeucallruns. Known Text locals differ: plain mention already pushes the Text object, sotextSource ucallis valid. - Unknown Text is invalid.
- Code objects are invalid.
- Callable Dict objects are invalid, even when the Dict's
CALLfield is a Block.ucalldoes not selectCALLor evaluatePREfrom a Dict input.
Known Text inputs are interpreted as MPL code text and processed inline.
Example
{} 0 {} [
"-- block uses stack values below it --" printCompilerMessage
5 [2 +] ucall printStack _:;
"-- read stored Block value first, then process it inline --" printCompilerMessage
blockSource: [7 "blockLocal" def];
@blockSource ucall
blockLocal printStack _:;
"-- text uses stack values below it --" printCompilerMessage
9 «1 +» ucall printStack _:;
"-- known Text local also processes inline --" printCompilerMessage
textSource: «8 "textLocal" def»;
textSource ucall
textLocal printStack _:;
0
] "main" exportFunction
Expected Output During Compilation
-- block uses stack values below it --
7
-- read stored Block value first, then process it inline --
7 Cref
-- text uses stack values below it --
10
-- known Text local also processes inline --
8 Cref
See also
callbuiltin(inputs... callable -- outputs...)Calls an already-selected Block, Code, callable Dict, or known Text through a call boundary. No selection happens inside the builtin.callFieldbuiltin(inputs... dict name -- outputs...)Selects a Dict field by known Text name and then applies.NAME-style semantics. Callable fields are called; non-callable fields are read.ifbuiltin(inputs... condition trueCallable falseCallable -- outputs...)Selects between two already-selected Block branches by Cond. Unknown conditions require both branches to be compiled and merged.loopbuiltin(inputs... callable -- outputs...)Repeatedly calls one already-selected Block through a call boundary. The run-time repetition invariant is(A -- A Cond): each body call preserves the carried stack’s shape — the number of objects and their schemas — not necessarily their values, and leaves a final Cond; known-condition iterations may add items or change schemas.uifbuiltin(inputs... condition trueCallable falseCallable -- outputs...)Selects between two already-selected Block branches by a known Cond and processes the selected branch inline. No branch-output merge occurs.