internal

package
v0.0.0-...-cfb4354 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 17, 2020 License: Zlib Imports: 34 Imported by: 0

Documentation

Index

Constants

View Source
const IoSpecVer = "0.0.0"

IoSpecVer is the Io language version, used for the System iospecVersion slot.

View Source
const IoVersion = "1"

IoVersion is the interpreter version, used for the System version slot. It bears no relation to versions of the original implementation.

View Source
const NumberTag = BasicTag("Number")

NumberTag is the tag for Number objects.

View Source
const SchedulerTag = BasicTag("Scheduler")

SchedulerTag is the Tag for the Scheduler.

View Source
const SeqMaxItemSize = 8

SeqMaxItemSize is the maximum size in bytes of a single sequence element.

Variables

View Source
var (
	SeqU8  = SeqKind{seqU8}
	SeqU16 = SeqKind{seqU16}
	SeqU32 = SeqKind{seqU32}
	SeqU64 = SeqKind{seqU64}
	SeqS8  = SeqKind{seqS8}
	SeqS16 = SeqKind{seqS16}
	SeqS32 = SeqKind{seqS32}
	SeqS64 = SeqKind{seqS64}
	SeqF32 = SeqKind{seqF32}
	SeqF64 = SeqKind{seqF64}
)

SeqKind values.

View Source
var BlockTag tagBlock

BlockTag is the Tag for Block objects. Activate activates the block if it is activatable and otherwise returns the block. CloneValue creates a new block with a deep copy of the parent's message.

View Source
var CFunctionTag tagCFunction

CFunctionTag is the tag for CFunctions. Activate calls the wrapped function. CloneValue returns the same function.

View Source
var CallTag tagCall

CallTag is the Tag for Call objects. Activate returns self. CloneValue creates a Call with all fields set to nil.

View Source
var CoroutineTag tagCoro

CoroutineTag is the Tag for Coroutine objects. Activate returns the coroutine. CloneValue creates a new control flow channel and no debugging.

View Source
var DebuggerTag tagDebugger

DebuggerTag is the tag for Debugger objects. Activate returns self. CloneValue creates a new debug channel.

View Source
var ExceptionTag tagException

ExceptionTag is the Tag for Exception objects. Activate returns the exception. CloneValue creates an exception with the same error and a copy of the parent exception's stack.

View Source
var ListTag tagList

ListTag is the Tag for List objects. Activate returns self. CloneValue creates a shallow copy of the parent's list value.

View Source
var MapTag tagMap

MapTag is the Tag for Map objects. Activate returns self. CloneValue copies the keys and values in the map.

View Source
var MessageTag tagMessage

MessageTag is the Tag for Message objects. Activate performs the message as an inline method if its isActivatable slot evaluates to true; otherwise, it returns self. CloneValue creates a new Message with the same text and label. (The Message proto has a custom clone method that does the right thing.)

View Source
var SequenceTag tagSequence

SequenceTag is the Tag for Sequence values. Activate returns self. CloneValue copies the sequence.

Functions

func DebuggerChan

func DebuggerChan(d Debugger) chan DebugMessage

DebuggerChan allows coreext/debugger to retrieve a Debugger's message channel.

func InitAddon

func InitAddon(vm *VM)

InitAddon initializes the addon system on the VM. This is called only by the initializer from the addon core extension.

func Ioz

func Ioz(vm *VM, io, names []string)

Ioz executes zlib-compressed Io scripts generated by gencore. Panics on any error.

func PtrCompare

func PtrCompare(x, y *Object) int

PtrCompare returns a compare value for the pointers of two objects. It panics if the value is not a real object.

func Register

func Register(f func(*VM))

Register registers a core extension. Each function is called in the order it is registered; extensions that depend on other extensions need only import them. Register should be called from within init funcs. Panics if NewVM has been called.

func RunCoro

func RunCoro(vm *VM)

RunCoro starts an inactive coroutine by activating its main slot. It should be used in a go statement.

func ScanForAddons

func ScanForAddons(vm *VM, file *os.File)

ScanForAddons sends a directory that the VM should scan for addons.

func SliceArgs

func SliceArgs(vm *VM, locals *Object, msg *Message, size int) (start, step, stop int, exc *Object, control Stop)

SliceArgs gets start, stop, and step values for a standard slice-like method invocation, which may be any of the following:

slice(start)
slice(start, stop)
slice(start, stop, step)

start and stop are fixed in the following sense: for each, if it is less than zero, then size is added to it, then, if it is still less than zero, it becomes -1 if the step is negative and 0 otherwise; if it is greater than or equal to the size, then it becomes size - 1 if step is negative and size otherwise.

Types

type Addon

type Addon interface {
	// Name returns the name of the addon.
	Name() string
	// Protos returns the list of protos this addon installs.
	Protos() []string
	// Depends returns the list of addons on which this addon depends. The VM
	// attempts to install each in the listed order before calling this addon's
	// Init. If any dependency cannot be installed, Init is never called.
	Depends() []string
	// Init initializes the plugin on this VM. For each proto the addon
	// provides, Init should call vm.Install with the base prototype.
	Init(vm *VM)
}

Addon is an interface via which an addon is loaded into a VM.

Addons in iolang are separate packages, which may be linked dynamically (on platforms supporting -buildmode=plugin) or statically. The addon is loaded by calling its IoAddon function, which must be of type func() Addon. This function will be called no more than once per interpreter. The plugin itself is opened only once per program, so its init functions may run less than once per time it is added to an interpreter.

For dynamically loaded addons, the Io program's Importer uses a CFunction to lookup the IoAddon function in the plugin when needed. For statically linked addons, however, the program which creates the VM must manually load all addons using the VM's LoadAddon method.

type BasicTag

type BasicTag string

BasicTag is a special Tag type for basic primitive types which do not have special activation and whose clones have values that are shallow copies of their parents.

func (BasicTag) Activate

func (t BasicTag) Activate(vm *VM, self, target, locals, context *Object, msg *Message) *Object

Activate returns self.

func (BasicTag) CloneValue

func (t BasicTag) CloneValue(value interface{}) interface{}

CloneValue returns value.

func (BasicTag) String

func (t BasicTag) String() string

String returns the receiver.

type Block

type Block struct {
	// Message is the message that the block performs.
	Message *Message
	// Self is the block's lexical scope. If nil, then the block is a method,
	// and the scope becomes the receiver of the message that activated the
	// block.
	Self *Object
	// ArgNames is the list of argument slot names.
	ArgNames []string

	// Activatable controls whether the block performs its message or returns
	// itself when activated.
	Activatable bool
	// PassStops controls whether the block resends control flow signals that
	// are returned from evaluating its message.
	PassStops bool
}

A Block is a reusable, lexically scoped message. Essentially a function.

NOTE: Unlike most other primitives in iolang, Block values are NOT synchronized. It is a race condition to modify a block that might be in use, such as 'call activated' or any block or method object in a scope other than the locals of the innermost currently executing block.

type CFunction

type CFunction struct {
	Function Fn
	Type     Tag
	Name     string
}

A CFunction is object value representing a compiled function.

func (CFunction) String

func (f CFunction) String() string

String returns the name of the object.

type Call

type Call struct {

	// Sender is the local context in which the block was activated.
	Sender *Object
	// Actor is the block which is being activated.
	Actor *Object
	// Msg is the message which was sent to activate the block.
	Msg *Message
	// Target is the receiver of the message which activated the block.
	Target *Object
	// Context is the object that actually held the slot containing the block.
	Context *Object
	// Coro is the coroutine in which the block was activated.
	Coro *VM
	// contains filtered or unexported fields
}

Call wraps information about the activation of a Block.

func (*Call) SetStatus

func (c *Call) SetStatus(s Stop)

SetStatus sets the call's relayed control flow status.

func (*Call) Status

func (c *Call) Status() Stop

Status returns the call's relayed control flow status.

type Coroutine

type Coroutine struct {
	// Control is the control flow channel for the VM associated with this
	// coroutine.
	Control chan RemoteStop
	// Debug is a pointer to the VM's Debug flag.
	Debug *uint32
}

A Coroutine holds control flow and debugging for a single Io coroutine.

type DebugMessage

type DebugMessage struct {
	Msg    *Message
	Target *Object
	Locals *Object
	Dbg    chan struct{}
}

DebugMessage holds a context to be debugged and a channel to indicate it has.

type Debugger

type Debugger struct {
	// contains filtered or unexported fields
}

Debugger is a debugger for a single coroutine.

func DebuggerWith

func DebuggerWith(msgs chan DebugMessage) Debugger

DebuggerWith allows coreext/debugger to create a Debugger object.

type Exception

type Exception struct {
	Err   error
	Stack []*Message
}

An Exception is an Io exception.

func (Exception) Error

func (e Exception) Error() string

Error returns the error message.

func (Exception) String

func (e Exception) String() string

String returns the error message.

func (Exception) Unwrap

func (e Exception) Unwrap() error

Unwrap returns the wrapped error.

type Fn

type Fn func(vm *VM, target, locals *Object, msg *Message) *Object

An Fn is a statically compiled function which can be executed in the context of an Io VM.

type Message

type Message struct {
	// Text is the name of this message.
	Text string
	// Args are the message's argument messages.
	Args []*Message
	// Next and Prev are links to the following and previous messages.
	Next, Prev *Message

	// Memo is the message's cached value. If non-nil, this is used instead of
	// performing the message.
	Memo *Object

	// Label is the message's label, generally the name of the file from which
	// it was parsed, if any.
	Label string
	// Line and Col are the one-based line and column numbers within the file
	// at which the message was parsed.
	Line, Col int
}

A Message is the fundamental syntactic element and functionality of Io.

NOTE: Unlike most other primitive types in iolang, Message values are NOT synchronized. It is a race condition to modify a message that might be in use, such as 'call message' or any message object in a scope other than the locals of the innermost currently executing block.

func ForeachArgs

func ForeachArgs(msg *Message) (kn, vn string, hkn, hvn bool, ev *Message)

ForeachArgs gets the arguments for a foreach method utilizing the standard foreach([[key,] value,] message) syntax.

func (*Message) ArgAt

func (m *Message) ArgAt(n int) (r *Message)

ArgAt returns the argument at position n, or nil if the position is out of bounds.

func (*Message) ArgCount

func (m *Message) ArgCount() int

ArgCount returns the number of arguments to the message.

func (*Message) AsStringArgAt

func (m *Message) AsStringArgAt(vm *VM, locals *Object, n int) (string, *Object, Stop)

AsStringArgAt evaluates the nth argument, then activates its asString slot for a string representation. If the result is not a string, then the result has nil value, and an exception object is returned with an ExceptionStop.

func (*Message) AssertArgCount

func (m *Message) AssertArgCount(name string, n int) error

AssertArgCount returns an error if the message does not have the given number of arguments. name is the name of the message used in the generated error message.

func (*Message) DeepCopy

func (m *Message) DeepCopy() *Message

DeepCopy creates a copy of the message linked to copies of each message forward.

func (*Message) Eval

func (m *Message) Eval(vm *VM, locals *Object) (result *Object, control Stop)

Eval evaluates a message in the context of the given VM. This is a proxy to Send using locals as the target.

NOTE: It is unsafe to call this while holding the lock of any object.

func (*Message) EvalArgAt

func (m *Message) EvalArgAt(vm *VM, locals *Object, n int) (result *Object, control Stop)

EvalArgAt evaluates the nth argument.

func (*Message) InsertAfter

func (m *Message) InsertAfter(next *Message)

InsertAfter links another message to follow this one.

func (*Message) IsStart

func (m *Message) IsStart() bool

IsStart determines whether this message is the start of a "statement." This is true if it has no previous link or if the previous link is a terminator. If m is nil, then m has no previous link, hence this returns true.

func (*Message) IsTerminator

func (m *Message) IsTerminator() bool

IsTerminator determines whether this message is the end of an expression. This is true if it is nil or it is a semicolon or newline.

func (*Message) ListArgAt

func (m *Message) ListArgAt(vm *VM, locals *Object, n int) ([]*Object, *Object, Stop)

ListArgAt evaluates the nth argument and returns it as a slice of objects along with the object holding that slice. If a stop occurs during evaluation, the slice will be nil, and the stop status and result will be returned. If the evaluated result is not a List, the result will be nil, and an exception will be returned with an ExceptionStop.

func (*Message) MessageArgAt

func (m *Message) MessageArgAt(vm *VM, locals *Object, n int) (*Message, *Object, Stop)

MessageArgAt evaluates the nth argument and returns it as a Message. If a stop occurs during evaluation, the Message will be nil, and the stop status and result will be returned. If the evaluated result is not a Message, the result will be nil, and an exception will be returned with an ExceptionStop.

func (*Message) Name

func (m *Message) Name() string

Name returns the name of the message, which is its text if it is non-nil.

func (*Message) NumberArgAt

func (m *Message) NumberArgAt(vm *VM, locals *Object, n int) (float64, *Object, Stop)

NumberArgAt evaluates the nth argument and returns its Number value. If a stop occurs during evaluation, the value will be 0, and the stop status and result will be returned. If the evaluated result is not a Number, the result will be 0 and an exception will be returned with an ExceptionStop.

func (*Message) Send

func (m *Message) Send(vm *VM, target, locals *Object) (result *Object, control Stop)

Send evaluates a message in the context of the given VM, targeting an object. After each message in the chain, this checks the VM's Control channel and returns if there is a waiting signal.

NOTE: It is unsafe to call this while holding the lock of any object.

func (*Message) SeqOrNumArgAt

func (m *Message) SeqOrNumArgAt(vm *VM, locals *Object, n int) (Sequence, float64, *Object, Stop)

SeqOrNumArgAt evaluates the nth argument, then returns its value as a Sequence or a float64, along with the corresponding object. If a stop occurs during evaluation, both results will be their zero values, and the stop status and result will be returned. If the evaluated result is neither a Sequence nor a Number, then the results will be their zero values, and an exception will be returned with an ExceptionStop.

func (*Message) SequenceArgAt

func (m *Message) SequenceArgAt(vm *VM, locals *Object, n int) (Sequence, *Object, Stop)

SequenceArgAt evaluates the nth argument and returns its value as a Sequence with its object. If a stop occurs during evaluation, the returned Sequence has nil value, and the stop result and status are returned. If the evaluated result is not a Sequence, the result has nil value, and an exception is returned with an ExceptionStop.

func (*Message) String

func (m *Message) String() string

String generates a diagnostic string representation of this message.

func (*Message) StringArgAt

func (m *Message) StringArgAt(vm *VM, locals *Object, n int) (string, *Object, Stop)

StringArgAt evaluates the nth argument, asserts that it is a Sequence, and returns its value as a string. If a stop occurs during evaluation, the returned string is empty, and the stop result and status are returned. If the evaluated result is not a Sequence, the result has nil value, and an exception is returned with an ExceptionStop.

type Object

type Object struct {

	// Mutex is a lock which must be held when accessing the value of the
	// object if it is or may be mutable.
	sync.Mutex
	// Value is the object's type-specific primitive value.
	Value interface{}
	// contains filtered or unexported fields
}

Object is the basic type of Io. Everything is an Object.

func BlockArgumentNames

func BlockArgumentNames(vm *VM, target, locals *Object, msg *Message) *Object

BlockArgumentNames is a Block method.

argumentNames returns a list of the argument names of the block.

func BlockAsString

func BlockAsString(vm *VM, target, locals *Object, msg *Message) *Object

BlockAsString is a Block method.

asString creates a string representation of an object.

func BlockCall

func BlockCall(vm *VM, target, locals *Object, msg *Message) *Object

BlockCall is a Block method.

call activates a block.

func BlockMessage

func BlockMessage(vm *VM, target, locals *Object, msg *Message) *Object

BlockMessage is a Block method.

message returns the block's message.

func BlockPassStops

func BlockPassStops(vm *VM, target, locals *Object, msg *Message) *Object

BlockPassStops is a Block method.

passStops returns whether the block returns control flow signals upward.

func BlockPerformOn

func BlockPerformOn(vm *VM, target, locals *Object, msg *Message) *Object

BlockPerformOn is a Block method.

performOn executes the block in the context of the argument. Optional arguments may be supplied to give non-default locals and message.

func BlockScope

func BlockScope(vm *VM, target, locals *Object, msg *Message) *Object

BlockScope is a Block method.

scope returns the scope of the block, or nil if the block is a method.

func BlockSetArgumentNames

func BlockSetArgumentNames(vm *VM, target, locals *Object, msg *Message) *Object

BlockSetArgumentNames is a Block method.

setArgumentNames changes the names of the arguments of the block. This does not modify the block code, so some arguments might change to context lookups and vice-versa.

func BlockSetMessage

func BlockSetMessage(vm *VM, target, locals *Object, msg *Message) *Object

BlockSetMessage is a Block method.

setMessage changes the message executed by the block.

func BlockSetPassStops

func BlockSetPassStops(vm *VM, target, locals *Object, msg *Message) *Object

BlockSetPassStops is a Block method.

setPassStops changes whether the block allows control flow signals to propagate out to the block's caller.

func BlockSetScope

func BlockSetScope(vm *VM, target, locals *Object, msg *Message) *Object

BlockSetScope is a Block method.

setScope changes the context of the block. If nil, the block becomes a method (but whether it is activatable does not change).

func CFunctionAsString

func CFunctionAsString(vm *VM, target, locals *Object, msg *Message) *Object

CFunctionAsString is a CFunction method.

asString returns a string representation of the object.

func CFunctionEqual

func CFunctionEqual(vm *VM, target, locals *Object, msg *Message) *Object

CFunctionEqual is a CFunction method.

== returns whether the two CFunctions hold the same internal function.

func CFunctionID

func CFunctionID(vm *VM, target, locals *Object, msg *Message) *Object

CFunctionID is a CFunction method.

id returns a unique number for the function invoked by the CFunction.

func CFunctionPerformOn

func CFunctionPerformOn(vm *VM, target, locals *Object, msg *Message) *Object

CFunctionPerformOn is a CFunction method.

performOn activates the CFunction using the supplied settings.

func CFunctionTypeName

func CFunctionTypeName(vm *VM, target, locals *Object, msg *Message) *Object

CFunctionTypeName is a CFunction method.

typeName returns the name of the type to which the CFunction is assigned.

func CFunctionUniqueName

func CFunctionUniqueName(vm *VM, target, locals *Object, msg *Message) *Object

CFunctionUniqueName is a CFunction method.

uniqueName returns the name of the function.

func CallActivated

func CallActivated(vm *VM, target, locals *Object, msg *Message) *Object

CallActivated is a Call method.

activated returns the currently executing block.

func CallCoroutine

func CallCoroutine(vm *VM, target, locals *Object, msg *Message) *Object

CallCoroutine is a Call method.

coroutine returns the coroutine in which this block is executing.

func CallMessage

func CallMessage(vm *VM, target, locals *Object, msg *Message) *Object

CallMessage is a Call method.

message returns the message which caused the current block to activate.

func CallSender

func CallSender(vm *VM, target, locals *Object, msg *Message) *Object

CallSender is a Call method.

sender returns the local context in which this block was activated.

func CallSetStopStatus

func CallSetStopStatus(vm *VM, target, locals *Object, msg *Message) *Object

CallSetStopStatus is a Call method.

setStopStatus sets a control flow status to propagate to the caller.

func CallSlotContext

func CallSlotContext(vm *VM, target, locals *Object, msg *Message) *Object

CallSlotContext is a Call method.

slotContext returns the object which held the slot containing the executing block.

func CallStopStatus

func CallStopStatus(vm *VM, target, locals *Object, msg *Message) *Object

CallStopStatus is a Call method.

stopStatus returns the control flow type that will propagate to the caller.

func CallTarget

func CallTarget(vm *VM, target, locals *Object, msg *Message) *Object

CallTarget is a Call method.

target returns the object to which the message which activated the executing block was sent.

func CoreInstall

func CoreInstall(vm *VM, proto string, slots Slots, value interface{}, tag Tag) *Object

CoreInstall is a transitional proxy to vm.coreInstall for core extensions.

func ExceptionError

func ExceptionError(vm *VM, target, locals *Object, msg *Message) *Object

ExceptionError is an Exception method.

error returns the exception's error message.

func ExceptionPass

func ExceptionPass(vm *VM, target, locals *Object, msg *Message) *Object

ExceptionPass is an Exception method.

pass re-raises a caught exception.

func ExceptionRaise

func ExceptionRaise(vm *VM, target, locals *Object, msg *Message) *Object

ExceptionRaise is an Exception method.

raise creates an exception with the given error message and raises it.

func ExceptionRaiseFrom

func ExceptionRaiseFrom(vm *VM, target, locals *Object, msg *Message) *Object

ExceptionRaiseFrom is an Exception method.

raiseFrom raises an exception from the given call site.

func ExceptionSetError

func ExceptionSetError(vm *VM, target, locals *Object, msg *Message) *Object

ExceptionSetError is an Exception method.

setError sets the exception's error message.

func ExceptionStack

func ExceptionStack(vm *VM, target, locals *Object, msg *Message) *Object

ExceptionStack is an Exception method.

stack returns the message stack of the exception.

func ListAppend

func ListAppend(vm *VM, target, locals *Object, msg *Message) *Object

ListAppend is a List method.

append adds items to the end of the list.

func ListAppendIfAbsent

func ListAppendIfAbsent(vm *VM, target, locals *Object, msg *Message) *Object

ListAppendIfAbsent is a List method.

appendIfAbsent adds items to the end of the list if they are not already in it.

func ListAppendSeq

func ListAppendSeq(vm *VM, target, locals *Object, msg *Message) *Object

ListAppendSeq is a List method.

appendSeq adds the items in the given lists to the list.

func ListAsString

func ListAsString(vm *VM, target, locals *Object, msg *Message) *Object

ListAsString is a List method.

asString creates a string representation of an object.

func ListAt

func ListAt(vm *VM, target, locals *Object, msg *Message) *Object

ListAt is a List method.

at returns the nth item in the list. All out-of-bounds values are nil.

func ListAtInsert

func ListAtInsert(vm *VM, target, locals *Object, msg *Message) *Object

ListAtInsert is a List method.

atInsert adds an item to the list at the given position, moving back existing items at or past that point.

func ListAtPut

func ListAtPut(vm *VM, target, locals *Object, msg *Message) *Object

ListAtPut is a List method.

atPut replaces an item in the list.

func ListCapacity

func ListCapacity(vm *VM, target, locals *Object, msg *Message) *Object

ListCapacity is a List method.

capacity is the number of items for which the list has allocated space.

func ListCompare

func ListCompare(vm *VM, target, locals *Object, msg *Message) *Object

ListCompare is a List method.

compare returns -1 if the receiver is less than the argument, 1 if it is greater, or 0 if they are equal.

func ListContains

func ListContains(vm *VM, target, locals *Object, msg *Message) *Object

ListContains is a List method.

contains returns true if the list contains an item equal to the given object.

func ListContainsAll

func ListContainsAll(vm *VM, target, locals *Object, msg *Message) *Object

ListContainsAll is a List method.

containsAll returns true if the list contains items equal to each of the given objects.

func ListContainsAny

func ListContainsAny(vm *VM, target, locals *Object, msg *Message) *Object

ListContainsAny is a List method.

containsAny returns true if the list contains an item equal to any of the given objects.

func ListContainsIdenticalTo

func ListContainsIdenticalTo(vm *VM, target, locals *Object, msg *Message) *Object

ListContainsIdenticalTo is a List method.

containsIdenticalTo returns true if the list contains exactly the given object.

func ListForeach

func ListForeach(vm *VM, target, locals *Object, msg *Message) (result *Object)

ListForeach is a List method.

foreach performs a loop on each item of a list in order, optionally setting index and value variables.

func ListIndexOf

func ListIndexOf(vm *VM, target, locals *Object, msg *Message) *Object

ListIndexOf is a List method.

indexOf returns the first index from the left of an item equal to the argument. If there is no such item in the list, nil is returned.

func ListPreallocateToSize

func ListPreallocateToSize(vm *VM, target, locals *Object, msg *Message) *Object

ListPreallocateToSize is a List method.

preallocateToSize ensures that the list has capacity for at least n items.

func ListPrepend

func ListPrepend(vm *VM, target, locals *Object, msg *Message) *Object

ListPrepend is a List method.

prepend adds items to the beginning of the list.

func ListRemove

func ListRemove(vm *VM, target, locals *Object, msg *Message) *Object

ListRemove is a List method.

remove removes all occurrences of each item from the list. The behavior of this method may be unpredictable if the list is modified concurrently.

func ListRemoveAll

func ListRemoveAll(vm *VM, target, locals *Object, msg *Message) *Object

ListRemoveAll is a List method.

removeAll removes all items from the list.

func ListRemoveAt

func ListRemoveAt(vm *VM, target, locals *Object, msg *Message) *Object

ListRemoveAt is a List method.

removeAt removes the item in the given position from the list.

func ListReverseForeach

func ListReverseForeach(vm *VM, target, locals *Object, msg *Message) (result *Object)

ListReverseForeach is a List method.

reverseForeach performs a loop on each item of a list in order, optionally setting index and value variables, proceeding from the end of the list to the start.

func ListReverseInPlace

func ListReverseInPlace(vm *VM, target, locals *Object, msg *Message) *Object

ListReverseInPlace is a List method.

reverseInPlace reverses the order of items in the list.

func ListSetSize

func ListSetSize(vm *VM, target, locals *Object, msg *Message) *Object

ListSetSize is a List method.

setSize changes the size of the list, removing items from or adding nils to the end as necessary.

func ListSize

func ListSize(vm *VM, target, locals *Object, msg *Message) *Object

ListSize is a List method.

size is the number of items in the list.

func ListSlice

func ListSlice(vm *VM, target, locals *Object, msg *Message) *Object

ListSlice is a List method.

slice returns a selected linear portion of the list.

func ListSliceInPlace

func ListSliceInPlace(vm *VM, target, locals *Object, msg *Message) *Object

ListSliceInPlace is a List method.

sliceInPlace reduces the list to a selected linear portion.

func ListSortInPlace

func ListSortInPlace(vm *VM, target, locals *Object, msg *Message) *Object

ListSortInPlace is a List method.

sortInPlace sorts the list according to the items' compare method.

func ListSortInPlaceBy

func ListSortInPlaceBy(vm *VM, target, locals *Object, msg *Message) *Object

ListSortInPlaceBy is a List method.

sortInPlaceBy sorts the list using a given compare block.

func ListSwapIndices

func ListSwapIndices(vm *VM, target, locals *Object, msg *Message) *Object

ListSwapIndices is a List method.

swapIndices swaps the values in two positions in the list.

func ListWith

func ListWith(vm *VM, target, locals *Object, msg *Message) *Object

ListWith is a List method.

with creates a new list with the given values as items.

func LocalsForward

func LocalsForward(vm *VM, target, locals *Object, msg *Message) *Object

LocalsForward is a Locals method.

forward handles messages to which the object does not respond.

func LocalsUpdateSlot

func LocalsUpdateSlot(vm *VM, target, locals *Object, msg *Message) *Object

LocalsUpdateSlot is a Locals method.

updateSlot changes the value of an existing slot.

func MapAt

func MapAt(vm *VM, target, locals *Object, msg *Message) *Object

MapAt is a Map method.

at returns the value at the given key, or the default value if it is missing.

func MapAtIfAbsentPut

func MapAtIfAbsentPut(vm *VM, target, locals *Object, msg *Message) *Object

MapAtIfAbsentPut is a Map method.

atIfAbsentPut sets the given key if it is not already in the map and returns the value at the key if it is.

func MapAtPut

func MapAtPut(vm *VM, target, locals *Object, msg *Message) *Object

MapAtPut is a Map method.

atPut sets the value of the given string key.

func MapEmpty

func MapEmpty(vm *VM, target, locals *Object, msg *Message) *Object

MapEmpty is a Map method.

empty removes all items from the map.

func MapForeach

func MapForeach(vm *VM, target, locals *Object, msg *Message) (result *Object)

MapForeach is a Map method.

foreach performs a loop on each key of the map in random order, setting key and value variables, with the key variable being optional. If keys are added to the map while the loop is being evaluated, then those additions are not included in the loop; any keys removed during the loop are iterated with nil value.

func MapHasKey

func MapHasKey(vm *VM, target, locals *Object, msg *Message) *Object

MapHasKey is a Map method.

hasKey returns true if the key exists in the map.

func MapKeys

func MapKeys(vm *VM, target, locals *Object, msg *Message) *Object

MapKeys is a Map method.

keys returns a list of all keys in the map in random order.

func MapRemoveAt

func MapRemoveAt(vm *VM, target, locals *Object, msg *Message) *Object

MapRemoveAt is a Map method.

removeAt removes a key from the map if it exists.

func MapSize

func MapSize(vm *VM, target, locals *Object, msg *Message) *Object

MapSize is a Map method.

size returns the number of values in the map.

func MapValues

func MapValues(vm *VM, target, locals *Object, msg *Message) *Object

MapValues is a Map method.

values returns a list of all values in the map in random order.

func MessageAppendArg

func MessageAppendArg(vm *VM, target, locals *Object, msg *Message) *Object

MessageAppendArg is a Message method.

appendArg adds a message as an argument to the message.

func MessageAppendCachedArg

func MessageAppendCachedArg(vm *VM, target, locals *Object, msg *Message) *Object

MessageAppendCachedArg is a Message method.

appendCachedArg adds a value as an argument to the message.

func MessageArgAt

func MessageArgAt(vm *VM, target, locals *Object, msg *Message) *Object

MessageArgAt is a Message method.

argAt returns the nth argument, or nil if out of bounds.

func MessageArgCount

func MessageArgCount(vm *VM, target, locals *Object, msg *Message) *Object

MessageArgCount is a Message method.

argCount returns the number of arguments to the message.

func MessageArgsEvaluatedIn

func MessageArgsEvaluatedIn(vm *VM, target, locals *Object, msg *Message) *Object

MessageArgsEvaluatedIn is a Message method.

argsEvaluatedIn returns a list containing the message arguments evaluated in the context of the given object.

func MessageArguments

func MessageArguments(vm *VM, target, locals *Object, msg *Message) *Object

MessageArguments is a Message method.

arguments returns a list of the arguments to the message as messages.

func MessageAsMessageWithEvaluatedArgs

func MessageAsMessageWithEvaluatedArgs(vm *VM, target, locals *Object, msg *Message) *Object

MessageAsMessageWithEvaluatedArgs is a Message method.

asMessageWithEvaluatedArgs creates a copy of the message with its arguments evaluated.

func MessageAsString

func MessageAsString(vm *VM, target, locals *Object, msg *Message) *Object

MessageAsString is a Message method.

asString creates a string representation of an object.

func MessageCachedResult

func MessageCachedResult(vm *VM, target, locals *Object, msg *Message) *Object

MessageCachedResult is a Message method.

cachedResult returns the cached value to which the message evaluates, or nil if there is not one, though this may also mean that nil is cached.

func MessageCharacterNumber

func MessageCharacterNumber(vm *VM, target, locals *Object, msg *Message) *Object

MessageCharacterNumber is a Message method.

characterNumber returns the column number of the character within the line at which the message was parsed.

func MessageClone

func MessageClone(vm *VM, target, locals *Object, msg *Message) *Object

MessageClone is a Message method.

clone creates a deep copy of the message.

func MessageDoInContext

func MessageDoInContext(vm *VM, target, locals *Object, msg *Message) *Object

MessageDoInContext is a Message method.

doInContext evaluates the message in the context of the given object, optionally with a given locals. If the locals aren't given, the context is the locals.

func MessageFromString

func MessageFromString(vm *VM, target, locals *Object, msg *Message) *Object

MessageFromString is a Message method.

fromString parses the string into a message chain.

func MessageHasCachedResult

func MessageHasCachedResult(vm *VM, target, locals *Object, msg *Message) *Object

MessageHasCachedResult is a Message method.

hasCachedResult returns whether the message has a cached value to which the message will evaluate.

func MessageIsEndOfLine

func MessageIsEndOfLine(vm *VM, target, locals *Object, msg *Message) *Object

MessageIsEndOfLine is a Message method.

isEndOfLine returns whether the message is a terminator.

func MessageLabel

func MessageLabel(vm *VM, target, locals *Object, msg *Message) *Object

MessageLabel is a Message method.

label returns the message's label, typically the name of the file from which it was parsed.

func MessageLast

func MessageLast(vm *VM, target, locals *Object, msg *Message) *Object

MessageLast is a Message method.

last returns the last message in the chain.

func MessageLastBeforeEndOfLine

func MessageLastBeforeEndOfLine(vm *VM, target, locals *Object, msg *Message) *Object

MessageLastBeforeEndOfLine is a Message method.

lastBeforeEndOfLine returns the last message in the chain before a terminator.

func MessageLineNumber

func MessageLineNumber(vm *VM, target, locals *Object, msg *Message) *Object

MessageLineNumber is a Message method.

lineNumber returns the line number at which the message was parsed.

func MessageName

func MessageName(vm *VM, target, locals *Object, msg *Message) *Object

MessageName is a Message method.

name returns the name of the message.

func MessageNext

func MessageNext(vm *VM, target, locals *Object, msg *Message) *Object

MessageNext is a Message method.

next returns the next message in the chain, or nil if this is the last one.

func MessageNextIgnoreEndOfLines

func MessageNextIgnoreEndOfLines(vm *VM, target, locals *Object, msg *Message) *Object

MessageNextIgnoreEndOfLines is a Message method.

nextIgnoreEndOfLines returns the next message in the chain, skipping terminators, or nil if this is the last such message.

func MessageOpShuffle

func MessageOpShuffle(vm *VM, target, locals *Object, msg *Message) *Object

MessageOpShuffle is a Message method.

opShuffle performs operator precedence shuffling on the message using the message's OperatorTable.

func MessagePrevious

func MessagePrevious(vm *VM, target, locals *Object, msg *Message) *Object

MessagePrevious is a Message method.

previous returns the previous message in the chain.

func MessageRemoveCachedResult

func MessageRemoveCachedResult(vm *VM, target, locals *Object, msg *Message) *Object

MessageRemoveCachedResult is a Message method.

removeCachedResult removes the cached value to which the message will evaluate, causing it to send to its receiver normally.

func MessageSetArguments

func MessageSetArguments(vm *VM, target, locals *Object, msg *Message) *Object

MessageSetArguments is a Message method.

setArguments sets the message's arguments to deep copies of the messages in the list argument.

func MessageSetCachedResult

func MessageSetCachedResult(vm *VM, target, locals *Object, msg *Message) *Object

MessageSetCachedResult is a Message method.

setCachedResult sets the message's cached value, causing it to evaluate to that value instead of sending to its receiver.

func MessageSetCharacterNumber

func MessageSetCharacterNumber(vm *VM, target, locals *Object, msg *Message) *Object

MessageSetCharacterNumber is a Message method.

setCharacterNumber sets the character number of the message, typically the column number within the line at which the message was parsed.

func MessageSetLabel

func MessageSetLabel(vm *VM, target, locals *Object, msg *Message) *Object

MessageSetLabel is a Message method.

setLabel sets the label of the message to the given string.

func MessageSetLineNumber

func MessageSetLineNumber(vm *VM, target, locals *Object, msg *Message) *Object

MessageSetLineNumber is a Message method.

setLineNumber sets the line number of the message to the given integer.

func MessageSetName

func MessageSetName(vm *VM, target, locals *Object, msg *Message) *Object

MessageSetName is a Message method.

setName sets the message name to the given string.

func MessageSetNext

func MessageSetNext(vm *VM, target, locals *Object, msg *Message) *Object

MessageSetNext is a Message method.

setNext sets the next message in the chain. That message's previous link will be set to this message, if non-nil.

func NumberAbs

func NumberAbs(vm *VM, target, locals *Object, msg *Message) *Object

NumberAbs is a Number method.

abs returns the absolute value of the target.

func NumberAcos

func NumberAcos(vm *VM, target, locals *Object, msg *Message) *Object

NumberAcos is a Number method.

acos returns the arccosine of the target.

func NumberAdd

func NumberAdd(vm *VM, target, locals *Object, msg *Message) *Object

NumberAdd is a Number method.

+ is an operator which sums two numbers.

func NumberAsBuffer

func NumberAsBuffer(vm *VM, target, locals *Object, msg *Message) *Object

NumberAsBuffer is a Number method.

asBuffer creates a Latin-1 Sequence with bytes equal to the binary representation of the target. An optional byte count for the size of the buffer may be supplied, with a default of 8.

func NumberAsCharacter

func NumberAsCharacter(vm *VM, target, locals *Object, msg *Message) *Object

NumberAsCharacter is a Number method.

asCharacter returns a string containing the Unicode character with the codepoint corresponding to the integer value of the target.

func NumberAsLowercase

func NumberAsLowercase(vm *VM, target, locals *Object, msg *Message) *Object

NumberAsLowercase is a Number method.

asLowercase returns the Number which is the Unicode codepoint corresponding to the lowercase version of the target as a Unicode codepoint.

func NumberAsString

func NumberAsString(vm *VM, target, locals *Object, msg *Message) *Object

NumberAsString is a Number method.

asString returns the decimal string representation of the target.

func NumberAsUint32Buffer

func NumberAsUint32Buffer(vm *VM, target, locals *Object, msg *Message) *Object

NumberAsUint32Buffer is a Number method.

asUint32Buffer returns a 4-byte buffer representing the target's value converted to a uint32.

func NumberAsUppercase

func NumberAsUppercase(vm *VM, target, locals *Object, msg *Message) *Object

NumberAsUppercase is a Number method.

asUppercase returns the Number which is the Unicode codepoint corresponding to the uppercase version of the target as a Unicode codepoint.

func NumberAsin

func NumberAsin(vm *VM, target, locals *Object, msg *Message) *Object

NumberAsin is a Number method.

asin returns the arcsine of the target.

func NumberAt

func NumberAt(vm *VM, target, locals *Object, msg *Message) *Object

NumberAt is a Number method.

at returns 1 if the argument has the nth bit of its integer representation set and 0 otherwise.

io> 3 at(1)
1
io> 3 at(2)
0

func NumberAtan

func NumberAtan(vm *VM, target, locals *Object, msg *Message) *Object

NumberAtan is a Number method.

atan returns the arctangent of the target.

func NumberAtan2

func NumberAtan2(vm *VM, target, locals *Object, msg *Message) *Object

NumberAtan2 is a Number method.

atan2 returns the directional arctangent of the target divided by the argument.

func NumberBetween

func NumberBetween(vm *VM, target, locals *Object, msg *Message) *Object

NumberBetween is a Number method.

between is true if the target is greater than or equal to the first argument and less than or equal to the second.

func NumberBitwiseAnd

func NumberBitwiseAnd(vm *VM, target, locals *Object, msg *Message) *Object

NumberBitwiseAnd is a Number method.

bitwiseAnd returns the bitwise intersection of the target and the argument, with each converted to 64-bit integers.

func NumberBitwiseComplement

func NumberBitwiseComplement(vm *VM, target, locals *Object, msg *Message) *Object

NumberBitwiseComplement is a Number method.

bitwiseComplement returns the bitwise complement of the 64-bit integer value of the target.

func NumberBitwiseOr

func NumberBitwiseOr(vm *VM, target, locals *Object, msg *Message) *Object

NumberBitwiseOr is a Number method.

bitwiseOr returns the bitwise union of the target and the argument, with each converted to 64-bit integers.

func NumberBitwiseXor

func NumberBitwiseXor(vm *VM, target, locals *Object, msg *Message) *Object

NumberBitwiseXor is a Number method.

bitwiseXor returns the bitwise symmetric difference of the target and the argument, with each converted to 64-bit integers.

func NumberCeil

func NumberCeil(vm *VM, target, locals *Object, msg *Message) *Object

NumberCeil is a Number method.

ceil returns the smallest integer larger than or equal to the target.

func NumberClip

func NumberClip(vm *VM, target, locals *Object, msg *Message) *Object

NumberClip is a Number method.

clip returns the target if it is between the given bounds or else the exceeded bound.

func NumberCompare

func NumberCompare(vm *VM, target, locals *Object, msg *Message) *Object

NumberCompare is a Number method.

compare returns -1 if the receiver is less than the argument, 1 if it is greater, or 0 if they are equal.

func NumberCos

func NumberCos(vm *VM, target, locals *Object, msg *Message) *Object

NumberCos is a Number method.

cos returns the cosine of the target.

func NumberCubed

func NumberCubed(vm *VM, target, locals *Object, msg *Message) *Object

NumberCubed is a Number method.

cubed returns the target raised to the third power.

func NumberDiv

func NumberDiv(vm *VM, target, locals *Object, msg *Message) *Object

NumberDiv is a Number method.

/ is an operator which divides the left value by the right.

func NumberExp

func NumberExp(vm *VM, target, locals *Object, msg *Message) *Object

NumberExp is a Number method.

exp returns e (the base of the natural logarithm) raised to the power of the target.

func NumberFactorial

func NumberFactorial(vm *VM, target, locals *Object, msg *Message) *Object

NumberFactorial is a Number method.

factorial computes the product of each integer between 1 and the target.

func NumberFloor

func NumberFloor(vm *VM, target, locals *Object, msg *Message) *Object

NumberFloor is a Number method.

floor returns the largest integer smaller than or equal to the target.

func NumberIsAlphaNumeric

func NumberIsAlphaNumeric(vm *VM, target, locals *Object, msg *Message) *Object

NumberIsAlphaNumeric is a Number method.

isAlphaNumeric is true if the target is a Unicode codepoint corresponding to a letter (category L) or number (category N).

func NumberIsControlCharacter

func NumberIsControlCharacter(vm *VM, target, locals *Object, msg *Message) *Object

NumberIsControlCharacter is a Number method.

isControlCharacter is true if the target is a Unicode codepoint corresponding to a control character.

func NumberIsDigit

func NumberIsDigit(vm *VM, target, locals *Object, msg *Message) *Object

NumberIsDigit is a Number method.

isDigit is true if the target is a Unicode codepoint corresponding to a decimal digit.

func NumberIsEven

func NumberIsEven(vm *VM, target, locals *Object, msg *Message) *Object

NumberIsEven is a Number method.

isEven is true if the integer value of the target is divisible by 2.

func NumberIsGraph

func NumberIsGraph(vm *VM, target, locals *Object, msg *Message) *Object

NumberIsGraph is a Number method.

isGraph is true if the target is a Unicode codepoint corresponding to a graphic character (categories L, M, N, P, S, Zs).

func NumberIsHexDigit

func NumberIsHexDigit(vm *VM, target, locals *Object, msg *Message) *Object

NumberIsHexDigit is a Number method.

isHexDigit is true if the target is a Unicode codepoint corresponding to the characters 0 through 9, A through F, or a through f.

func NumberIsLetter

func NumberIsLetter(vm *VM, target, locals *Object, msg *Message) *Object

NumberIsLetter is a Number method.

isLetter is true if the target is a Unicode codepoint corresponding to a letter (category L).

func NumberIsLowercase

func NumberIsLowercase(vm *VM, target, locals *Object, msg *Message) *Object

NumberIsLowercase is a Number method.

isLowercase is true if the target is a Unicode codepoint corresponding to a lowercase letter (category Ll).

func NumberIsNan

func NumberIsNan(vm *VM, target, locals *Object, msg *Message) *Object

NumberIsNan is a Number method.

isNan is true if the target is an IEEE-754 Not a Number.

func NumberIsOdd

func NumberIsOdd(vm *VM, target, locals *Object, msg *Message) *Object

NumberIsOdd is a Number method.

isOdd is true if the integer value of the target is not divisible by 2.

func NumberIsPrint

func NumberIsPrint(vm *VM, target, locals *Object, msg *Message) *Object

NumberIsPrint is a Number method.

isPrint is true if the target is a Unicode codepoint corresponding to a printable character (categories L, M, N, P, S, and ASCII space, U+0020).

func NumberIsPunctuation

func NumberIsPunctuation(vm *VM, target, locals *Object, msg *Message) *Object

NumberIsPunctuation is a Number method.

isPunctuation is true if the target is a Unicode codepoint corresponding to a punctuation character (category P).

func NumberIsSpace

func NumberIsSpace(vm *VM, target, locals *Object, msg *Message) *Object

NumberIsSpace is a Number method.

isSpace is true if the target is a Unicode codepoint corresponding to a space character.

func NumberIsUppercase

func NumberIsUppercase(vm *VM, target, locals *Object, msg *Message) *Object

NumberIsUppercase is a Number method.

isUppercase is true if the target is a Unicode codepoint corresponding to an uppercase letter (category Lu).

func NumberLog

func NumberLog(vm *VM, target, locals *Object, msg *Message) *Object

NumberLog is a Number method.

log returns the natural logarithm of the target.

func NumberLog10

func NumberLog10(vm *VM, target, locals *Object, msg *Message) *Object

NumberLog10 is a Number method.

log10 returns the base-10 logarithm of the target.

func NumberLog2

func NumberLog2(vm *VM, target, locals *Object, msg *Message) *Object

NumberLog2 is a Number method.

log2 returns the base-2 logarithm of the target.

func NumberMax

func NumberMax(vm *VM, target, locals *Object, msg *Message) *Object

NumberMax is a Number method.

max returns the larger of the target and the argument.

func NumberMin

func NumberMin(vm *VM, target, locals *Object, msg *Message) *Object

NumberMin is a Number method.

min returns the smaller of the target and the argument.

func NumberMod

func NumberMod(vm *VM, target, locals *Object, msg *Message) *Object

NumberMod is a Number method.

mod returns the remainder of division of the target by the argument.

func NumberMul

func NumberMul(vm *VM, target, locals *Object, msg *Message) *Object

NumberMul is a Number method.

* is an operator which multiplies its operands.

func NumberNegate

func NumberNegate(vm *VM, target, locals *Object, msg *Message) *Object

NumberNegate is a Number method.

negate returns the opposite of the target.

func NumberPow

func NumberPow(vm *VM, target, locals *Object, msg *Message) *Object

NumberPow is a Number method.

pow returns the target raised to the power of the argument. The ** operator is equivalent.

func NumberRepeat

func NumberRepeat(vm *VM, target, locals *Object, msg *Message) (result *Object)

NumberRepeat is a Number method.

repeat performs a loop the given number of times.

func NumberRound

func NumberRound(vm *VM, target, locals *Object, msg *Message) *Object

NumberRound is a Number method.

round returns the integer nearest the target, with halfway cases rounding away from zero.

func NumberRoundDown

func NumberRoundDown(vm *VM, target, locals *Object, msg *Message) *Object

NumberRoundDown is a Number method.

roundDown returns the integer nearest the target, with halfway cases rounding toward positive infinity.

func NumberShiftLeft

func NumberShiftLeft(vm *VM, target, locals *Object, msg *Message) *Object

NumberShiftLeft is a Number method.

shiftLeft returns the target as a 64-bit integer shifted left by the argument as a 64-bit unsigned integer.

func NumberShiftRight

func NumberShiftRight(vm *VM, target, locals *Object, msg *Message) *Object

NumberShiftRight is a Number method.

shiftRight returns the target as a 64-bit integer shifted right by the argument as a 64-bit unsigned integer.

func NumberSin

func NumberSin(vm *VM, target, locals *Object, msg *Message) *Object

NumberSin is a Number method.

sin returns the sine of the target.

func NumberSqrt

func NumberSqrt(vm *VM, target, locals *Object, msg *Message) *Object

NumberSqrt is a Number method.

sqrt returns the square root of the target.

func NumberSquared

func NumberSquared(vm *VM, target, locals *Object, msg *Message) *Object

NumberSquared is a Number method.

squared returns the target raised to the second power.

func NumberSub

func NumberSub(vm *VM, target, locals *Object, msg *Message) *Object

NumberSub is a Number method.

- is an operator which subtracts the right value from the left.

func NumberTan

func NumberTan(vm *VM, target, locals *Object, msg *Message) *Object

NumberTan is a Number method.

tan returns the tangent of the target.

func NumberToBase

func NumberToBase(vm *VM, target, locals *Object, msg *Message) *Object

NumberToBase is a Number method.

toBase returns the string representation of the target in the radix given in the argument. Bases less than 2 and greater than 36 are not supported.

func NumberToBaseWholeBytes

func NumberToBaseWholeBytes(vm *VM, target, locals *Object, msg *Message) *Object

NumberToBaseWholeBytes is a Number method.

toBaseWholeBytes returns the string representation of the target in the radix given in the argument, zero-padded on the left to a multiple of the equivalent of eight bits. Bases less than 2 and greater than 36 are not supported.

func NumberToggle

func NumberToggle(vm *VM, target, locals *Object, msg *Message) *Object

NumberToggle is a Number method.

toggle returns 1 if the target is 0, otherwise 0.

func ObjectAncestorWithSlot

func ObjectAncestorWithSlot(vm *VM, target, locals *Object, msg *Message) *Object

ObjectAncestorWithSlot is an Object method.

ancestorWithSlot returns the proto which owns the given slot.

func ObjectAppendProto

func ObjectAppendProto(vm *VM, target, locals *Object, msg *Message) *Object

ObjectAppendProto is an Object method.

appendProto adds an object as a proto to the object.

func ObjectAsGoRepr

func ObjectAsGoRepr(vm *VM, target, locals *Object, msg *Message) *Object

ObjectAsGoRepr is an Object method.

asGoRepr returns a string containing a Go-syntax representation of the object's value.

func ObjectAsString

func ObjectAsString(vm *VM, target, locals *Object, msg *Message) *Object

ObjectAsString is an Object method.

asString creates a string representation of an object.

func ObjectBlock

func ObjectBlock(vm *VM, target, locals *Object, msg *Message) *Object

ObjectBlock is an Object method.

block creates a block of messages. Argument names are supplied first, and the block's code is the last argument. For example, to create and call a block which adds 1 to its argument:

io> succ := block(x, x + 1)
block(x, x +(1))
io> succ call(3)
4

func ObjectBreak

func ObjectBreak(vm *VM, target, locals *Object, msg *Message) *Object

ObjectBreak is an Object method.

break ceases execution of a loop and returns a value from it.

func ObjectClone

func ObjectClone(vm *VM, target, locals *Object, msg *Message) *Object

ObjectClone is an Object method.

clone creates a new object with empty slots and the cloned object as its proto.

func ObjectCloneWithoutInit

func ObjectCloneWithoutInit(vm *VM, target, locals *Object, msg *Message) *Object

ObjectCloneWithoutInit is an Object method.

cloneWithoutInit creates a new object with empty slots and the cloned object as its proto, without checking for an init slot.

func ObjectCompare

func ObjectCompare(vm *VM, target, locals *Object, msg *Message) *Object

ObjectCompare is an Object method.

compare returns -1 if the receiver is less than the argument, 1 if it is greater, or 0 if they are equal. The default order is the order of the numeric values of the objects' addresses.

func ObjectContextWithSlot

func ObjectContextWithSlot(vm *VM, target, locals *Object, msg *Message) *Object

ObjectContextWithSlot is an Object method.

contextWithSlot returns the first of the receiver or its protos which contains the given slot.

func ObjectContinue

func ObjectContinue(vm *VM, target, locals *Object, msg *Message) *Object

ObjectContinue is an Object method.

continue immediately returns to the beginning of the current loop.

func ObjectDo

func ObjectDo(vm *VM, target, locals *Object, msg *Message) *Object

ObjectDo is an Object method.

do evaluates its message in the context of the receiver.

func ObjectDoFile

func ObjectDoFile(vm *VM, target, locals *Object, msg *Message) *Object

ObjectDoFile is an Object method.

doFile executes the file at the given path in the context of the receiver.

func ObjectDoMessage

func ObjectDoMessage(vm *VM, target, locals *Object, msg *Message) *Object

ObjectDoMessage is an Object method.

doMessage sends the message to the receiver.

func ObjectDoString

func ObjectDoString(vm *VM, target, locals *Object, msg *Message) *Object

ObjectDoString is an Object method.

doString executes the string in the context of the receiver.

func ObjectEqual

func ObjectEqual(vm *VM, target, locals *Object, msg *Message) *Object

ObjectEqual is an Object method.

x ==(y) returns true if the result of x compare(y) is 0.

func ObjectEvalArg

func ObjectEvalArg(vm *VM, target, locals *Object, msg *Message) *Object

ObjectEvalArg is an Object method.

evalArg evaluates and returns its argument. It is typically invoked via the empty string slot, i.e. parentheses with no preceding message.

func ObjectEvalArgAndReturnNil

func ObjectEvalArgAndReturnNil(vm *VM, target, locals *Object, msg *Message) *Object

ObjectEvalArgAndReturnNil is an Object method.

evalArgAndReturnNil evaluates its argument and returns nil.

func ObjectEvalArgAndReturnSelf

func ObjectEvalArgAndReturnSelf(vm *VM, target, locals *Object, msg *Message) *Object

ObjectEvalArgAndReturnSelf is an Object method.

evalArgAndReturnSelf evaluates its argument and returns this object.

func ObjectFor

func ObjectFor(vm *VM, target, locals *Object, msg *Message) (result *Object)

ObjectFor is an Object method.

for performs a loop with a counter. For example, to print each number from 1 to 3 inclusive:

io> for(x, 1, 3, x println)

Or, to print each third number from 10 to 25:

io> for(x, 10, 25, 3, x println)

func ObjectForeachSlot

func ObjectForeachSlot(vm *VM, target, locals *Object, msg *Message) (result *Object)

ObjectForeachSlot is a Object method.

foreachSlot performs a loop on each slot of an object.

func ObjectGetLocalSlot

func ObjectGetLocalSlot(vm *VM, target, locals *Object, msg *Message) *Object

ObjectGetLocalSlot is an Object method.

getLocalSlot gets the value of a slot on the receiver, not checking its protos. The slot is not activated.

func ObjectGetSlot

func ObjectGetSlot(vm *VM, target, locals *Object, msg *Message) *Object

ObjectGetSlot is an Object method.

getSlot gets the value of a slot. The slot is never activated.

func ObjectGreater

func ObjectGreater(vm *VM, target, locals *Object, msg *Message) *Object

ObjectGreater is an Object method.

x >(y) returns true if the result of x compare(y) is 1.

func ObjectGreaterOrEqual

func ObjectGreaterOrEqual(vm *VM, target, locals *Object, msg *Message) *Object

ObjectGreaterOrEqual is an Object method.

x >=(y) returns true if the result of x compare(y) is not -1.

func ObjectHasLocalSlot

func ObjectHasLocalSlot(vm *VM, target, locals *Object, msg *Message) *Object

ObjectHasLocalSlot is an Object method.

hasLocalSlot returns whether the object has the given slot name, not checking its protos.

func ObjectIf

func ObjectIf(vm *VM, target, locals *Object, msg *Message) *Object

ObjectIf is an Object method.

if evaluates its first argument, then evaluates the second if the first was true or the third if it was false.

func ObjectIsIdenticalTo

func ObjectIsIdenticalTo(vm *VM, target, locals *Object, msg *Message) *Object

ObjectIsIdenticalTo is an Object method.

isIdenticalTo returns whether the object is the same as the argument.

func ObjectIsKindOf

func ObjectIsKindOf(vm *VM, target, locals *Object, msg *Message) *Object

ObjectIsKindOf is an Object method.

isKindOf returns whether the object is the argument or has the argument among its protos.

func ObjectLess

func ObjectLess(vm *VM, target, locals *Object, msg *Message) *Object

ObjectLess is an Object method.

x <(y) returns true if the result of x compare(y) is -1.

func ObjectLessOrEqual

func ObjectLessOrEqual(vm *VM, target, locals *Object, msg *Message) *Object

ObjectLessOrEqual is an Object method.

x <=(y) returns true if the result of x compare(y) is not 1.

func ObjectLexicalDo

func ObjectLexicalDo(vm *VM, target, locals *Object, msg *Message) *Object

ObjectLexicalDo is an Object method.

lexicalDo appends the lexical context to the receiver's protos, evaluates the message in the context of the receiver, then removes the added proto.

func ObjectLoop

func ObjectLoop(vm *VM, target, locals *Object, msg *Message) *Object

ObjectLoop is an Object method.

loop performs a loop.

func ObjectMessage

func ObjectMessage(vm *VM, target, locals *Object, msg *Message) *Object

ObjectMessage is an Object method.

message returns the argument message.

func ObjectMethod

func ObjectMethod(vm *VM, target, locals *Object, msg *Message) *Object

ObjectMethod is an Object method, which is less redundant than it sounds.

method creates a block of messages referring to the method antecedent. Argument names are supplied first, and the method's code is the last argument. For example, to create and call a method on numbers which return the number 1 higher:

io> Number succ := Number method(+ 1)
method(+(1))
io> 3 succ
4

func ObjectNotEqual

func ObjectNotEqual(vm *VM, target, locals *Object, msg *Message) *Object

ObjectNotEqual is an Object method.

x !=(y) returns true if the result of x compare(y) is not 0.

func ObjectPerform

func ObjectPerform(vm *VM, target, locals *Object, msg *Message) *Object

ObjectPerform is an Object method.

perform executes the method named by the first argument using the remaining argument messages as arguments to the method.

func ObjectPerformWithArgList

func ObjectPerformWithArgList(vm *VM, target, locals *Object, msg *Message) *Object

ObjectPerformWithArgList is an Object method.

performWithArgList activates the given method with arguments given in the second argument as a list.

func ObjectPrependProto

func ObjectPrependProto(vm *VM, target, locals *Object, msg *Message) *Object

ObjectPrependProto is an Object method.

prependProto adds a new proto as the first in the object's protos.

func ObjectPrint

func ObjectPrint(vm *VM, target, locals *Object, msg *Message) *Object

ObjectPrint is an Object method.

print converts the receiver to a string and prints it.

func ObjectProtos

func ObjectProtos(vm *VM, target, locals *Object, msg *Message) *Object

ObjectProtos is an Object method.

protos returns a list of the receiver's protos.

func ObjectRemoveAllProtos

func ObjectRemoveAllProtos(vm *VM, target, locals *Object, msg *Message) *Object

ObjectRemoveAllProtos is an Object method.

removeAllProtos removes all protos from the object.

func ObjectRemoveAllSlots

func ObjectRemoveAllSlots(vm *VM, target, locals *Object, msg *Message) *Object

ObjectRemoveAllSlots is an Object method.

removeAllSlots removes all slots from the object.

func ObjectRemoveProto

func ObjectRemoveProto(vm *VM, target, locals *Object, msg *Message) *Object

ObjectRemoveProto is an Object method.

removeProto removes the given object from the object's protos.

func ObjectRemoveSlot

func ObjectRemoveSlot(vm *VM, target, locals *Object, msg *Message) *Object

ObjectRemoveSlot is an Object method.

removeSlot removes the given slot from the object.

func ObjectReturn

func ObjectReturn(vm *VM, target, locals *Object, msg *Message) *Object

ObjectReturn is an Object method.

return ceases execution of a block and returns a value from it.

func ObjectSetProto

func ObjectSetProto(vm *VM, target, locals *Object, msg *Message) *Object

ObjectSetProto is an Object method.

setProto sets the object's proto list to have only the given object.

func ObjectSetProtos

func ObjectSetProtos(vm *VM, target, locals *Object, msg *Message) *Object

ObjectSetProtos is an Object method.

setProtos sets the object's protos to the objects in the given list.

func ObjectSetSlot

func ObjectSetSlot(vm *VM, target, locals *Object, msg *Message) *Object

ObjectSetSlot is an Object method.

setSlot sets the value of a slot on this object. It is typically invoked via the := operator.

func ObjectShallowCopy

func ObjectShallowCopy(vm *VM, target, locals *Object, msg *Message) *Object

ObjectShallowCopy is an Object method.

shallowCopy creates a new object with the receiver's slots and protos.

func ObjectSlotNames

func ObjectSlotNames(vm *VM, target, locals *Object, msg *Message) *Object

ObjectSlotNames is an Object method.

slotNames returns a list of the names of the slots on this object.

func ObjectSlotValues

func ObjectSlotValues(vm *VM, target, locals *Object, msg *Message) *Object

ObjectSlotValues is an Object method.

slotValues returns a list of the values of the slots on this obect.

func ObjectStopStatus

func ObjectStopStatus(vm *VM, target, locals *Object, msg *Message) *Object

ObjectStopStatus is an Object method.

stopStatus returns the object associated with the control flow status returned when evaluating the argument message. Exceptions continue propagating.

func ObjectThisContext

func ObjectThisContext(vm *VM, target, locals *Object, msg *Message) *Object

ObjectThisContext is an Object method.

thisContext returns the current slot context, which is the receiver.

func ObjectThisLocalContext

func ObjectThisLocalContext(vm *VM, target, locals *Object, msg *Message) *Object

ObjectThisLocalContext is an Object method.

thisLocalContext returns the current locals object.

func ObjectThisMessage

func ObjectThisMessage(vm *VM, target, locals *Object, msg *Message) *Object

ObjectThisMessage is an Object method.

thisMessage returns the message which activated this method, which is likely to be thisMessage.

func ObjectTry

func ObjectTry(vm *VM, target, locals *Object, msg *Message) *Object

ObjectTry is an Object method.

try executes its message, returning any exception that occurs or nil if none does. Any other control flow (continue, break, return) is passed normally.

func ObjectUniqueID

func ObjectUniqueID(vm *VM, target, locals *Object, msg *Message) *Object

ObjectUniqueID is an Object method.

uniqueId returns a string representation of the object's address.

func ObjectUpdateSlot

func ObjectUpdateSlot(vm *VM, target, locals *Object, msg *Message) *Object

ObjectUpdateSlot is an Object method.

updateSlot raises an exception if the target does not have the given slot, and otherwise sets the value of a slot on this object. This is typically invoked via the = operator.

func ObjectWait

func ObjectWait(vm *VM, target, locals *Object, msg *Message) *Object

ObjectWait is an Object method.

wait pauses execution in the current coroutine for the given number of seconds. The coroutine must be re-scheduled after waking up, which can result in the actual wait time being longer by an unpredictable amount.

func ObjectWhile

func ObjectWhile(vm *VM, target, locals *Object, msg *Message) *Object

ObjectWhile is an Object method.

while performs a loop as long as a condition, its first argument, evaluates to true.

func SchedulerAwaitingCoros

func SchedulerAwaitingCoros(vm *VM, target, locals *Object, msg *Message) *Object

SchedulerAwaitingCoros is a Scheduler method.

awaitingCoros returns a list of all coroutines which are waiting on another coroutine.

func SchedulerCoroCount

func SchedulerCoroCount(vm *VM, target, locals *Object, msg *Message) *Object

SchedulerCoroCount is a Scheduler method.

coroCount returns the number of active coroutines other than the current one. This is more efficient than using Scheduler yieldingCoros size.

func SchedulerYieldingCoros

func SchedulerYieldingCoros(vm *VM, target, locals *Object, msg *Message) *Object

SchedulerYieldingCoros is a Scheduler method.

yieldingCoros returns a list of all running coroutines except the current one.

func SequenceAbs

func SequenceAbs(vm *VM, target, locals *Object, msg *Message) *Object

SequenceAbs is a Sequence method.

abs sets each element of the receiver to its absolute value.

func SequenceAcos

func SequenceAcos(vm *VM, target, locals *Object, msg *Message) *Object

SequenceAcos is a Sequence method.

acos sets each element of the receiver to its arc-cosine.

func SequenceAfterSeq

func SequenceAfterSeq(vm *VM, target, locals *Object, msg *Message) *Object

SequenceAfterSeq is a Sequence method.

afterSeq returns the portion of the sequence which follows the first instance of the argument sequence.

func SequenceAppend

func SequenceAppend(vm *VM, target, locals *Object, msg *Message) *Object

SequenceAppend is a Sequence method.

append adds numbers to the sequence.

func SequenceAppendPathSeq

func SequenceAppendPathSeq(vm *VM, target, locals *Object, msg *Message) *Object

SequenceAppendPathSeq is a Sequence method.

appendPathSeq appends a path element to the sequence, removing extra path separators between.

func SequenceAppendSeq

func SequenceAppendSeq(vm *VM, target, locals *Object, msg *Message) *Object

SequenceAppendSeq is a Sequence method.

appendSeq appends the contents of the given sequence to the receiver. If the receiver's item size is smaller than that of the argument, then the receiver is converted to the argument's item type; otherwise, the argument's values are converted to the receiver's item type as they are appended.

func SequenceAsBase64

func SequenceAsBase64(vm *VM, target, locals *Object, msg *Message) *Object

SequenceAsBase64 is a Sequence method.

asBase64 creates a base-64 representation of the bit data of the sequence, in accordance with RFC 4648.

func SequenceAsBinaryNumber

func SequenceAsBinaryNumber(vm *VM, target, locals *Object, msg *Message) *Object

SequenceAsBinaryNumber is a Sequence method.

asBinaryNumber reinterprets the first eight bytes of the sequence as an IEEE-754 binary64 floating-point value and returns the appropriate Number.

func SequenceAsBinarySignedInteger

func SequenceAsBinarySignedInteger(vm *VM, target, locals *Object, msg *Message) *Object

SequenceAsBinarySignedInteger is a Sequence method.

asBinarySignedInteger reinterprets the bytes of the sequence as a signed integer. The byte size of the sequence must be 1, 2, 4, or 8.

func SequenceAsBinaryUnsignedInteger

func SequenceAsBinaryUnsignedInteger(vm *VM, target, locals *Object, msg *Message) *Object

SequenceAsBinaryUnsignedInteger is a Sequence method.

asBinaryUnsignedInteger reinterprets the bytes of the sequence as an unsigned integer. The byte size of the sequence must be 1, 2, 4, or 8.

func SequenceAsFixedSizeType

func SequenceAsFixedSizeType(vm *VM, target, locals *Object, msg *Message) *Object

SequenceAsFixedSizeType is a Sequence method.

asFixedSizeType creates a copy of the sequence encoded in the first of UTF-8, UTF-16, or UTF-32 that will encode each rune in a single word. Number encoding is copied directly. If an erroneous encoding is encountered, the result will be numeric.

func SequenceAsIoPath

func SequenceAsIoPath(vm *VM, target, locals *Object, msg *Message) *Object

SequenceAsIoPath is a Sequence method.

asIoPath creates a sequence converting the receiver to Io's path convention.

func SequenceAsJSON

func SequenceAsJSON(vm *VM, target, locals *Object, msg *Message) *Object

SequenceAsJSON is a Sequence method.

asJson creates a JSON representation of the sequence.

func SequenceAsLatin1

func SequenceAsLatin1(vm *VM, target, locals *Object, msg *Message) *Object

SequenceAsLatin1 is a Sequence method.

asLatin1 creates a Sequence encoding the receiver in Latin-1 (Windows-1252). Unrepresentable characters will be encoded as a byte with the value 0x1A.

func SequenceAsList

func SequenceAsList(vm *VM, target, locals *Object, msg *Message) *Object

SequenceAsList is a Sequence method.

asList creates a list containing each element of the sequence.

func SequenceAsMessage

func SequenceAsMessage(vm *VM, target, locals *Object, msg *Message) *Object

SequenceAsMessage is a Sequence method.

asMessage compiles the sequence to a Message.

func SequenceAsMutable

func SequenceAsMutable(vm *VM, target, locals *Object, msg *Message) *Object

SequenceAsMutable is a Sequence method.

asMutable creates a mutable copy of the sequence.

func SequenceAsNumber

func SequenceAsNumber(vm *VM, target, locals *Object, msg *Message) *Object

SequenceAsNumber is a Sequence method.

asNumber parses the sequence as a numeric representation.

func SequenceAsOSPath

func SequenceAsOSPath(vm *VM, target, locals *Object, msg *Message) *Object

SequenceAsOSPath is a Sequence method.

asOSPath creates a sequence converting the receiver to the host operating system's path convention.

func SequenceAsStruct

func SequenceAsStruct(vm *VM, target, locals *Object, msg *Message) *Object

SequenceAsStruct is a Sequence method.

asStruct reinterprets a sequence as a packed binary structure described by the argument list, with list elements alternating between types and slot names.

func SequenceAsSymbol

func SequenceAsSymbol(vm *VM, target, locals *Object, msg *Message) *Object

SequenceAsSymbol is a Sequence method.

asSymbol creates an immutable copy of the sequence.

func SequenceAsUTF16

func SequenceAsUTF16(vm *VM, target, locals *Object, msg *Message) *Object

SequenceAsUTF16 is a Sequence method.

asUTF16 creates a Sequence encoding the receiver in UTF-16.

func SequenceAsUTF32

func SequenceAsUTF32(vm *VM, target, locals *Object, msg *Message) *Object

SequenceAsUTF32 is a Sequence method.

asUTF32 creates a Sequence encoding the receiver in UTF-32.

func SequenceAsUTF8

func SequenceAsUTF8(vm *VM, target, locals *Object, msg *Message) *Object

SequenceAsUTF8 is a Sequence method.

asUTF8 creates a Sequence encoding the receiver in UTF-8.

func SequenceAsin

func SequenceAsin(vm *VM, target, locals *Object, msg *Message) *Object

SequenceAsin is a Sequence method.

asin sets each element of the receiver to its arcsine.

func SequenceAt

func SequenceAt(vm *VM, target, locals *Object, msg *Message) *Object

SequenceAt is a Sequence method.

at returns a value of the sequence as a number.

func SequenceAtInsertSeq

func SequenceAtInsertSeq(vm *VM, target, locals *Object, msg *Message) *Object

SequenceAtInsertSeq is a Sequence method.

atInsertSeq inserts at the index given in the first argument the object asString in the second.

func SequenceAtPut

func SequenceAtPut(vm *VM, target, locals *Object, msg *Message) *Object

SequenceAtPut is a Sequence method.

atPut replaces the element at the given position with the given value, growing the sequence if necessary.

func SequenceAtan

func SequenceAtan(vm *VM, target, locals *Object, msg *Message) *Object

SequenceAtan is a Sequence method.

atan sets each element of the receiver to its arctangent.

func SequenceBeforeSeq

func SequenceBeforeSeq(vm *VM, target, locals *Object, msg *Message) *Object

SequenceBeforeSeq is a Sequence method.

beforeSeq returns the portion of the sequence which precedes the first instance of the argument sequence.

func SequenceBeginsWithSeq

func SequenceBeginsWithSeq(vm *VM, target, locals *Object, msg *Message) *Object

SequenceBeginsWithSeq is a Sequence method.

beginsWithSeq determines whether the sequence begins with the argument sequence in the bytewise sense.

func SequenceBetween

func SequenceBetween(vm *VM, target, locals *Object, msg *Message) *Object

SequenceBetween is a Sequence method.

between returns the portion of the sequence between the first occurrence of the first argument sequence and the first following occurrence of the second.

func SequenceBitAt

func SequenceBitAt(vm *VM, target, locals *Object, msg *Message) *Object

SequenceBitAt is a Sequence method.

bitAt returns the value of the selected bit within the sequence, 0 or 1. If the index is out of bounds, the result is always 0.

func SequenceBitCount

func SequenceBitCount(vm *VM, target, locals *Object, msg *Message) *Object

SequenceBitCount is a Sequence method.

bitCount returns the number of 1 bits in the sequence.

func SequenceBitwiseAnd

func SequenceBitwiseAnd(vm *VM, target, locals *Object, msg *Message) *Object

SequenceBitwiseAnd is a Sequence method.

bitwiseAnd sets the receiver to the bitwise AND of its binary representation and that of the argument sequence.

func SequenceBitwiseNot

func SequenceBitwiseNot(vm *VM, target, locals *Object, msg *Message) *Object

SequenceBitwiseNot is a Sequence method.

bitwiseNot sets the receiver to the bitwise NOT of its binary representation.

func SequenceBitwiseOr

func SequenceBitwiseOr(vm *VM, target, locals *Object, msg *Message) *Object

SequenceBitwiseOr is a Sequence method.

bitwiseOr sets the receiver to the bitwise OR of its binary representation and that of the argument sequence.

func SequenceBitwiseXor

func SequenceBitwiseXor(vm *VM, target, locals *Object, msg *Message) *Object

SequenceBitwiseXor is a Sequence method.

bitwiseXor sets the receiver to the bitwise XOR of its binary representation and that of the argument sequence.

func SequenceByteAt

func SequenceByteAt(vm *VM, target, locals *Object, msg *Message) *Object

SequenceByteAt is a Sequence method.

byteAt returns the value of the selected byte of the sequence's underlying representation, 0 to 255. If the index is out of bounds, the result is 0.

func SequenceCapitalize

func SequenceCapitalize(vm *VM, target, locals *Object, msg *Message) *Object

SequenceCapitalize is a Sequence method.

capitalize replaces the first rune in the sequence with the capitalized equivalent. This does not use special (Turkish) casing.

func SequenceCeil

func SequenceCeil(vm *VM, target, locals *Object, msg *Message) *Object

SequenceCeil is a Sequence method.

ceil sets each element of the receiver to the smallest integer greater than its current value. No-op on integer sequences.

func SequenceClipAfterSeq

func SequenceClipAfterSeq(vm *VM, target, locals *Object, msg *Message) *Object

SequenceClipAfterSeq is a Sequence method.

clipAfterSeq removes the portion of the sequence which follows the end of the argument sequence.

func SequenceClipAfterStartOfSeq

func SequenceClipAfterStartOfSeq(vm *VM, target, locals *Object, msg *Message) *Object

SequenceClipAfterStartOfSeq is a Sequence method.

clipAfterStartOfSeq removes the portion of the sequence which follows the beginning of the argument sequence.

func SequenceClipBeforeEndOfSeq

func SequenceClipBeforeEndOfSeq(vm *VM, target, locals *Object, msg *Message) *Object

SequenceClipBeforeEndOfSeq is a Sequence method.

clipBeforeEndOfSeq removes the portion of the sequence which precedes the end of the argument sequence.

func SequenceClipBeforeSeq

func SequenceClipBeforeSeq(vm *VM, target, locals *Object, msg *Message) *Object

SequenceClipBeforeSeq is a Sequence method.

clipBeforeSeq removes the portion of the sequence which precedes the beginning of the argument sequence.

func SequenceCloneAppendPath

func SequenceCloneAppendPath(vm *VM, target, locals *Object, msg *Message) *Object

SequenceCloneAppendPath is a Sequence method.

cloneAppendPath creates a new Symbol with the receiver's contents and the argument sequence's contents appended with redundant path separators between them removed.

func SequenceCloneAppendSeq

func SequenceCloneAppendSeq(vm *VM, target, locals *Object, msg *Message) *Object

SequenceCloneAppendSeq is a Sequence method.

cloneAppendSeq creates a new symbol with the elements of the argument appended to those of the receiver.

func SequenceCompare

func SequenceCompare(vm *VM, target, locals *Object, msg *Message) *Object

SequenceCompare is a Sequence method.

compare returns -1 if the receiver is less than the argument, 1 if it is greater, or 0 if they are equal.

func SequenceContains

func SequenceContains(vm *VM, target, locals *Object, msg *Message) *Object

SequenceContains is a Sequence method.

contains returns true if any element of the sequence is equal to the given Number.

func SequenceContainsSeq

func SequenceContainsSeq(vm *VM, target, locals *Object, msg *Message) *Object

SequenceContainsSeq is a Sequence method.

containsSeq returns true if the receiver contains the argument sequence.

func SequenceConvertToFixedSizeType

func SequenceConvertToFixedSizeType(vm *VM, target, locals *Object, msg *Message) *Object

SequenceConvertToFixedSizeType is a Sequence method.

convertToFixedSizeType converts the sequence to be encoded in the first of UTF-8, Latin-1, UTF-16, or UTF-32 that will encode each rune in a single word. Number encoding is unchanged. If an erroneous code sequence is encountered, the result will be numeric.

func SequenceConvertToItemType

func SequenceConvertToItemType(vm *VM, target, locals *Object, msg *Message) *Object

SequenceConvertToItemType is a Sequence method.

convertToItemType changes the item type of the sequence.

func SequenceCopy

func SequenceCopy(vm *VM, target, locals *Object, msg *Message) *Object

SequenceCopy is a Sequence method.

copy sets the receiver to be a copy of the given sequence.

func SequenceCos

func SequenceCos(vm *VM, target, locals *Object, msg *Message) *Object

SequenceCos is a Sequence method.

cos sets each element of the receiver to its cosine.

func SequenceCosh

func SequenceCosh(vm *VM, target, locals *Object, msg *Message) *Object

SequenceCosh is a Sequence method.

cosh sets each element of the receiver to its hyperbolic cosine.

func SequenceDistanceTo

func SequenceDistanceTo(vm *VM, target, locals *Object, msg *Message) *Object

SequenceDistanceTo is a Sequence method.

distanceTo computes the L2-norm of the vector pointing between the receiver and the argument sequence. Both sequences must be of the same floating-point type and of equal size; otherwise, the result will be 0.

func SequenceDotProduct

func SequenceDotProduct(vm *VM, target, locals *Object, msg *Message) *Object

SequenceDotProduct is a Sequence method.

dotProduct computes the sum of pairwise products between the receiver and argument sequence, up to the length of the shorter of the two.

func SequenceDuplicateIndexes

func SequenceDuplicateIndexes(vm *VM, target, locals *Object, msg *Message) *Object

SequenceDuplicateIndexes is a Sequence method.

duplicateIndexes inserts a copy of each item in the sequence after its position.

func SequenceEmpty

func SequenceEmpty(vm *VM, target, locals *Object, msg *Message) *Object

SequenceEmpty is a Sequence method.

empty zeroes all values in the sequence and sets its length to zero.

func SequenceEncoding

func SequenceEncoding(vm *VM, target, locals *Object, msg *Message) *Object

SequenceEncoding is a Sequence method.

encoding returns the sequence's encoding.

func SequenceEndsWithSeq

func SequenceEndsWithSeq(vm *VM, target, locals *Object, msg *Message) *Object

SequenceEndsWithSeq is a Sequence method.

endsWithSeq determines whether the sequence ends with the argument sequence in the bytewise sense.

func SequenceEscape

func SequenceEscape(vm *VM, target, locals *Object, msg *Message) *Object

SequenceEscape is a Sequence method.

escape replaces control and non-printable characters with backslash-escaped equivalents.

func SequenceExSlice

func SequenceExSlice(vm *VM, target, locals *Object, msg *Message) *Object

SequenceExSlice is a Sequence method.

exSlice creates a copy from the first argument index, inclusive, to the second argument index, exclusive, or to the end if the second is not given.

func SequenceFindSeq

func SequenceFindSeq(vm *VM, target, locals *Object, msg *Message) *Object

SequenceFindSeq is a Sequence method.

findSeq locates the first occurrence of the argument sequence in the receiver, optionally following a given start index.

func SequenceFindSeqs

func SequenceFindSeqs(vm *VM, target, locals *Object, msg *Message) *Object

SequenceFindSeqs is a Sequence method.

findSeqs finds the first occurrence of any sequence in the argument List and returns an object with its "match" slot set to the sequence which matched and its "index" slot set to the index of the match.

func SequenceFloor

func SequenceFloor(vm *VM, target, locals *Object, msg *Message) *Object

SequenceFloor is a Sequence method.

floor sets each element of the receiver to the largest integer less than its current value. No-op on integer sequences.

func SequenceForeach

func SequenceForeach(vm *VM, target, locals *Object, msg *Message) (result *Object)

SequenceForeach is a Sequence method.

foreach performs a loop for each element of the sequence.

func SequenceFromBase

func SequenceFromBase(vm *VM, target, locals *Object, msg *Message) *Object

SequenceFromBase is a Sequence method.

fromBase converts the sequence from a representation of an integer in a given radix to the Number it represents.

func SequenceFromBase64

func SequenceFromBase64(vm *VM, target, locals *Object, msg *Message) *Object

SequenceFromBase64 is a Sequence method.

fromBase64 decodes standard (RFC 4648) base64 data from the sequence interpreted bytewise.

func SequenceHash

func SequenceHash(vm *VM, target, locals *Object, msg *Message) *Object

SequenceHash is a Sequence method.

hash returns a hash of the sequence as a number.

func SequenceInSlice

func SequenceInSlice(vm *VM, target, locals *Object, msg *Message) *Object

SequenceInSlice is a Sequence method.

inSlice creates a copy from the first argument index, inclusive, to the second argument index, inclusive, or to the end if the second is not given.

func SequenceInsertSeqEvery

func SequenceInsertSeqEvery(vm *VM, target, locals *Object, msg *Message) *Object

SequenceInsertSeqEvery is a Sequence method.

insertSeqEvery inserts the argument sequence into the receiver at every nth position.

func SequenceInterpolate

func SequenceInterpolate(vm *VM, target, locals *Object, msg *Message) *Object

SequenceInterpolate is a Sequence method.

interpolate replaces "#{Io code}" in the sequence with the result of evaluating the Io code in the current context or the optionally supplied one, returning a new sequence with the result.

func SequenceIsLowercase

func SequenceIsLowercase(vm *VM, target, locals *Object, msg *Message) *Object

SequenceIsLowercase is a Sequence method.

isLowercase determines whether all characters in the string are equal to their lowercase-converted versions using Unicode standard case conversion.

func SequenceIsMutable

func SequenceIsMutable(vm *VM, target, locals *Object, msg *Message) *Object

SequenceIsMutable is a Sequence method.

isMutable returns whether the sequence is mutable.

func SequenceIsUppercase

func SequenceIsUppercase(vm *VM, target, locals *Object, msg *Message) *Object

SequenceIsUppercase is a Sequence method.

isUppercase determines whether all characters in the string are equal to their uppercase-converted versions using Unicode standard case conversion.

func SequenceIsZero

func SequenceIsZero(vm *VM, target, locals *Object, msg *Message) *Object

SequenceIsZero is a Sequence method.

isZero returns whether all elements of the sequence are zero.

func SequenceItemSize

func SequenceItemSize(vm *VM, target, locals *Object, msg *Message) *Object

SequenceItemSize is a Sequence method.

itemSize returns the size in bytes of each item in the sequence.

func SequenceItemType

func SequenceItemType(vm *VM, target, locals *Object, msg *Message) *Object

SequenceItemType is a Sequence method.

itemType returns the type of the values in the sequence.

func SequenceLastPathComponent

func SequenceLastPathComponent(vm *VM, target, locals *Object, msg *Message) *Object

SequenceLastPathComponent is a Sequence method.

lastPathComponent returns the basename of the sequence.

func SequenceLeaveThenRemove

func SequenceLeaveThenRemove(vm *VM, target, locals *Object, msg *Message) *Object

SequenceLeaveThenRemove is a Sequence method.

leaveThenRemove(m, n) keeps the first m items, removes the following n, and repeats this process on the remainder.

func SequenceLog

func SequenceLog(vm *VM, target, locals *Object, msg *Message) *Object

SequenceLog is a Sequence method.

log sets each element of the receiver to its natural logarithm.

func SequenceLog10

func SequenceLog10(vm *VM, target, locals *Object, msg *Message) *Object

SequenceLog10 is a Sequence method.

log10 sets each element of the receiver to its common logarithm.

func SequenceLowercase

func SequenceLowercase(vm *VM, target, locals *Object, msg *Message) *Object

SequenceLowercase is a Sequence method.

lowercase converts the values in the sequence to their capitalized equivalents. This does not use special (Turkish) casing.

func SequenceLstrip

func SequenceLstrip(vm *VM, target, locals *Object, msg *Message) *Object

SequenceLstrip is a Sequence method.

lstrip removes all whitespace characters from the beginning of the sequence, or all characters in the provided cut set.

func SequenceMax

func SequenceMax(vm *VM, target, locals *Object, msg *Message) *Object

SequenceMax is a Sequence method.

max returns the maximum element in the sequence.

func SequenceMean

func SequenceMean(vm *VM, target, locals *Object, msg *Message) *Object

SequenceMean is a Sequence method.

mean computes the arithmetic mean of the elements in the sequence.

func SequenceMeanSquare

func SequenceMeanSquare(vm *VM, target, locals *Object, msg *Message) *Object

SequenceMeanSquare is a Sequence method.

meanSquare computes the arithmetic mean of the squares of the elements in the sequence.

func SequenceMin

func SequenceMin(vm *VM, target, locals *Object, msg *Message) *Object

SequenceMin is a Sequence method.

min returns the minimum element in the sequence.

func SequenceMinusEq

func SequenceMinusEq(vm *VM, target, locals *Object, msg *Message) *Object

SequenceMinusEq is a Sequence method.

-= sets each element of the receiver to its value minus the respective element of the argument.

func SequenceNegate

func SequenceNegate(vm *VM, target, locals *Object, msg *Message) *Object

SequenceNegate is a Sequence method.

negate sets each element of the receiver to its opposite.

func SequenceNormalize

func SequenceNormalize(vm *VM, target, locals *Object, msg *Message) *Object

SequenceNormalize is a Sequence method.

normalize divides each element of the receiver by the sequence's L2 norm.

func SequenceOccurrencesOfSeq

func SequenceOccurrencesOfSeq(vm *VM, target, locals *Object, msg *Message) *Object

SequenceOccurrencesOfSeq is a Sequence method.

occurrencesOfSeq counts the number of non-overlapping occurrences of the given sequence in the receiver. Raises an exception if the argument is an empty sequence.

func SequencePack

func SequencePack(vm *VM, target, locals *Object, msg *Message) *Object

SequencePack is a Sequence method.

pack forms a packed binary sequence with the given format.

func SequencePairwiseMax

func SequencePairwiseMax(vm *VM, target, locals *Object, msg *Message) *Object

SequencePairwiseMax is a Sequence method.

Max sets each element of the receiver to the greater of the receiver element and the respective argument element.

func SequencePairwiseMin

func SequencePairwiseMin(vm *VM, target, locals *Object, msg *Message) *Object

SequencePairwiseMin is a Sequence method.

Min sets each element of the receiver to the lesser of the receiver element and the respective argument element.

func SequenceParseJSON

func SequenceParseJSON(vm *VM, target, locals *Object, msg *Message) *Object

SequenceParseJSON is a Sequence method.

parseJson decodes the JSON represented by the receiver.

func SequencePathComponent

func SequencePathComponent(vm *VM, target, locals *Object, msg *Message) *Object

SequencePathComponent is a Sequence method.

pathComponent returns a new Sequence with the receiver up to the last path separator. Always converts to slash paths.

func SequencePathExtension

func SequencePathExtension(vm *VM, target, locals *Object, msg *Message) *Object

SequencePathExtension is a Sequence method.

pathExtension returns a new Sequence with the receiver past the last period.

func SequencePercentDecoded

func SequencePercentDecoded(vm *VM, target, locals *Object, msg *Message) *Object

SequencePercentDecoded is a Sequence method.

percentDecoded unescapes the receiver as a URL path segment.

func SequencePercentEncoded

func SequencePercentEncoded(vm *VM, target, locals *Object, msg *Message) *Object

SequencePercentEncoded is a Sequence method.

percentEncoded escapes the receiver as a URL path segment.

func SequencePlusEq

func SequencePlusEq(vm *VM, target, locals *Object, msg *Message) *Object

SequencePlusEq is a Sequence method.

+= sets each element of the receiver to its value plus the respective element of the argument.

func SequencePreallocateToSize

func SequencePreallocateToSize(vm *VM, target, locals *Object, msg *Message) *Object

SequencePreallocateToSize is a Sequence method.

preallocateToSize ensures that the receiver can grow to be at least n bytes without reallocating.

func SequenceProduct

func SequenceProduct(vm *VM, target, locals *Object, msg *Message) *Object

SequenceProduct is a Sequence method.

product returns the product of the elements of the sequence.

func SequenceRangeFill

func SequenceRangeFill(vm *VM, target, locals *Object, msg *Message) *Object

SequenceRangeFill is a Sequence method.

rangeFill sets each element of the sequence to its index.

func SequenceRemoveAt

func SequenceRemoveAt(vm *VM, target, locals *Object, msg *Message) *Object

SequenceRemoveAt is a Sequence method.

removeAt removes the nth element from the sequence.

func SequenceRemoveEvenIndexes

func SequenceRemoveEvenIndexes(vm *VM, target, locals *Object, msg *Message) *Object

SequenceRemoveEvenIndexes is a Sequence method.

removeEvenIndexes deletes each element whose index in the sequence is even.

func SequenceRemoveLast

func SequenceRemoveLast(vm *VM, target, locals *Object, msg *Message) *Object

SequenceRemoveLast is a Sequence method.

removeLast removes the last element from the sequence and returns the receiver.

func SequenceRemoveOddIndexes

func SequenceRemoveOddIndexes(vm *VM, target, locals *Object, msg *Message) *Object

SequenceRemoveOddIndexes is a Sequence method.

removeOddIndexes deletes each element whose index in the sequence is odd.

func SequenceRemovePrefix

func SequenceRemovePrefix(vm *VM, target, locals *Object, msg *Message) *Object

SequenceRemovePrefix is a Sequence method.

removePrefix removes a prefix from the receiver, if present.

func SequenceRemoveSeq

func SequenceRemoveSeq(vm *VM, target, locals *Object, msg *Message) *Object

SequenceRemoveSeq is a Sequence method.

removeSeq removes all occurrences of a sequence from the receiver.

func SequenceRemoveSlice

func SequenceRemoveSlice(vm *VM, target, locals *Object, msg *Message) *Object

SequenceRemoveSlice is a Sequence method.

removeSlice removes items between the given start and end, inclusive.

func SequenceRemoveSuffix

func SequenceRemoveSuffix(vm *VM, target, locals *Object, msg *Message) *Object

SequenceRemoveSuffix is a Sequence method.

removeSuffix removes a suffix from the receiver, if present.

func SequenceReplaceFirstSeq

func SequenceReplaceFirstSeq(vm *VM, target, locals *Object, msg *Message) *Object

SequenceReplaceFirstSeq is a Sequence method.

replaceFirstSeq replaces the first instance of a sequence with another.

func SequenceReplaceSeq

func SequenceReplaceSeq(vm *VM, target, locals *Object, msg *Message) *Object

SequenceReplaceSeq is a Sequence method.

replaceSeq replaces all instances of a sequence with another.

func SequenceReverseFindSeq

func SequenceReverseFindSeq(vm *VM, target, locals *Object, msg *Message) *Object

SequenceReverseFindSeq is a Sequence method.

reverseFindSeq locates the last occurrence of the argument sequence in the receiver, optionally ending before a given stop index.

func SequenceReverseInPlace

func SequenceReverseInPlace(vm *VM, target, locals *Object, msg *Message) *Object

SequenceReverseInPlace is a Sequence method.

reverseInPlace reverses the elements of the sequence.

func SequenceRstrip

func SequenceRstrip(vm *VM, target, locals *Object, msg *Message) *Object

SequenceRstrip is a Sequence method.

rstrip removes all whitespace characters from the end of the sequence, or all characters in the provided cut set.

func SequenceSetEncoding

func SequenceSetEncoding(vm *VM, target, locals *Object, msg *Message) *Object

SequenceSetEncoding is a Sequence method.

setEncoding sets the sequence's encoding. The sequence must be mutable. The requested encoding, converted to lower case, must be in the validEncodings list.

func SequenceSetItemType

func SequenceSetItemType(vm *VM, target, locals *Object, msg *Message) *Object

SequenceSetItemType is a Sequence method.

setItemType effectively reinterprets the bit pattern of the sequence data in the given type, which may be uint8, uint16, uint32, uint64, int8, int16, int32, int64, float32, or float64.

func SequenceSetItemsToDouble

func SequenceSetItemsToDouble(vm *VM, target, locals *Object, msg *Message) *Object

SequenceSetItemsToDouble is a Sequence method.

setItemsToDouble sets all items to the given value.

func SequenceSetSize

func SequenceSetSize(vm *VM, target, locals *Object, msg *Message) *Object

SequenceSetSize is a Sequence method.

setSize sets the size of the sequence.

func SequenceSin

func SequenceSin(vm *VM, target, locals *Object, msg *Message) *Object

SequenceSin is a Sequence method.

sin sets each element of the receiver to its sine.

func SequenceSinh

func SequenceSinh(vm *VM, target, locals *Object, msg *Message) *Object

SequenceSinh is a Sequence method.

sinh sets each element of the receiver to its hyperbolic sine.

func SequenceSize

func SequenceSize(vm *VM, target, locals *Object, msg *Message) *Object

SequenceSize is a Sequence method.

size returns the number of items in the sequence.

func SequenceSlashEq

func SequenceSlashEq(vm *VM, target, locals *Object, msg *Message) *Object

SequenceSlashEq is a Sequence method.

/= sets each element of the receiver to its value divided by the respective element of the argument.

func SequenceSort

func SequenceSort(vm *VM, target, locals *Object, msg *Message) *Object

SequenceSort is a Sequence method.

sort sorts the elements of the sequence.

func SequenceSplit

func SequenceSplit(vm *VM, target, locals *Object, msg *Message) *Object

SequenceSplit is a Sequence method.

split returns a list of the portions of the sequence split at each occurrence of any of the given separators, or by whitespace if none given.

func SequenceSplitAt

func SequenceSplitAt(vm *VM, target, locals *Object, msg *Message) *Object

SequenceSplitAt is a Sequence method.

splitAt splits the sequence at the given index.

func SequenceSqrt

func SequenceSqrt(vm *VM, target, locals *Object, msg *Message) *Object

SequenceSqrt is a Sequence method.

sqrt sets each element of the receiver to its square root.

func SequenceSquare

func SequenceSquare(vm *VM, target, locals *Object, msg *Message) *Object

SequenceSquare is a Sequence method.

square sets each element of the receiver to its square.

func SequenceStarEq

func SequenceStarEq(vm *VM, target, locals *Object, msg *Message) *Object

SequenceStarEq is a Sequence method.

*= sets each element of the receiver to its value times the respective element of the argument.

func SequenceStarStarEq

func SequenceStarStarEq(vm *VM, target, locals *Object, msg *Message) *Object

SequenceStarStarEq is a Sequence method.

**= sets each element of the receiver to its value raised to the power of the respective element of the argument.

func SequenceStrip

func SequenceStrip(vm *VM, target, locals *Object, msg *Message) *Object

SequenceStrip is a Sequence method.

strip removes all whitespace characters from each end of the sequence, or all characters in the provided cut set.

func SequenceSum

func SequenceSum(vm *VM, target, locals *Object, msg *Message) *Object

SequenceSum is a Sequence method.

sum returns the sum of the elements of the sequence.

func SequenceTan

func SequenceTan(vm *VM, target, locals *Object, msg *Message) *Object

SequenceTan is a Sequence method.

tan sets each element of the receiver to its tangent.

func SequenceTanh

func SequenceTanh(vm *VM, target, locals *Object, msg *Message) *Object

SequenceTanh is a Sequence method.

tanh sets each element of the receiver to its hyperbolic tangent.

func SequenceToBase

func SequenceToBase(vm *VM, target, locals *Object, msg *Message) *Object

SequenceToBase is a Sequence method.

toBase converts the sequence from a base 10 representation of a number to a base 8 or 16 representation of the same number.

func SequenceURLDecoded

func SequenceURLDecoded(vm *VM, target, locals *Object, msg *Message) *Object

SequenceURLDecoded is a Sequence method.

urlDecoded unescapes the sequence as a URL query.

func SequenceURLEncoded

func SequenceURLEncoded(vm *VM, target, locals *Object, msg *Message) *Object

SequenceURLEncoded is a Sequence method.

urlEncoded escapes the sequence for safe use in a URL query.

func SequenceUnescape

func SequenceUnescape(vm *VM, target, locals *Object, msg *Message) *Object

SequenceUnescape is a Sequence method.

unescape interprets backslash-escaped codes in the sequence.

func SequenceUnpack

func SequenceUnpack(vm *VM, target, locals *Object, msg *Message) *Object

SequenceUnpack is a Sequence method.

unpack reads a packed binary sequence into a List.

func SequenceUppercase

func SequenceUppercase(vm *VM, target, locals *Object, msg *Message) *Object

SequenceUppercase is a Sequence method.

uppercase converts the values in the sequence to their capitalized equivalents. This does not use special (Turkish) casing.

func SequenceValidEncodings

func SequenceValidEncodings(vm *VM, target, locals *Object, msg *Message) *Object

SequenceValidEncodings is a Sequence method.

validEncodings returns a list of valid encoding names.

func SequenceWithStruct

func SequenceWithStruct(vm *VM, target, locals *Object, msg *Message) *Object

SequenceWithStruct is a Sequence method.

withStruct creates a packed binary sequence representing the values in the argument list, with list elements alternating between types and values. Note that while 64-bit types are valid, not all their values can be represented.

func SequenceZero

func SequenceZero(vm *VM, target, locals *Object, msg *Message) *Object

SequenceZero is a Sequence method.

zero sets each element of the receiver to zero.

func SystemActiveCpus

func SystemActiveCpus(vm *VM, target, locals *Object, msg *Message) *Object

SystemActiveCpus is a System method.

activeCpus returns the number of CPUs available for coroutines.

func SystemExit

func SystemExit(vm *VM, target, locals *Object, msg *Message) *Object

SystemExit is a System method.

exit exits the process with an exit code which defaults to 0.

func SystemGetEnvironmentVariable

func SystemGetEnvironmentVariable(vm *VM, target, locals *Object, msg *Message) *Object

SystemGetEnvironmentVariable is a System method.

getEnvironmentVariable returns the value of the environment variable with the given name, or nil if it does not exist.

func SystemSetEnvironmentVariable

func SystemSetEnvironmentVariable(vm *VM, target, locals *Object, msg *Message) *Object

SystemSetEnvironmentVariable is a System method.

setEnvironmentVariable sets the value of an environment variable.

func SystemSetLobby

func SystemSetLobby(vm *VM, target, locals *Object, msg *Message) *Object

SystemSetLobby is a System method.

setLobby changes the Lobby. This had garbage collection implications in the original Io, but is mostly irrelevant in this implementation due to use of Go's GC.

func SystemThisProcessPid

func SystemThisProcessPid(vm *VM, target, locals *Object, msg *Message) *Object

SystemThisProcessPid is a System method.

thisProcessPid returns the pid of this process.

func (*Object) Activate

func (o *Object) Activate(vm *VM, target, locals, context *Object, msg *Message) *Object

Activate activates the object.

func (*Object) AppendProto

func (o *Object) AppendProto(proto *Object)

AppendProto appends a proto to the end of the object's protos list.

func (*Object) Clone

func (o *Object) Clone() *Object

Clone returns a new object with empty slots and this object as its only proto. The clone's tag is the same as its parent's, and its primitive value is produced by the tag's CloneValue method. Returns nil if the object's tag is nil.

func (*Object) ForeachProto

func (o *Object) ForeachProto(exec func(p *Object) bool)

ForeachProto calls exec on each of the object's protos. exec must not modify o's protos list. If exec returns false, then the iteration ceases.

func (*Object) IsKindOf

func (o *Object) IsKindOf(kind *Object) bool

IsKindOf evaluates whether the object has kind as any of its ancestors, or is itself kind.

func (*Object) PrependProto

func (o *Object) PrependProto(proto *Object)

PrependProto prepends a proto to the front of the object's protos list.

func (*Object) Protos

func (o *Object) Protos() []*Object

Protos returns a snapshot of the object's protos. The result is nil if o has no protos. This is more efficient than using ForeachProto to construct a slice.

func (*Object) RemoveProto

func (o *Object) RemoveProto(proto *Object)

RemoveProto removes all instances of a proto from the object's protos list. Comparison is done by identity only.

func (*Object) SetProtos

func (o *Object) SetProtos(protos ...*Object)

SetProtos sets the object's protos to those given.

func (*Object) Tag

func (o *Object) Tag() Tag

Tag returns the object's type indicator.

func (*Object) UniqueID

func (o *Object) UniqueID() uintptr

UniqueID returns the object's unique ID.

type RemoteStop

type RemoteStop struct {
	Result  *Object
	Control Stop
}

RemoteStop is a wrapped object and control flow status for sending to coros.

type Scheduler

type Scheduler struct {

	// Main is the first coroutine in the VM, instantiated with NewVM().
	Main *VM
	// Alive is a channel that closes once all coroutines stop.
	Alive <-chan bool
	// contains filtered or unexported fields
}

Scheduler helps manage a group of Io coroutines.

func (*Scheduler) Await

func (s *Scheduler) Await(a, b *VM)

Await tells the scheduler that one coroutine is waiting on another.

func (*Scheduler) Exit

func (s *Scheduler) Exit(code int)

Exit tells the scheduler to exit, stopping all its coroutines as soon as possible. Main's ExitStatus will be updated to code if this is the first call to Exit.

func (*Scheduler) Finish

func (s *Scheduler) Finish(coro *VM)

Finish tells the scheduler that a coroutine has finished execution.

func (*Scheduler) Pause

func (s *Scheduler) Pause(coro *VM)

Pause tells the scheduler that a coroutine is pausing.

func (*Scheduler) Start

func (s *Scheduler) Start(coro *VM)

Start asks the scheduler to start a coroutine.

type SeqKind

type SeqKind struct {
	// contains filtered or unexported fields
}

SeqKind represents a sequence data type.

func (SeqKind) Encoding

func (kind SeqKind) Encoding() string

Encoding returns the suggested default encoding for the sequence kind. This is utf8 for uint8 kinds, utf16 for uint16, utf32 for int32, and number for all other kinds.

func (SeqKind) ItemSize

func (kind SeqKind) ItemSize() int

ItemSize returns the number of bytes required to represent one element of the type represented by the SeqKind.

type Sequence

type Sequence struct {
	Value   interface{}
	Mutable bool
	Code    string // encoding
}

A Sequence is a collection of data of one fixed-size type.

func EncodeString

func EncodeString(sv string, encoding string, kind SeqKind) Sequence

EncodeString creates a new Sequence value encoding sv using the given encoding and sequence element type. If the encoding is number, the sequence will be each rune of sv converted to the sequence's type; otherwise, the value will read the packed binary representation of the encoded string. Any unrepresentable runes are converted to replacements. The returned sequence is marked mutable, but it may be set to immutable before first use.

func (Sequence) Append

func (s Sequence) Append(other Sequence) Sequence

Append appends other's items to this sequence. If other has a larger item size than this sequence, then the result is converted to the item type of other. Callers should hold the sequence object's lock. Panics if this sequence is not mutable.

func (Sequence) At

func (s Sequence) At(i int) (float64, bool)

At returns the value of an item in the sequence as a float64. If the index is out of bounds, the second return value is false. Callers should hold the sequence object's lock if the sequence is mutable.

func (Sequence) Bytes

func (s Sequence) Bytes() []byte

Bytes returns a slice of bytes with the same bit pattern as the sequence. The result is always a copy. If the sequence is mutable, callers should hold its object's lock.

func (Sequence) BytesN

func (s Sequence) BytesN(n int) []byte

BytesN returns a slice of up to n bytes with the same bit pattern as the corresponding portion of the sequence. The result is always a copy. If the sequence is mutable, callers should hold its object's lock.

func (Sequence) CheckMutable

func (s Sequence) CheckMutable(name string) error

CheckMutable returns an error if the sequence is not mutable, or nil otherwise. Callers do not need to hold the object's lock, as mutability of a sequence should never change.

func (Sequence) CheckNumeric

func (s Sequence) CheckNumeric(name string, mutable bool) error

CheckNumeric checks that the sequence is numeric, optionally requiring the sequence to be mutable as well. If the sequence is mutable, callers should hold its object's lock.

func (Sequence) Compare

func (s Sequence) Compare(other Sequence) int

Compare finds the lexicographical ordering between s and other in the element-wise sense, returning -1 if s < other, 1 if s > other, and 0 if s == other. If s or other are mutable, then callers should hold their objects' locks.

func (Sequence) Convert

func (s Sequence) Convert(kind SeqKind) Sequence

Convert changes the item type of the sequence. The conversion is such that the result keeps the same number of items. If the sequence is mutable, callers should hold its object's lock.

func (Sequence) Find

func (s Sequence) Find(other Sequence, start int) int

Find locates the first instance of other in the sequence following start. Comparison is done following conversion to the type of s. If there is no match, the result is -1. If s or other are mutable, then callers should hold their objects' locks.

func (Sequence) FirstRune

func (s Sequence) FirstRune() (rune, int)

FirstRune decodes the first rune from the sequence and returns its size in bytes. If the sequence is empty, the result is (-1, 0). If the sequence is mutable, callers should hold its object's lock.

func (Sequence) FixIndex

func (s Sequence) FixIndex(i int) int

FixIndex wraps an index into the sequence's size. If the sequence is mutable, callers should hold its object's lock.

func (Sequence) Insert

func (s Sequence) Insert(other Sequence, k int) Sequence

Insert inserts the elements of another sequence, converted to this sequence's type, at a given index. If the index is beyond the length of the sequence, then zeros are inserted as needed. Callers should hold the sequence object's lock. Panics if k < 0 or if s is immutable.

func (Sequence) IsFP

func (s Sequence) IsFP() bool

IsFP returns whether the sequence has a float32 or float64 data type. If the sequence is mutable, callers should hold its object's lock.

func (Sequence) IsMutable

func (s Sequence) IsMutable() bool

IsMutable returns whether the sequence can be modified safely. Callers do not need to hold the object's lock, as mutability of a sequence should never change.

func (Sequence) ItemSize

func (s Sequence) ItemSize() int

ItemSize returns the number of bytes required to represent a single element of the sequence. If the sequence is mutable, callers should hold its object's lock.

func (Sequence) Kind

func (s Sequence) Kind() SeqKind

Kind returns the SeqKind appropriate for this sequence. If the sequence is mutable, callers should hold its object's lock.

func (Sequence) Len

func (s Sequence) Len() int

Len returns the length of the sequence. If the sequence is mutable, callers should hold its object's lock.

func (Sequence) MapBinary

func (s Sequence) MapBinary(op func(float64, float64) float64, t Sequence, def float64)

MapBinary replaces each value of the sequence with the result of applying op with the respective value of t, or with the given default value if past the end of t. Values are converted to float64 and back to the appropriate type. Callers should hold s's object's lock, and if t is mutable, then also t's.

func (Sequence) MapUnary

func (s Sequence) MapUnary(op func(float64) float64)

MapUnary replaces each value of the sequence with the result of applying op. Values are converted to float64 and back to the appropriate type. Callers should hold the sequence object's lock.

func (Sequence) MinCode

func (s Sequence) MinCode() string

MinCode determines the smallest supported encoding which can encode every rune in the sequence. If there is any rune which cannot be decoded, or if the sequence encoding is already number, the result is number. The order of preference is UTF-8, Latin-1, UTF-16, UTF-32, number.

func (Sequence) NumberString

func (s Sequence) NumberString() string

NumberString returns a string containing the values of the sequence interpreted numerically. If the sequence is mutable, callers should hold its object's lock.

func (Sequence) RFind

func (s Sequence) RFind(other Sequence, end int) int

RFind locates the last instance of other in the sequence ending before end. Comparison is done following conversion to the type of s. If there is no match, the result is -1. If s or other are mutable, then callers should hold their objects' locks.

func (Sequence) Reduce

func (s Sequence) Reduce(op func(float64, float64) float64, ic float64) float64

Reduce evaluates op on each element of the sequence, using the output as the first input to the following call. The first input for the first element is ic. If the sequence is mutable, callers should hold its object's lock.

func (Sequence) Remove

func (s Sequence) Remove(i, j int) Sequence

Remove deletes a range of elements from the sequence and returns the new sequence value. Callers should hold the sequence object's lock. Panics if the sequence is immutable.

func (Sequence) SameType

func (s Sequence) SameType(as Sequence) bool

SameType returns whether the sequence has the same data type as another. If either sequence is mutable, callers should hold their objects' locks.

func (Sequence) Slice

func (s Sequence) Slice(start, stop, step int) Sequence

Slice selects a linear portion of the sequence. Callers should hold the sequence object's lock if it is mutable.

func (Sequence) String

func (s Sequence) String() string

String returns a string representation of the object. If the sequence is mutable, callers should hold its object's lock.

type Slots

type Slots = map[string]*Object

Slots represents the set of messages to which an object responds.

type Stop

type Stop int

Stop represents the reason for flow control.

const (
	// NoStop indicates normal execution. Coroutines also use it to cause each
	// other to yield remotely.
	NoStop Stop = iota
	// ContinueStop should be interpreted by loops as a signal to restart the
	// loop immediately.
	ContinueStop
	// BreakStop should be interpreted by loops as a signal to exit the loop.
	BreakStop
	// ReturnStop should be interpreted by loops and blocks as a signal to
	// exit.
	ReturnStop
	// ExceptionStop should be interpreted by loops, blocks, and CFunctions as
	// a signal to exit.
	ExceptionStop

	// ExitStop indicates that the VM has been force-closed and all coroutines
	// must exit.
	ExitStop

	// PauseStop tells a coroutine to stop execution until receiving a
	// ResumeStop. While paused, a coroutine is considered dead (the scheduler
	// will stop if all coroutines are paused), but it will still accept other
	// stops.
	PauseStop
	// ResumeStop tells a coroutine to unpause. If it is not paused, it will
	// instead yield.
	ResumeStop
)

Control flow reasons.

func (Stop) Err

func (s Stop) Err() error

Err returns nil if s is NoStop or an error value if s is ContinueStop, BreakStop, ReturnStop, ExceptionStop, or ExitStop. Panics otherwise.

func (Stop) String

func (s Stop) String() string

String returns a string representation of the Stop.

type SyncSlot

type SyncSlot struct {
	// contains filtered or unexported fields
}

SyncSlot proxies synchronized access to a single slot. A SyncSlot value may be copied, but it must never be accessed with a VM other than the one which originally obtained it.

func (SyncSlot) Delete

func (s SyncSlot) Delete()

Delete calls Set(nil). The slot must be locked.

func (SyncSlot) Load

func (s SyncSlot) Load() *Object

Load obtains the slot's value. The slot must be locked.

func (SyncSlot) Lock

func (s SyncSlot) Lock()

Lock locks the slot for the owning coroutine. The same coroutine may lock the slot multiple times without blocking, but each call to Lock must be followed eventually by exactly one corresponding call to Unlock. Each Sync slot accessor logically makes one call to Lock.

func (SyncSlot) Set

func (s SyncSlot) Set(value *Object)

Set sets the slot's value. The slot must be locked. Setting a value of nil marks the slot as deleted.

func (SyncSlot) Snap

func (s SyncSlot) Snap() *Object

Snap returns a snapshot of the slot's value by locking, loading, and unlocking it. If the slot is not valid, the result is nil, and Snap may or may not block.

func (SyncSlot) Unlock

func (s SyncSlot) Unlock()

Unlock unlocks the slot. Each call to Unlock must be preceded by exactly one call to Lock or any of the Sync slot accessors. In the latter case, Unlock should be called even if the slot is not valid.

func (SyncSlot) Valid

func (s SyncSlot) Valid() bool

Valid returns true if the slot currently has a value or false if it is deleted. The slot does not need to be locked, but its validity may change at any time if it is not locked.

type Tag

type Tag interface {
	// Activate activates an object that has this tag. The self argument is the
	// object which has this tag, target is the object that received the
	// message, and context is the object that actually had the slot.
	Activate(vm *VM, self, target, locals, context *Object, msg *Message) *Object
	// CloneValue takes the Value of an existing object and returns the Value
	// of a clone of that object.
	CloneValue(value interface{}) interface{}

	// String returns the name of the type associated with this tag.
	String() string
}

Tag is a type indicator for iolang objects. Tag values must be comparable. Tags for different types must not be equal, meaning they must have different underlying types or different values otherwise.

type VM

type VM struct {
	// Lobby is the default target of messages.
	Lobby *Object
	// Core is the object containing the basic prototypes of Io.
	Core *Object
	// Addons is the object containing imported addon protos.
	Addons *Object

	// Singletons.
	BaseObject *Object
	True       *Object
	False      *Object
	Nil        *Object
	Operators  *Object

	// Sched is the scheduler for this VM and all related coroutines.
	Sched *Scheduler
	// Control is a buffered channel for remote control of this coroutine. The
	// evaluator checks this between each message. NoStop stops tell the
	// coroutine to yield, and all other stops have their results returned.
	Control chan RemoteStop
	// Coro is the Coroutine object for this VM. The object's value contains the
	// Control channel and a pointer to Debug.
	Coro *Object

	// StartTime is the time at which VM initialization began, used for the
	// Date clock method.
	StartTime time.Time

	// Debug is an atomic flag controlling whether debugging is enabled for
	// this coroutine.
	Debug uint32

	// ExitStatus is the (first) value passed to System exit. Only the
	// scheduler's main VM receives this value.
	ExitStatus int
	// contains filtered or unexported fields
}

VM is an object for processing Io programs.

func NewVM

func NewVM(args ...string) *VM

NewVM prepares a new VM to interpret Io code. String arguments may be passed to occupy the System args slot, typically os.Args[1:].

func (*VM) ActivateBlock

func (vm *VM) ActivateBlock(blk, target, locals, context *Object, msg *Message) *Object

ActivateBlock activates a block directly, regardless of the value of its Activatable flag. Panics if blk is not a Block object.

func (*VM) AddonProto

func (vm *VM) AddonProto(name string) []*Object

AddonProto returns a new Protos list for a type in vm.Addons. Panics if there is no such type!

func (*VM) AsBool

func (vm *VM) AsBool(obj *Object) bool

AsBool attempts to convert an Io object to a bool by activating its asBoolean slot. If the object has no such slot, it is true.

func (*VM) AsString

func (vm *VM) AsString(obj *Object) string

AsString attempts to convert an Io object to a string by activating its asString slot. If the object has no such slot but its Value is an fmt.Stringer, then it returns the value of String(); otherwise, a default representation is used. If the asString method raises an exception, then the exception message is the returned value.

func (*VM) CachedMessage

func (vm *VM) CachedMessage(v *Object) *Message

CachedMessage creates a message carrying a cached value.

func (*VM) CheckEncoding

func (vm *VM) CheckEncoding(encoding string) bool

CheckEncoding checks whether the given encoding name is a valid encoding accepted by the VM.

func (*VM) Compare

func (vm *VM) Compare(x, y *Object) (c int, obj *Object, stop Stop)

Compare uses the compare method of x to compare to y. If the result is a Number, then its value is converted to int and returned as c along with nil for obj and NoStop for stop. Otherwise, c is 0, and obj and stop are the results of evaluation.

func (*VM) CoreProto

func (vm *VM) CoreProto(name string) []*Object

CoreProto returns a new Protos list for a type in vm.Core. Panics if there is no such type!

func (*VM) DebugMessage

func (vm *VM) DebugMessage(target, locals *Object, msg *Message)

DebugMessage does nothing if debugging is disabled for the VM; otherwise, it sends the execution context to the debugger and waits for it to be handled.

func (*VM) DoMessage

func (vm *VM) DoMessage(msg *Message, locals *Object) (*Object, Stop)

DoMessage evaluates a message.

func (*VM) DoReader

func (vm *VM) DoReader(src io.Reader, label string) (*Object, Stop)

DoReader parses and executes an io.Reader.

func (*VM) DoString

func (vm *VM) DoString(src string, label string) (*Object, Stop)

DoString parses and executes a string.

func (*VM) ForeachSlot

func (vm *VM) ForeachSlot(obj *Object, exec func(name string, sy SyncSlot) bool)

ForeachSlot executes a function for each slot on obj. If exec returns false, then the iteration ceases. The slots passed to exec are not locked and may not be valid, but it is guaranteed that calling Lock on them will not cause a nil dereference.

func (*VM) GetAllSlots

func (vm *VM) GetAllSlots(obj *Object) Slots

GetAllSlots returns a copy of all slots on obj. This may block if another coroutine is accessing any slot on the object.

func (*VM) GetLocalSlot

func (vm *VM) GetLocalSlot(obj *Object, slot string) (value *Object, ok bool)

GetLocalSlot checks only obj's own slots for a slot.

func (*VM) GetLocalSlotSync

func (vm *VM) GetLocalSlotSync(obj *Object, slot string) SyncSlot

GetLocalSlotSync is like GetLocalSlot, but it returns a SyncSlot object rather than the slot value directly. The SyncSlot is valid if and only if the slot exists on obj, and it is locked if it is valid. Other VMs will block on attempts to read or write the same slot until the SyncSlot is unlocked.

func (*VM) GetSlot

func (vm *VM) GetSlot(obj *Object, slot string) (value, proto *Object)

GetSlot checks obj and its ancestors in depth-first order without cycles for a slot, returning the slot value and the proto which had it. proto is nil if and only if the slot was not found.

func (*VM) GetSlotSync

func (vm *VM) GetSlotSync(obj *Object, slot string) (s SyncSlot, proto *Object)

GetSlotSync is like GetSlot, but it returns a SyncSlot object rather than the slot value directly. The SyncSlot is locked at the time GetSlotSync returns. Other VMs will block on attempts to read or write the same slot, whether it is on obj or an ancestor, until the SyncSlot is unlocked. The slot is guaranteed to be valid if it is not nil. proto is nil if and only if the slot is not found.

func (*VM) IdentMessage

func (vm *VM) IdentMessage(s string, args ...*Message) *Message

IdentMessage creates a message of a given identifier. Additional messages may be passed as arguments.

func (*VM) Install

func (vm *VM) Install(name string, proto *Object)

Install installs an addon proto by appending it to Lobby's protos and setting the corresponding slot in Addons.

func (*VM) IoBool

func (vm *VM) IoBool(c bool) *Object

IoBool converts a bool to the appropriate Io boolean object.

func (*VM) IoError

func (vm *VM) IoError(err interface{}) *Object

IoError converts an error to an Io exception and raises it. If it is already an Io object, it will be used unchanged. Otherwise, if it is not an error, panic.

func (*VM) IsAlive

func (vm *VM) IsAlive() bool

IsAlive returns true if the VM is alive. If this returns false, then the VM's scheduler has exited, and attempting to perform messages will panic.

func (*VM) LoadAddon

func (vm *VM) LoadAddon(addon Addon) <-chan struct{}

LoadAddon loads an addon. It returns a channel that closes when the addon is loaded.

func (*VM) MessageObject

func (vm *VM) MessageObject(msg *Message) *Object

MessageObject returns an Object with the given Message value. If msg is nil, the result is nil.

func (*VM) MustDoString

func (vm *VM) MustDoString(src string) *Object

MustDoString parses and executes a string, panicking if the result is a raised exception.

func (*VM) NewBlock

func (vm *VM) NewBlock(msg *Message, scope *Object, args ...string) *Object

NewBlock creates a new Block object for a message. If scope is nil, then the returned block is a method, and it is activatable; otherwise, it is a lexically scoped block that is not activatable.

func (*VM) NewCFunction

func (vm *VM) NewCFunction(f Fn, kind Tag) *Object

NewCFunction creates a new CFunction object wrapping f. If kind is not nil, then the CFunction will raise an exception when called on a target with a different tag.

func (*VM) NewCall

func (vm *VM) NewCall(sender, actor *Object, msg *Message, target, context *Object) *Object

NewCall creates a Call object sent from sender to the target's actor using the message msg.

func (*VM) NewException

func (vm *VM) NewException(err error) *Object

NewException creates a new Exception object with the given error.

func (*VM) NewExceptionf

func (vm *VM) NewExceptionf(format string, args ...interface{}) *Object

NewExceptionf creates a new Io Exception with the given formatted error message.

func (*VM) NewList

func (vm *VM) NewList(items ...*Object) *Object

NewList creates a List with the given items.

func (*VM) NewLocals

func (vm *VM) NewLocals(self, call *Object) *Object

NewLocals instantiates a Locals object for a block activation.

func (*VM) NewMap

func (vm *VM) NewMap(value map[string]*Object) *Object

NewMap creates a new Map object with the given value, which may be nil.

func (*VM) NewNumber

func (vm *VM) NewNumber(value float64) *Object

NewNumber creates a Number object with a given value.

func (*VM) NewObject

func (vm *VM) NewObject(slots Slots) *Object

NewObject creates a new object with the given slots and with the VM's Core Object as its proto.

func (*VM) NewSequence

func (vm *VM) NewSequence(value interface{}, mutable bool, encoding string) *Object

NewSequence creates a new Sequence object with the given value and with the given encoding. The value must be a slice of a basic fixed-size data type, and it is copied. Panics if the encoding is not supported.

func (*VM) NewString

func (vm *VM) NewString(str string) *Object

NewString creates a new Sequence object representing the given string in UTF-8 encoding.

func (*VM) NumberMessage

func (vm *VM) NumberMessage(v float64) *Message

NumberMessage creates a message carrying a numeric value.

func (*VM) ObjectWith

func (vm *VM) ObjectWith(slots Slots, protos []*Object, value interface{}, tag Tag) *Object

ObjectWith creates a new object with the given slots, protos, value, and tag.

func (*VM) OpShuffle

func (vm *VM) OpShuffle(msg *Object) (err error)

OpShuffle performs operator-precedence reordering of a message. If the message (or one of its protos) has an OperatorTable slot that contains an *OpTable, it is used for operators; otherwise, the VM's default OpTable is used. Panics if msg is not a Message object.

func (*VM) Parse

func (vm *VM) Parse(source io.Reader, label string) (msg *Message, err error)

Parse converts Io source code into a message chain. The message is shuffled according to the VM's default operator table.

func (*VM) ParseScanner

func (vm *VM) ParseScanner(src io.RuneScanner, label string) (msg *Message, err error)

ParseScanner converts Io source code in a RuneScanner into a message chain. No operator precedence parsing is applied.

func (*VM) ParseUnshuffled

func (vm *VM) ParseUnshuffled(source io.Reader, label string) (msg *Message, err error)

ParseUnshuffled converts Io source code into a message chain. No operator precedence parsing is applied.

func (*VM) Perform

func (vm *VM) Perform(target, locals *Object, msg *Message) (result *Object, control Stop)

Perform executes a single message and checks for control flow signals. Any received control flow except NoStop and ResumeStop overrides the perform result.

NOTE: It is unsafe to call this while holding the lock of any object.

func (*VM) Raise

func (vm *VM) Raise(exc *Object) *Object

Raise raises an exception and returns the object.

func (*VM) RaiseException

func (vm *VM) RaiseException(msg error) *Object

RaiseException returns vm.Raise(vm.NewException(msg)).

func (*VM) RaiseExceptionf

func (vm *VM) RaiseExceptionf(format string, args ...interface{}) *Object

RaiseExceptionf returns vm.Raise(vm.NewExceptionf(format, args...)).

func (*VM) RemoveAllSlots

func (vm *VM) RemoveAllSlots(obj *Object)

RemoveAllSlots removes all slots from obj in a single operation.

func (*VM) RemoveSlot

func (vm *VM) RemoveSlot(obj *Object, slots ...string)

RemoveSlot removes slots from obj's local slots, if they are present.

func (*VM) SequenceFromBytes

func (vm *VM) SequenceFromBytes(b []byte, kind SeqKind) Sequence

SequenceFromBytes makes a mutable Sequence with the given type having the same bit pattern as the given bytes. If the length of b is not a multiple of the item size for the given kind, the extra bytes are ignored. The sequence's encoding will be number unless the kind is SeqU8, SeqU16, or SeqS32, in which cases the encoding will be utf8, utf16, or utf32, respectively.

func (*VM) SequenceObject

func (vm *VM) SequenceObject(value Sequence) *Object

SequenceObject creates a new Sequence object with the given value directly.

func (*VM) SetLaunchScript

func (vm *VM) SetLaunchScript(path string)

SetLaunchScript sets the System launchScript slot to the given string, as a convenience for VM creators who intend to execute that Io source file. The default System launchScript value is nil, which signifies an interactive session.

func (*VM) SetSlot

func (vm *VM) SetSlot(obj *Object, slot string, value *Object)

SetSlot sets the value of a slot on obj.

func (*VM) SetSlotSync

func (vm *VM) SetSlotSync(obj *Object, slot string) SyncSlot

SetSlotSync returns a locked SyncSlot for the given slot on obj, creating the slot if it does not exist. The SyncSlot is not guaranteed to be valid, so its current value should not be accessed. Users should call SetSlotSync before evaluating Io messages that will determine the value, e.g.:

sy := vm.SetSlotSync(obj, slot)
defer sy.Unlock()
value, stop := msg.Eval(vm, locals)
if stop != NoStop {
	return vm.Stop(value, stop)
}
sy.Set(value)

func (*VM) SetSlots

func (vm *VM) SetSlots(obj *Object, slots Slots)

SetSlots sets the values of multiple slots on obj.

func (*VM) Status

func (vm *VM) Status(result *Object) (*Object, Stop)

Status checks the VM's control flow channel and returns any pending signal, or (result, NoStop) if there is none.

func (*VM) Stop

func (vm *VM) Stop(result *Object, stop Stop) *Object

Stop sends a Stop to the VM, causing the innermost message evaluation loop to exit with the given value and Stop. Stop does nothing if stop is NoStop, and it panics if stop is not ContinueStop, BreakStop, ReturnStop, ExceptionStop, or ExitStop. Returns result. If stop is not ExceptionStop or ExitStop and a Stop is already pending, e.g. from another coroutine, then this method instead does nothing and returns nil.

func (*VM) StringMessage

func (vm *VM) StringMessage(s string) *Message

StringMessage creates a message carrying a string value.

func (*VM) TypeName

func (vm *VM) TypeName(o *Object) string

TypeName gets the name of the type of an object by activating its type slot. If there is no such slot, then its tag's name will be returned; if its tag is nil, then its name is Object.

func (*VM) VMFor

func (vm *VM) VMFor(coro *Object) *VM

VMFor creates a VM for a given Coroutine object so that it can run Io code. The new VM does not have debugging enabled. Panics if the object is not a Coroutine.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL