← index

Runtimeabstract

inherits Object

The running program's own runtime: command-line arguments, process exit:, and the eval: family for compiling and running Quoin source at runtime.

Class methods

arguments

The program's command-line arguments (those after the script name), as a List of Strings.

native

callerLocation:Integer

The source location ('file:line:col') of the statement executing n frames up the call stack — raw frames, blocks included: 0 is the frame that sent this message, 1 its caller, and so on. Nil past the top of the stack or for a frame with no source info. A caller skipping its own plumbing should walk n upward comparing filenames rather than hard-coding a depth (an AOT-compiled frame is absent from the walk) — that is how Log stamps each entry.

native

callerLocationSkipping:String

The nearest enclosing call-site location ('file:line:col') whose file does NOT contain the given fragment — how a library skips its own frames when stamping a caller (Log passes its own filename). Nil when every frame matches. See callerLocation: for the raw indexed walk.

native

eval:

Compile and run a String of Quoin source, answering its final value. A syntax error raises a catchable ParseError. Definitions land in the same global scope as the running program.

Runtime.eval:'1 + 2'    "* -> 3

native

eval:String bindings:Map

As eval:, with the Map's entries seeded as locals in the evaluated frame (String keys become the variable names).

Runtime.eval:'x * 2' bindings:#{ 'x': 21 }    "* -> 42

native

eval: self:

As eval:, with self bound to the second argument inside the evaluated code -- self sends and @ivars resolve against it.

A <- { |@x| init -> { @x = 7 } };
Runtime.eval:'@x + 1' self:A.new    "* -> 8

native

exit

As exit: with status 0.

native

exit:Integer

Request process exit with the given status code. Uncatchable (like cancellation): the raising task unwinds through its finally blocks, every other task stops at the driver, and the process exits after normal teardown.

native

options

The runtime's facts as a Map: 'arguments' (the command-line List) and 'supports_color' (Boolean) today.

native

supportsColor

Whether standard output supports ANSI color, as detected at startup.

native