printStack (--)

Inputs

Outputs

printStack prints the current data stack without modifying it.

Behavior

Notation

A known value is printed as a literal (5, "t", TRUE, (1 2), a multi-line Dict with one name: value; per field); an unknown value is printed as its schema name (Int32, Text). A Ref is printed as its target's value or schema followed by Ref for a mutable reference or Cref for an immutable one: x: 5; gives 5 Cref for x and 5 Ref for @x. A known NIL reference is printed as NIL or CNIL after the target schema, so Int32 Ref prints as Int32 CNIL; in a formatted Dict a private field has private after its value or schema, before the semicolon; a NIL Code prints its signature followed by CNIL ({} () {} codeRef CNIL). A Block is printed as its source position: «test.mpl» 3 3 Block.

Example

{} 0 {} [
  "-- original stack --" printCompilerMessage
  7 "hi" FALSE
  printStack

  "-- printStack does not pop --" printCompilerMessage
  printStack

  "-- after one manual pop --" printCompilerMessage
  _:;
  printStack
  _:; _:;
  0
] "main" exportFunction

Expected Output During Compilation

-- original stack --
7
"hi"
FALSE
-- printStack does not pop --
7
"hi"
FALSE
-- after one manual pop --
7
"hi"

See also