ucall

ucall (callable -- inlineResult)

Inputs

Outputs

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

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