Wren Plugin for Xojo

EinhugurWren.VM Class

Class representing Wren VM object to execute Wren code.

Object
   VM

class EinhugurWren.VM

Constructors

VMConstructor that takes Configuration as parameter.

Properties

SlotCountReturns the number of slots available to the current foreign method.

Methods

AbortFiberSets the current fiber to be aborted, and uses the value in given slot number as the runtime error object.
CallMethodCalls a method that has been made ready in a Method handle, taking class and parameters from current slot stack.
CollectGarbageImmediately runs the garbage collector to free unused memory.
CreateCallHandleCreates call handle to call a method in Wren script.
EnsureSlotsEnsures that the foreign method stack has at least [slotCount] available for use, growing the stack if needed.
shared FromVMPtrCasts Ptr gotten in Foreign method callback to VM class.
GetClassHandleGets handle to class in Wren script.
GetListCountReturns the number of elements in the list stored in list in given slot.
GetListElementReads element from given index from the list in listSlot and stores it in destinationSlot.
GetMapCountReturns the number of entries in the map stored in given slot.
GetMapValueRetrieves a value with the key in keySlot from the map in mapSlot and stores it in valueSlot.
GetVariableLooks up the top level variable with given name in resolved module name and stores it in specified slot.
HasVariableChecks if top level variable given name in resolved module name and returns true if it was found, else false.
InsertInListInserts or appends to list. Takes the value stored at elementSlot and inserts it into the list stored at listSlot at index.
InterpretInterprets Wren script.
MapContainsKeyReturns true if the key in keySlot is found in the map placed in mapSlot.
RemoveMapValueRemoves a value from the map in mapSlot, with the key from keySlot, and places it in removedValueSlot. If not found, removedValueSlot is set to null, the same behavior as the Wren Map API.
SetListElementSets the value stored at given index in the which is stored in listSlot, to the value from sourceSlot.
SetMapValueTakes the value stored at valueSlot and inserts it into the map stored at mapSlot with key keySlot.
SetSlotNewForeignBinds Xojo object to slot.
SetSlotNewListStores a new empty list in given slot number.
SetSlotNewMap Stores a new empty map in given slot number.
SlotBoolSets or gets Wren slot with Boolean value.
SlotDoubleSets or gets Wren slot with Double value.
SlotForeignGets Xojo object from Foreign slot.
SlotHandleSets or gets Wren slot with Handle value.
SlotStringSets or gets Wren slot with String value.
SlotToNullStores NULL in given slot.
SlotTypeGets the type of the object in given slot.

Supported Platforms:

  • macOS Intel 64 bit
  • macOS Apple Silicon
  • Windows 32 bit
  • Windows 64 bit
  • Windows ARM 64 bit
  • Linux 32 bit
  • Linux 64 bit
  • Linux ARM 32 bit
  • Linux ARM 64 bit
  • iOS