getCallTrace (-- callTrace)

Inputs

Outputs

getCallTrace returns the structured immutable Ref itself.

The result schema is an immutable Ref to the callTraceItem type. In formatted form, that referent schema is:

{
  name: Text;
  line: Int32;
  column: Int32;
  prev: Natx;
}

The referent fields mean:

Behavior

Example: lacking trace data

getCallTrace returns an immutable Ref to a call-trace item with name, line, column, and prev fields, a known NIL one when no call-trace data is available, as here.

{} 0 {} [
  "-- immutable Ref result --" printCompilerMessage
  getCallTrace isConst printStack _:;
  getCallTrace printStack _:;
  0
] "main" exportFunction

Expected Output During Compilation

-- immutable Ref result --
TRUE
{
  name: Text;
  line: Int32;
  column: Int32;
  prev: Natx;
} CNIL

See also