call

call (callable -- calledResult)

Inputs

Outputs

Calls one already-selected stack callable. No name lookup or field selection happens inside the builtin.

call performs a call boundary. Locals created inside the called logic do not remain available afterward.

Behavior

When the input is a callable Dict, that callable Dict's fields are available for direct scope lookup during CALL. For a non-Meta non-static callable Dict, a special name closure is also available and references that same Dict. There is no separate self name here, because no outer field-selection step occurs inside call.

Known Text inputs are interpreted as MPL code text and then called through the same call boundary.

Example

{} 0 {} [
  "-- block uses stack values below it --" printCompilerMessage
  5 [2 +] call printStack _:;

  "-- call uses CALL directly on an already selected Dict --" printCompilerMessage
  runner: {
    factor: 3;
    PRE: [FALSE];
    CALL: [factor *];
  };
  7 @runner call printStack _:;

  "-- read Code value first, then call it --" printCompilerMessage
  codeLocal: {} () {} codeRef;
  ["-- code --" printCompilerMessage] !codeLocal
  @codeLocal call

  "-- known text from stack --" printCompilerMessage
  9 «1 +» call printStack _:;

  "-- known text local may be mentioned plainly --" printCompilerMessage
  textLocal: «2 +»;
  8 textLocal call printStack _:;

  0
] "main" exportFunction

Expected Output During Compilation

-- block uses stack values below it --
7
-- call uses CALL directly on an already selected Dict --
21
-- read Code value first, then call it --
-- code --
-- known text from stack --
10
-- known text local may be mentioned plainly --
10

See also