Intrinsic Functions: "t3vm" Function Set

The "t3vm" function set provides access to internal operations in the VM.  This function set is provided by all T3 VM implementations and all host applications.

 

t3DebugTrace(mode, …) – debugger interface.  The mode parameter indicates the function to be performed.  Any arguments after mode are specific to the mode.  The valid mode values are:

 

 

If this function is called with any other values for the mode argument, it simply ignores any additional arguments and returns nil; this allows for compatible extensions to the function in the future by the addition of new mode values.

 

t3GetVMBanner() – returns the T3 VM banner string, which is a string identifying the VM, its version number, and its copyright information.  This string is suitable for displaying as a start-up banner.

 

t3GetVMID() – returns the T3 VM identification string.  This is a short string identifying the particular VM implementation; each different implementation has a unique identifier.  Mike Roberts's T3 VM implementation has the identifying string 'mjr-T3'.

 

Note that the VM identification string identifies the VM itself, not the host application environment.

 

t3GetVMPreinitMode() – returns true if the VM is operating in pre-initialization mode, nil if the VM is operating in normal execution mode.

 

t3GetVMVsn() – get the T3 VM version number.  This returns an integer value; the high-order 16 bits of the value give the major version number of the VM; the next 8 bits give the minor version number; and the low-order 8 bits give the patch release number.  So, if V is the return value of this function,

 

 

t3RunGC() – explicitly runs the garbage collector.  Since the garbage collector runs automatically from time to time, it is never necessary to call this function explicitly.  However, if the programmer identifies a particular point at which a large number of objects have suddenly become unreachable, and when a large number of objects are likely to be allocated soon, it might be advantageous to run the garbage collector explicitly so that it can optimize memory.  It might also be desirable to run garbage collection explicitly when a natural user-interface pause is about to occur anyway, since this would take advantage of the natural pause to hide any delay that would occur running the collector.  No return value.

 

t3SetSay(val) – set the default output function or method to the given value:

 

o          There is a valid "self" object (i.e., a method is being executed, not a stand-alone function).

o          A default display method has been defined with t3SetSay().

o          The current "self" object defines or inherits the default display  method.

If these conditions aren't all true, the VM uses the default display function instead.

 

This function has no return value.