Documentation ¶
Index ¶
- Constants
- Variables
- func DebuggerChan(d Debugger) chan DebugMessage
- func InitAddon(vm *VM)
- func Ioz(vm *VM, io, names []string)
- func PtrCompare(x, y *Object) int
- func Register(f func(*VM))
- func RunCoro(vm *VM)
- func ScanForAddons(vm *VM, file *os.File)
- func SliceArgs(vm *VM, locals *Object, msg *Message, size int) (start, step, stop int, exc *Object, control Stop)
- type Addon
- type BasicTag
- type Block
- type CFunction
- type Call
- type Coroutine
- type DebugMessage
- type Debugger
- type Exception
- type Fn
- type Message
- func (m *Message) ArgAt(n int) (r *Message)
- func (m *Message) ArgCount() int
- func (m *Message) AsStringArgAt(vm *VM, locals *Object, n int) (string, *Object, Stop)
- func (m *Message) AssertArgCount(name string, n int) error
- func (m *Message) DeepCopy() *Message
- func (m *Message) Eval(vm *VM, locals *Object) (result *Object, control Stop)
- func (m *Message) EvalArgAt(vm *VM, locals *Object, n int) (result *Object, control Stop)
- func (m *Message) InsertAfter(next *Message)
- func (m *Message) IsStart() bool
- func (m *Message) IsTerminator() bool
- func (m *Message) ListArgAt(vm *VM, locals *Object, n int) ([]*Object, *Object, Stop)
- func (m *Message) MessageArgAt(vm *VM, locals *Object, n int) (*Message, *Object, Stop)
- func (m *Message) Name() string
- func (m *Message) NumberArgAt(vm *VM, locals *Object, n int) (float64, *Object, Stop)
- func (m *Message) Send(vm *VM, target, locals *Object) (result *Object, control Stop)
- func (m *Message) SeqOrNumArgAt(vm *VM, locals *Object, n int) (Sequence, float64, *Object, Stop)
- func (m *Message) SequenceArgAt(vm *VM, locals *Object, n int) (Sequence, *Object, Stop)
- func (m *Message) String() string
- func (m *Message) StringArgAt(vm *VM, locals *Object, n int) (string, *Object, Stop)
- type Object
- func BlockArgumentNames(vm *VM, target, locals *Object, msg *Message) *Object
- func BlockAsString(vm *VM, target, locals *Object, msg *Message) *Object
- func BlockCall(vm *VM, target, locals *Object, msg *Message) *Object
- func BlockMessage(vm *VM, target, locals *Object, msg *Message) *Object
- func BlockPassStops(vm *VM, target, locals *Object, msg *Message) *Object
- func BlockPerformOn(vm *VM, target, locals *Object, msg *Message) *Object
- func BlockScope(vm *VM, target, locals *Object, msg *Message) *Object
- func BlockSetArgumentNames(vm *VM, target, locals *Object, msg *Message) *Object
- func BlockSetMessage(vm *VM, target, locals *Object, msg *Message) *Object
- func BlockSetPassStops(vm *VM, target, locals *Object, msg *Message) *Object
- func BlockSetScope(vm *VM, target, locals *Object, msg *Message) *Object
- func CFunctionAsString(vm *VM, target, locals *Object, msg *Message) *Object
- func CFunctionEqual(vm *VM, target, locals *Object, msg *Message) *Object
- func CFunctionID(vm *VM, target, locals *Object, msg *Message) *Object
- func CFunctionPerformOn(vm *VM, target, locals *Object, msg *Message) *Object
- func CFunctionTypeName(vm *VM, target, locals *Object, msg *Message) *Object
- func CFunctionUniqueName(vm *VM, target, locals *Object, msg *Message) *Object
- func CallActivated(vm *VM, target, locals *Object, msg *Message) *Object
- func CallCoroutine(vm *VM, target, locals *Object, msg *Message) *Object
- func CallMessage(vm *VM, target, locals *Object, msg *Message) *Object
- func CallSender(vm *VM, target, locals *Object, msg *Message) *Object
- func CallSetStopStatus(vm *VM, target, locals *Object, msg *Message) *Object
- func CallSlotContext(vm *VM, target, locals *Object, msg *Message) *Object
- func CallStopStatus(vm *VM, target, locals *Object, msg *Message) *Object
- func CallTarget(vm *VM, target, locals *Object, msg *Message) *Object
- func CoreInstall(vm *VM, proto string, slots Slots, value interface{}, tag Tag) *Object
- func ExceptionError(vm *VM, target, locals *Object, msg *Message) *Object
- func ExceptionPass(vm *VM, target, locals *Object, msg *Message) *Object
- func ExceptionRaise(vm *VM, target, locals *Object, msg *Message) *Object
- func ExceptionRaiseFrom(vm *VM, target, locals *Object, msg *Message) *Object
- func ExceptionSetError(vm *VM, target, locals *Object, msg *Message) *Object
- func ExceptionStack(vm *VM, target, locals *Object, msg *Message) *Object
- func ListAppend(vm *VM, target, locals *Object, msg *Message) *Object
- func ListAppendIfAbsent(vm *VM, target, locals *Object, msg *Message) *Object
- func ListAppendSeq(vm *VM, target, locals *Object, msg *Message) *Object
- func ListAsString(vm *VM, target, locals *Object, msg *Message) *Object
- func ListAt(vm *VM, target, locals *Object, msg *Message) *Object
- func ListAtInsert(vm *VM, target, locals *Object, msg *Message) *Object
- func ListAtPut(vm *VM, target, locals *Object, msg *Message) *Object
- func ListCapacity(vm *VM, target, locals *Object, msg *Message) *Object
- func ListCompare(vm *VM, target, locals *Object, msg *Message) *Object
- func ListContains(vm *VM, target, locals *Object, msg *Message) *Object
- func ListContainsAll(vm *VM, target, locals *Object, msg *Message) *Object
- func ListContainsAny(vm *VM, target, locals *Object, msg *Message) *Object
- func ListContainsIdenticalTo(vm *VM, target, locals *Object, msg *Message) *Object
- func ListForeach(vm *VM, target, locals *Object, msg *Message) (result *Object)
- func ListIndexOf(vm *VM, target, locals *Object, msg *Message) *Object
- func ListPreallocateToSize(vm *VM, target, locals *Object, msg *Message) *Object
- func ListPrepend(vm *VM, target, locals *Object, msg *Message) *Object
- func ListRemove(vm *VM, target, locals *Object, msg *Message) *Object
- func ListRemoveAll(vm *VM, target, locals *Object, msg *Message) *Object
- func ListRemoveAt(vm *VM, target, locals *Object, msg *Message) *Object
- func ListReverseForeach(vm *VM, target, locals *Object, msg *Message) (result *Object)
- func ListReverseInPlace(vm *VM, target, locals *Object, msg *Message) *Object
- func ListSetSize(vm *VM, target, locals *Object, msg *Message) *Object
- func ListSize(vm *VM, target, locals *Object, msg *Message) *Object
- func ListSlice(vm *VM, target, locals *Object, msg *Message) *Object
- func ListSliceInPlace(vm *VM, target, locals *Object, msg *Message) *Object
- func ListSortInPlace(vm *VM, target, locals *Object, msg *Message) *Object
- func ListSortInPlaceBy(vm *VM, target, locals *Object, msg *Message) *Object
- func ListSwapIndices(vm *VM, target, locals *Object, msg *Message) *Object
- func ListWith(vm *VM, target, locals *Object, msg *Message) *Object
- func LocalsForward(vm *VM, target, locals *Object, msg *Message) *Object
- func LocalsUpdateSlot(vm *VM, target, locals *Object, msg *Message) *Object
- func MapAt(vm *VM, target, locals *Object, msg *Message) *Object
- func MapAtIfAbsentPut(vm *VM, target, locals *Object, msg *Message) *Object
- func MapAtPut(vm *VM, target, locals *Object, msg *Message) *Object
- func MapEmpty(vm *VM, target, locals *Object, msg *Message) *Object
- func MapForeach(vm *VM, target, locals *Object, msg *Message) (result *Object)
- func MapHasKey(vm *VM, target, locals *Object, msg *Message) *Object
- func MapKeys(vm *VM, target, locals *Object, msg *Message) *Object
- func MapRemoveAt(vm *VM, target, locals *Object, msg *Message) *Object
- func MapSize(vm *VM, target, locals *Object, msg *Message) *Object
- func MapValues(vm *VM, target, locals *Object, msg *Message) *Object
- func MessageAppendArg(vm *VM, target, locals *Object, msg *Message) *Object
- func MessageAppendCachedArg(vm *VM, target, locals *Object, msg *Message) *Object
- func MessageArgAt(vm *VM, target, locals *Object, msg *Message) *Object
- func MessageArgCount(vm *VM, target, locals *Object, msg *Message) *Object
- func MessageArgsEvaluatedIn(vm *VM, target, locals *Object, msg *Message) *Object
- func MessageArguments(vm *VM, target, locals *Object, msg *Message) *Object
- func MessageAsMessageWithEvaluatedArgs(vm *VM, target, locals *Object, msg *Message) *Object
- func MessageAsString(vm *VM, target, locals *Object, msg *Message) *Object
- func MessageCachedResult(vm *VM, target, locals *Object, msg *Message) *Object
- func MessageCharacterNumber(vm *VM, target, locals *Object, msg *Message) *Object
- func MessageClone(vm *VM, target, locals *Object, msg *Message) *Object
- func MessageDoInContext(vm *VM, target, locals *Object, msg *Message) *Object
- func MessageFromString(vm *VM, target, locals *Object, msg *Message) *Object
- func MessageHasCachedResult(vm *VM, target, locals *Object, msg *Message) *Object
- func MessageIsEndOfLine(vm *VM, target, locals *Object, msg *Message) *Object
- func MessageLabel(vm *VM, target, locals *Object, msg *Message) *Object
- func MessageLast(vm *VM, target, locals *Object, msg *Message) *Object
- func MessageLastBeforeEndOfLine(vm *VM, target, locals *Object, msg *Message) *Object
- func MessageLineNumber(vm *VM, target, locals *Object, msg *Message) *Object
- func MessageName(vm *VM, target, locals *Object, msg *Message) *Object
- func MessageNext(vm *VM, target, locals *Object, msg *Message) *Object
- func MessageNextIgnoreEndOfLines(vm *VM, target, locals *Object, msg *Message) *Object
- func MessageOpShuffle(vm *VM, target, locals *Object, msg *Message) *Object
- func MessagePrevious(vm *VM, target, locals *Object, msg *Message) *Object
- func MessageRemoveCachedResult(vm *VM, target, locals *Object, msg *Message) *Object
- func MessageSetArguments(vm *VM, target, locals *Object, msg *Message) *Object
- func MessageSetCachedResult(vm *VM, target, locals *Object, msg *Message) *Object
- func MessageSetCharacterNumber(vm *VM, target, locals *Object, msg *Message) *Object
- func MessageSetLabel(vm *VM, target, locals *Object, msg *Message) *Object
- func MessageSetLineNumber(vm *VM, target, locals *Object, msg *Message) *Object
- func MessageSetName(vm *VM, target, locals *Object, msg *Message) *Object
- func MessageSetNext(vm *VM, target, locals *Object, msg *Message) *Object
- func NumberAbs(vm *VM, target, locals *Object, msg *Message) *Object
- func NumberAcos(vm *VM, target, locals *Object, msg *Message) *Object
- func NumberAdd(vm *VM, target, locals *Object, msg *Message) *Object
- func NumberAsBuffer(vm *VM, target, locals *Object, msg *Message) *Object
- func NumberAsCharacter(vm *VM, target, locals *Object, msg *Message) *Object
- func NumberAsLowercase(vm *VM, target, locals *Object, msg *Message) *Object
- func NumberAsString(vm *VM, target, locals *Object, msg *Message) *Object
- func NumberAsUint32Buffer(vm *VM, target, locals *Object, msg *Message) *Object
- func NumberAsUppercase(vm *VM, target, locals *Object, msg *Message) *Object
- func NumberAsin(vm *VM, target, locals *Object, msg *Message) *Object
- func NumberAt(vm *VM, target, locals *Object, msg *Message) *Object
- func NumberAtan(vm *VM, target, locals *Object, msg *Message) *Object
- func NumberAtan2(vm *VM, target, locals *Object, msg *Message) *Object
- func NumberBetween(vm *VM, target, locals *Object, msg *Message) *Object
- func NumberBitwiseAnd(vm *VM, target, locals *Object, msg *Message) *Object
- func NumberBitwiseComplement(vm *VM, target, locals *Object, msg *Message) *Object
- func NumberBitwiseOr(vm *VM, target, locals *Object, msg *Message) *Object
- func NumberBitwiseXor(vm *VM, target, locals *Object, msg *Message) *Object
- func NumberCeil(vm *VM, target, locals *Object, msg *Message) *Object
- func NumberClip(vm *VM, target, locals *Object, msg *Message) *Object
- func NumberCompare(vm *VM, target, locals *Object, msg *Message) *Object
- func NumberCos(vm *VM, target, locals *Object, msg *Message) *Object
- func NumberCubed(vm *VM, target, locals *Object, msg *Message) *Object
- func NumberDiv(vm *VM, target, locals *Object, msg *Message) *Object
- func NumberExp(vm *VM, target, locals *Object, msg *Message) *Object
- func NumberFactorial(vm *VM, target, locals *Object, msg *Message) *Object
- func NumberFloor(vm *VM, target, locals *Object, msg *Message) *Object
- func NumberIsAlphaNumeric(vm *VM, target, locals *Object, msg *Message) *Object
- func NumberIsControlCharacter(vm *VM, target, locals *Object, msg *Message) *Object
- func NumberIsDigit(vm *VM, target, locals *Object, msg *Message) *Object
- func NumberIsEven(vm *VM, target, locals *Object, msg *Message) *Object
- func NumberIsGraph(vm *VM, target, locals *Object, msg *Message) *Object
- func NumberIsHexDigit(vm *VM, target, locals *Object, msg *Message) *Object
- func NumberIsLetter(vm *VM, target, locals *Object, msg *Message) *Object
- func NumberIsLowercase(vm *VM, target, locals *Object, msg *Message) *Object
- func NumberIsNan(vm *VM, target, locals *Object, msg *Message) *Object
- func NumberIsOdd(vm *VM, target, locals *Object, msg *Message) *Object
- func NumberIsPrint(vm *VM, target, locals *Object, msg *Message) *Object
- func NumberIsPunctuation(vm *VM, target, locals *Object, msg *Message) *Object
- func NumberIsSpace(vm *VM, target, locals *Object, msg *Message) *Object
- func NumberIsUppercase(vm *VM, target, locals *Object, msg *Message) *Object
- func NumberLog(vm *VM, target, locals *Object, msg *Message) *Object
- func NumberLog10(vm *VM, target, locals *Object, msg *Message) *Object
- func NumberLog2(vm *VM, target, locals *Object, msg *Message) *Object
- func NumberMax(vm *VM, target, locals *Object, msg *Message) *Object
- func NumberMin(vm *VM, target, locals *Object, msg *Message) *Object
- func NumberMod(vm *VM, target, locals *Object, msg *Message) *Object
- func NumberMul(vm *VM, target, locals *Object, msg *Message) *Object
- func NumberNegate(vm *VM, target, locals *Object, msg *Message) *Object
- func NumberPow(vm *VM, target, locals *Object, msg *Message) *Object
- func NumberRepeat(vm *VM, target, locals *Object, msg *Message) (result *Object)
- func NumberRound(vm *VM, target, locals *Object, msg *Message) *Object
- func NumberRoundDown(vm *VM, target, locals *Object, msg *Message) *Object
- func NumberShiftLeft(vm *VM, target, locals *Object, msg *Message) *Object
- func NumberShiftRight(vm *VM, target, locals *Object, msg *Message) *Object
- func NumberSin(vm *VM, target, locals *Object, msg *Message) *Object
- func NumberSqrt(vm *VM, target, locals *Object, msg *Message) *Object
- func NumberSquared(vm *VM, target, locals *Object, msg *Message) *Object
- func NumberSub(vm *VM, target, locals *Object, msg *Message) *Object
- func NumberTan(vm *VM, target, locals *Object, msg *Message) *Object
- func NumberToBase(vm *VM, target, locals *Object, msg *Message) *Object
- func NumberToBaseWholeBytes(vm *VM, target, locals *Object, msg *Message) *Object
- func NumberToggle(vm *VM, target, locals *Object, msg *Message) *Object
- func ObjectAncestorWithSlot(vm *VM, target, locals *Object, msg *Message) *Object
- func ObjectAppendProto(vm *VM, target, locals *Object, msg *Message) *Object
- func ObjectAsGoRepr(vm *VM, target, locals *Object, msg *Message) *Object
- func ObjectAsString(vm *VM, target, locals *Object, msg *Message) *Object
- func ObjectBlock(vm *VM, target, locals *Object, msg *Message) *Object
- func ObjectBreak(vm *VM, target, locals *Object, msg *Message) *Object
- func ObjectClone(vm *VM, target, locals *Object, msg *Message) *Object
- func ObjectCloneWithoutInit(vm *VM, target, locals *Object, msg *Message) *Object
- func ObjectCompare(vm *VM, target, locals *Object, msg *Message) *Object
- func ObjectContextWithSlot(vm *VM, target, locals *Object, msg *Message) *Object
- func ObjectContinue(vm *VM, target, locals *Object, msg *Message) *Object
- func ObjectDo(vm *VM, target, locals *Object, msg *Message) *Object
- func ObjectDoFile(vm *VM, target, locals *Object, msg *Message) *Object
- func ObjectDoMessage(vm *VM, target, locals *Object, msg *Message) *Object
- func ObjectDoString(vm *VM, target, locals *Object, msg *Message) *Object
- func ObjectEqual(vm *VM, target, locals *Object, msg *Message) *Object
- func ObjectEvalArg(vm *VM, target, locals *Object, msg *Message) *Object
- func ObjectEvalArgAndReturnNil(vm *VM, target, locals *Object, msg *Message) *Object
- func ObjectEvalArgAndReturnSelf(vm *VM, target, locals *Object, msg *Message) *Object
- func ObjectFor(vm *VM, target, locals *Object, msg *Message) (result *Object)
- func ObjectForeachSlot(vm *VM, target, locals *Object, msg *Message) (result *Object)
- func ObjectGetLocalSlot(vm *VM, target, locals *Object, msg *Message) *Object
- func ObjectGetSlot(vm *VM, target, locals *Object, msg *Message) *Object
- func ObjectGreater(vm *VM, target, locals *Object, msg *Message) *Object
- func ObjectGreaterOrEqual(vm *VM, target, locals *Object, msg *Message) *Object
- func ObjectHasLocalSlot(vm *VM, target, locals *Object, msg *Message) *Object
- func ObjectIf(vm *VM, target, locals *Object, msg *Message) *Object
- func ObjectIsIdenticalTo(vm *VM, target, locals *Object, msg *Message) *Object
- func ObjectIsKindOf(vm *VM, target, locals *Object, msg *Message) *Object
- func ObjectLess(vm *VM, target, locals *Object, msg *Message) *Object
- func ObjectLessOrEqual(vm *VM, target, locals *Object, msg *Message) *Object
- func ObjectLexicalDo(vm *VM, target, locals *Object, msg *Message) *Object
- func ObjectLoop(vm *VM, target, locals *Object, msg *Message) *Object
- func ObjectMessage(vm *VM, target, locals *Object, msg *Message) *Object
- func ObjectMethod(vm *VM, target, locals *Object, msg *Message) *Object
- func ObjectNotEqual(vm *VM, target, locals *Object, msg *Message) *Object
- func ObjectPerform(vm *VM, target, locals *Object, msg *Message) *Object
- func ObjectPerformWithArgList(vm *VM, target, locals *Object, msg *Message) *Object
- func ObjectPrependProto(vm *VM, target, locals *Object, msg *Message) *Object
- func ObjectPrint(vm *VM, target, locals *Object, msg *Message) *Object
- func ObjectProtos(vm *VM, target, locals *Object, msg *Message) *Object
- func ObjectRemoveAllProtos(vm *VM, target, locals *Object, msg *Message) *Object
- func ObjectRemoveAllSlots(vm *VM, target, locals *Object, msg *Message) *Object
- func ObjectRemoveProto(vm *VM, target, locals *Object, msg *Message) *Object
- func ObjectRemoveSlot(vm *VM, target, locals *Object, msg *Message) *Object
- func ObjectReturn(vm *VM, target, locals *Object, msg *Message) *Object
- func ObjectSetProto(vm *VM, target, locals *Object, msg *Message) *Object
- func ObjectSetProtos(vm *VM, target, locals *Object, msg *Message) *Object
- func ObjectSetSlot(vm *VM, target, locals *Object, msg *Message) *Object
- func ObjectShallowCopy(vm *VM, target, locals *Object, msg *Message) *Object
- func ObjectSlotNames(vm *VM, target, locals *Object, msg *Message) *Object
- func ObjectSlotValues(vm *VM, target, locals *Object, msg *Message) *Object
- func ObjectStopStatus(vm *VM, target, locals *Object, msg *Message) *Object
- func ObjectThisContext(vm *VM, target, locals *Object, msg *Message) *Object
- func ObjectThisLocalContext(vm *VM, target, locals *Object, msg *Message) *Object
- func ObjectThisMessage(vm *VM, target, locals *Object, msg *Message) *Object
- func ObjectTry(vm *VM, target, locals *Object, msg *Message) *Object
- func ObjectUniqueID(vm *VM, target, locals *Object, msg *Message) *Object
- func ObjectUpdateSlot(vm *VM, target, locals *Object, msg *Message) *Object
- func ObjectWait(vm *VM, target, locals *Object, msg *Message) *Object
- func ObjectWhile(vm *VM, target, locals *Object, msg *Message) *Object
- func SchedulerAwaitingCoros(vm *VM, target, locals *Object, msg *Message) *Object
- func SchedulerCoroCount(vm *VM, target, locals *Object, msg *Message) *Object
- func SchedulerYieldingCoros(vm *VM, target, locals *Object, msg *Message) *Object
- func SequenceAbs(vm *VM, target, locals *Object, msg *Message) *Object
- func SequenceAcos(vm *VM, target, locals *Object, msg *Message) *Object
- func SequenceAfterSeq(vm *VM, target, locals *Object, msg *Message) *Object
- func SequenceAppend(vm *VM, target, locals *Object, msg *Message) *Object
- func SequenceAppendPathSeq(vm *VM, target, locals *Object, msg *Message) *Object
- func SequenceAppendSeq(vm *VM, target, locals *Object, msg *Message) *Object
- func SequenceAsBase64(vm *VM, target, locals *Object, msg *Message) *Object
- func SequenceAsBinaryNumber(vm *VM, target, locals *Object, msg *Message) *Object
- func SequenceAsBinarySignedInteger(vm *VM, target, locals *Object, msg *Message) *Object
- func SequenceAsBinaryUnsignedInteger(vm *VM, target, locals *Object, msg *Message) *Object
- func SequenceAsFixedSizeType(vm *VM, target, locals *Object, msg *Message) *Object
- func SequenceAsIoPath(vm *VM, target, locals *Object, msg *Message) *Object
- func SequenceAsJSON(vm *VM, target, locals *Object, msg *Message) *Object
- func SequenceAsLatin1(vm *VM, target, locals *Object, msg *Message) *Object
- func SequenceAsList(vm *VM, target, locals *Object, msg *Message) *Object
- func SequenceAsMessage(vm *VM, target, locals *Object, msg *Message) *Object
- func SequenceAsMutable(vm *VM, target, locals *Object, msg *Message) *Object
- func SequenceAsNumber(vm *VM, target, locals *Object, msg *Message) *Object
- func SequenceAsOSPath(vm *VM, target, locals *Object, msg *Message) *Object
- func SequenceAsStruct(vm *VM, target, locals *Object, msg *Message) *Object
- func SequenceAsSymbol(vm *VM, target, locals *Object, msg *Message) *Object
- func SequenceAsUTF16(vm *VM, target, locals *Object, msg *Message) *Object
- func SequenceAsUTF32(vm *VM, target, locals *Object, msg *Message) *Object
- func SequenceAsUTF8(vm *VM, target, locals *Object, msg *Message) *Object
- func SequenceAsin(vm *VM, target, locals *Object, msg *Message) *Object
- func SequenceAt(vm *VM, target, locals *Object, msg *Message) *Object
- func SequenceAtInsertSeq(vm *VM, target, locals *Object, msg *Message) *Object
- func SequenceAtPut(vm *VM, target, locals *Object, msg *Message) *Object
- func SequenceAtan(vm *VM, target, locals *Object, msg *Message) *Object
- func SequenceBeforeSeq(vm *VM, target, locals *Object, msg *Message) *Object
- func SequenceBeginsWithSeq(vm *VM, target, locals *Object, msg *Message) *Object
- func SequenceBetween(vm *VM, target, locals *Object, msg *Message) *Object
- func SequenceBitAt(vm *VM, target, locals *Object, msg *Message) *Object
- func SequenceBitCount(vm *VM, target, locals *Object, msg *Message) *Object
- func SequenceBitwiseAnd(vm *VM, target, locals *Object, msg *Message) *Object
- func SequenceBitwiseNot(vm *VM, target, locals *Object, msg *Message) *Object
- func SequenceBitwiseOr(vm *VM, target, locals *Object, msg *Message) *Object
- func SequenceBitwiseXor(vm *VM, target, locals *Object, msg *Message) *Object
- func SequenceByteAt(vm *VM, target, locals *Object, msg *Message) *Object
- func SequenceCapitalize(vm *VM, target, locals *Object, msg *Message) *Object
- func SequenceCeil(vm *VM, target, locals *Object, msg *Message) *Object
- func SequenceClipAfterSeq(vm *VM, target, locals *Object, msg *Message) *Object
- func SequenceClipAfterStartOfSeq(vm *VM, target, locals *Object, msg *Message) *Object
- func SequenceClipBeforeEndOfSeq(vm *VM, target, locals *Object, msg *Message) *Object
- func SequenceClipBeforeSeq(vm *VM, target, locals *Object, msg *Message) *Object
- func SequenceCloneAppendPath(vm *VM, target, locals *Object, msg *Message) *Object
- func SequenceCloneAppendSeq(vm *VM, target, locals *Object, msg *Message) *Object
- func SequenceCompare(vm *VM, target, locals *Object, msg *Message) *Object
- func SequenceContains(vm *VM, target, locals *Object, msg *Message) *Object
- func SequenceContainsSeq(vm *VM, target, locals *Object, msg *Message) *Object
- func SequenceConvertToFixedSizeType(vm *VM, target, locals *Object, msg *Message) *Object
- func SequenceConvertToItemType(vm *VM, target, locals *Object, msg *Message) *Object
- func SequenceCopy(vm *VM, target, locals *Object, msg *Message) *Object
- func SequenceCos(vm *VM, target, locals *Object, msg *Message) *Object
- func SequenceCosh(vm *VM, target, locals *Object, msg *Message) *Object
- func SequenceDistanceTo(vm *VM, target, locals *Object, msg *Message) *Object
- func SequenceDotProduct(vm *VM, target, locals *Object, msg *Message) *Object
- func SequenceDuplicateIndexes(vm *VM, target, locals *Object, msg *Message) *Object
- func SequenceEmpty(vm *VM, target, locals *Object, msg *Message) *Object
- func SequenceEncoding(vm *VM, target, locals *Object, msg *Message) *Object
- func SequenceEndsWithSeq(vm *VM, target, locals *Object, msg *Message) *Object
- func SequenceEscape(vm *VM, target, locals *Object, msg *Message) *Object
- func SequenceExSlice(vm *VM, target, locals *Object, msg *Message) *Object
- func SequenceFindSeq(vm *VM, target, locals *Object, msg *Message) *Object
- func SequenceFindSeqs(vm *VM, target, locals *Object, msg *Message) *Object
- func SequenceFloor(vm *VM, target, locals *Object, msg *Message) *Object
- func SequenceForeach(vm *VM, target, locals *Object, msg *Message) (result *Object)
- func SequenceFromBase(vm *VM, target, locals *Object, msg *Message) *Object
- func SequenceFromBase64(vm *VM, target, locals *Object, msg *Message) *Object
- func SequenceHash(vm *VM, target, locals *Object, msg *Message) *Object
- func SequenceInSlice(vm *VM, target, locals *Object, msg *Message) *Object
- func SequenceInsertSeqEvery(vm *VM, target, locals *Object, msg *Message) *Object
- func SequenceInterpolate(vm *VM, target, locals *Object, msg *Message) *Object
- func SequenceIsLowercase(vm *VM, target, locals *Object, msg *Message) *Object
- func SequenceIsMutable(vm *VM, target, locals *Object, msg *Message) *Object
- func SequenceIsUppercase(vm *VM, target, locals *Object, msg *Message) *Object
- func SequenceIsZero(vm *VM, target, locals *Object, msg *Message) *Object
- func SequenceItemSize(vm *VM, target, locals *Object, msg *Message) *Object
- func SequenceItemType(vm *VM, target, locals *Object, msg *Message) *Object
- func SequenceLastPathComponent(vm *VM, target, locals *Object, msg *Message) *Object
- func SequenceLeaveThenRemove(vm *VM, target, locals *Object, msg *Message) *Object
- func SequenceLog(vm *VM, target, locals *Object, msg *Message) *Object
- func SequenceLog10(vm *VM, target, locals *Object, msg *Message) *Object
- func SequenceLowercase(vm *VM, target, locals *Object, msg *Message) *Object
- func SequenceLstrip(vm *VM, target, locals *Object, msg *Message) *Object
- func SequenceMax(vm *VM, target, locals *Object, msg *Message) *Object
- func SequenceMean(vm *VM, target, locals *Object, msg *Message) *Object
- func SequenceMeanSquare(vm *VM, target, locals *Object, msg *Message) *Object
- func SequenceMin(vm *VM, target, locals *Object, msg *Message) *Object
- func SequenceMinusEq(vm *VM, target, locals *Object, msg *Message) *Object
- func SequenceNegate(vm *VM, target, locals *Object, msg *Message) *Object
- func SequenceNormalize(vm *VM, target, locals *Object, msg *Message) *Object
- func SequenceOccurrencesOfSeq(vm *VM, target, locals *Object, msg *Message) *Object
- func SequencePack(vm *VM, target, locals *Object, msg *Message) *Object
- func SequencePairwiseMax(vm *VM, target, locals *Object, msg *Message) *Object
- func SequencePairwiseMin(vm *VM, target, locals *Object, msg *Message) *Object
- func SequenceParseJSON(vm *VM, target, locals *Object, msg *Message) *Object
- func SequencePathComponent(vm *VM, target, locals *Object, msg *Message) *Object
- func SequencePathExtension(vm *VM, target, locals *Object, msg *Message) *Object
- func SequencePercentDecoded(vm *VM, target, locals *Object, msg *Message) *Object
- func SequencePercentEncoded(vm *VM, target, locals *Object, msg *Message) *Object
- func SequencePlusEq(vm *VM, target, locals *Object, msg *Message) *Object
- func SequencePreallocateToSize(vm *VM, target, locals *Object, msg *Message) *Object
- func SequenceProduct(vm *VM, target, locals *Object, msg *Message) *Object
- func SequenceRangeFill(vm *VM, target, locals *Object, msg *Message) *Object
- func SequenceRemoveAt(vm *VM, target, locals *Object, msg *Message) *Object
- func SequenceRemoveEvenIndexes(vm *VM, target, locals *Object, msg *Message) *Object
- func SequenceRemoveLast(vm *VM, target, locals *Object, msg *Message) *Object
- func SequenceRemoveOddIndexes(vm *VM, target, locals *Object, msg *Message) *Object
- func SequenceRemovePrefix(vm *VM, target, locals *Object, msg *Message) *Object
- func SequenceRemoveSeq(vm *VM, target, locals *Object, msg *Message) *Object
- func SequenceRemoveSlice(vm *VM, target, locals *Object, msg *Message) *Object
- func SequenceRemoveSuffix(vm *VM, target, locals *Object, msg *Message) *Object
- func SequenceReplaceFirstSeq(vm *VM, target, locals *Object, msg *Message) *Object
- func SequenceReplaceSeq(vm *VM, target, locals *Object, msg *Message) *Object
- func SequenceReverseFindSeq(vm *VM, target, locals *Object, msg *Message) *Object
- func SequenceReverseInPlace(vm *VM, target, locals *Object, msg *Message) *Object
- func SequenceRstrip(vm *VM, target, locals *Object, msg *Message) *Object
- func SequenceSetEncoding(vm *VM, target, locals *Object, msg *Message) *Object
- func SequenceSetItemType(vm *VM, target, locals *Object, msg *Message) *Object
- func SequenceSetItemsToDouble(vm *VM, target, locals *Object, msg *Message) *Object
- func SequenceSetSize(vm *VM, target, locals *Object, msg *Message) *Object
- func SequenceSin(vm *VM, target, locals *Object, msg *Message) *Object
- func SequenceSinh(vm *VM, target, locals *Object, msg *Message) *Object
- func SequenceSize(vm *VM, target, locals *Object, msg *Message) *Object
- func SequenceSlashEq(vm *VM, target, locals *Object, msg *Message) *Object
- func SequenceSort(vm *VM, target, locals *Object, msg *Message) *Object
- func SequenceSplit(vm *VM, target, locals *Object, msg *Message) *Object
- func SequenceSplitAt(vm *VM, target, locals *Object, msg *Message) *Object
- func SequenceSqrt(vm *VM, target, locals *Object, msg *Message) *Object
- func SequenceSquare(vm *VM, target, locals *Object, msg *Message) *Object
- func SequenceStarEq(vm *VM, target, locals *Object, msg *Message) *Object
- func SequenceStarStarEq(vm *VM, target, locals *Object, msg *Message) *Object
- func SequenceStrip(vm *VM, target, locals *Object, msg *Message) *Object
- func SequenceSum(vm *VM, target, locals *Object, msg *Message) *Object
- func SequenceTan(vm *VM, target, locals *Object, msg *Message) *Object
- func SequenceTanh(vm *VM, target, locals *Object, msg *Message) *Object
- func SequenceToBase(vm *VM, target, locals *Object, msg *Message) *Object
- func SequenceURLDecoded(vm *VM, target, locals *Object, msg *Message) *Object
- func SequenceURLEncoded(vm *VM, target, locals *Object, msg *Message) *Object
- func SequenceUnescape(vm *VM, target, locals *Object, msg *Message) *Object
- func SequenceUnpack(vm *VM, target, locals *Object, msg *Message) *Object
- func SequenceUppercase(vm *VM, target, locals *Object, msg *Message) *Object
- func SequenceValidEncodings(vm *VM, target, locals *Object, msg *Message) *Object
- func SequenceWithStruct(vm *VM, target, locals *Object, msg *Message) *Object
- func SequenceZero(vm *VM, target, locals *Object, msg *Message) *Object
- func SystemActiveCpus(vm *VM, target, locals *Object, msg *Message) *Object
- func SystemExit(vm *VM, target, locals *Object, msg *Message) *Object
- func SystemGetEnvironmentVariable(vm *VM, target, locals *Object, msg *Message) *Object
- func SystemSetEnvironmentVariable(vm *VM, target, locals *Object, msg *Message) *Object
- func SystemSetLobby(vm *VM, target, locals *Object, msg *Message) *Object
- func SystemThisProcessPid(vm *VM, target, locals *Object, msg *Message) *Object
- func (o *Object) Activate(vm *VM, target, locals, context *Object, msg *Message) *Object
- func (o *Object) AppendProto(proto *Object)
- func (o *Object) Clone() *Object
- func (o *Object) ForeachProto(exec func(p *Object) bool)
- func (o *Object) IsKindOf(kind *Object) bool
- func (o *Object) PrependProto(proto *Object)
- func (o *Object) Protos() []*Object
- func (o *Object) RemoveProto(proto *Object)
- func (o *Object) SetProtos(protos ...*Object)
- func (o *Object) Tag() Tag
- func (o *Object) UniqueID() uintptr
- type RemoteStop
- type Scheduler
- type SeqKind
- type Sequence
- func (s Sequence) Append(other Sequence) Sequence
- func (s Sequence) At(i int) (float64, bool)
- func (s Sequence) Bytes() []byte
- func (s Sequence) BytesN(n int) []byte
- func (s Sequence) CheckMutable(name string) error
- func (s Sequence) CheckNumeric(name string, mutable bool) error
- func (s Sequence) Compare(other Sequence) int
- func (s Sequence) Convert(kind SeqKind) Sequence
- func (s Sequence) Find(other Sequence, start int) int
- func (s Sequence) FirstRune() (rune, int)
- func (s Sequence) FixIndex(i int) int
- func (s Sequence) Insert(other Sequence, k int) Sequence
- func (s Sequence) IsFP() bool
- func (s Sequence) IsMutable() bool
- func (s Sequence) ItemSize() int
- func (s Sequence) Kind() SeqKind
- func (s Sequence) Len() int
- func (s Sequence) MapBinary(op func(float64, float64) float64, t Sequence, def float64)
- func (s Sequence) MapUnary(op func(float64) float64)
- func (s Sequence) MinCode() string
- func (s Sequence) NumberString() string
- func (s Sequence) RFind(other Sequence, end int) int
- func (s Sequence) Reduce(op func(float64, float64) float64, ic float64) float64
- func (s Sequence) Remove(i, j int) Sequence
- func (s Sequence) SameType(as Sequence) bool
- func (s Sequence) Slice(start, stop, step int) Sequence
- func (s Sequence) String() string
- type Slots
- type Stop
- type SyncSlot
- type Tag
- type VM
- func (vm *VM) ActivateBlock(blk, target, locals, context *Object, msg *Message) *Object
- func (vm *VM) AddonProto(name string) []*Object
- func (vm *VM) AsBool(obj *Object) bool
- func (vm *VM) AsString(obj *Object) string
- func (vm *VM) CachedMessage(v *Object) *Message
- func (vm *VM) CheckEncoding(encoding string) bool
- func (vm *VM) Compare(x, y *Object) (c int, obj *Object, stop Stop)
- func (vm *VM) CoreProto(name string) []*Object
- func (vm *VM) DebugMessage(target, locals *Object, msg *Message)
- func (vm *VM) DoMessage(msg *Message, locals *Object) (*Object, Stop)
- func (vm *VM) DoReader(src io.Reader, label string) (*Object, Stop)
- func (vm *VM) DoString(src string, label string) (*Object, Stop)
- func (vm *VM) ForeachSlot(obj *Object, exec func(name string, sy SyncSlot) bool)
- func (vm *VM) GetAllSlots(obj *Object) Slots
- func (vm *VM) GetLocalSlot(obj *Object, slot string) (value *Object, ok bool)
- func (vm *VM) GetLocalSlotSync(obj *Object, slot string) SyncSlot
- func (vm *VM) GetSlot(obj *Object, slot string) (value, proto *Object)
- func (vm *VM) GetSlotSync(obj *Object, slot string) (s SyncSlot, proto *Object)
- func (vm *VM) IdentMessage(s string, args ...*Message) *Message
- func (vm *VM) Install(name string, proto *Object)
- func (vm *VM) IoBool(c bool) *Object
- func (vm *VM) IoError(err interface{}) *Object
- func (vm *VM) IsAlive() bool
- func (vm *VM) LoadAddon(addon Addon) <-chan struct{}
- func (vm *VM) MessageObject(msg *Message) *Object
- func (vm *VM) MustDoString(src string) *Object
- func (vm *VM) NewBlock(msg *Message, scope *Object, args ...string) *Object
- func (vm *VM) NewCFunction(f Fn, kind Tag) *Object
- func (vm *VM) NewCall(sender, actor *Object, msg *Message, target, context *Object) *Object
- func (vm *VM) NewException(err error) *Object
- func (vm *VM) NewExceptionf(format string, args ...interface{}) *Object
- func (vm *VM) NewList(items ...*Object) *Object
- func (vm *VM) NewLocals(self, call *Object) *Object
- func (vm *VM) NewMap(value map[string]*Object) *Object
- func (vm *VM) NewNumber(value float64) *Object
- func (vm *VM) NewObject(slots Slots) *Object
- func (vm *VM) NewSequence(value interface{}, mutable bool, encoding string) *Object
- func (vm *VM) NewString(str string) *Object
- func (vm *VM) NumberMessage(v float64) *Message
- func (vm *VM) ObjectWith(slots Slots, protos []*Object, value interface{}, tag Tag) *Object
- func (vm *VM) OpShuffle(msg *Object) (err error)
- func (vm *VM) Parse(source io.Reader, label string) (msg *Message, err error)
- func (vm *VM) ParseScanner(src io.RuneScanner, label string) (msg *Message, err error)
- func (vm *VM) ParseUnshuffled(source io.Reader, label string) (msg *Message, err error)
- func (vm *VM) Perform(target, locals *Object, msg *Message) (result *Object, control Stop)
- func (vm *VM) Raise(exc *Object) *Object
- func (vm *VM) RaiseException(msg error) *Object
- func (vm *VM) RaiseExceptionf(format string, args ...interface{}) *Object
- func (vm *VM) RemoveAllSlots(obj *Object)
- func (vm *VM) RemoveSlot(obj *Object, slots ...string)
- func (vm *VM) SequenceFromBytes(b []byte, kind SeqKind) Sequence
- func (vm *VM) SequenceObject(value Sequence) *Object
- func (vm *VM) SetLaunchScript(path string)
- func (vm *VM) SetSlot(obj *Object, slot string, value *Object)
- func (vm *VM) SetSlotSync(obj *Object, slot string) SyncSlot
- func (vm *VM) SetSlots(obj *Object, slots Slots)
- func (vm *VM) Status(result *Object) (*Object, Stop)
- func (vm *VM) Stop(result *Object, stop Stop) *Object
- func (vm *VM) StringMessage(s string) *Message
- func (vm *VM) TypeName(o *Object) string
- func (vm *VM) VMFor(coro *Object) *VM
Constants ¶
const IoSpecVer = "0.0.0"
IoSpecVer is the Io language version, used for the System iospecVersion slot.
const IoVersion = "1"
IoVersion is the interpreter version, used for the System version slot. It bears no relation to versions of the original implementation.
const NumberTag = BasicTag("Number")
NumberTag is the tag for Number objects.
const SchedulerTag = BasicTag("Scheduler")
SchedulerTag is the Tag for the Scheduler.
const SeqMaxItemSize = 8
SeqMaxItemSize is the maximum size in bytes of a single sequence element.
Variables ¶
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.
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.
var CFunctionTag tagCFunction
CFunctionTag is the tag for CFunctions. Activate calls the wrapped function. CloneValue returns the same function.
var CallTag tagCall
CallTag is the Tag for Call objects. Activate returns self. CloneValue creates a Call with all fields set to nil.
var CoroutineTag tagCoro
CoroutineTag is the Tag for Coroutine objects. Activate returns the coroutine. CloneValue creates a new control flow channel and no debugging.
var DebuggerTag tagDebugger
DebuggerTag is the tag for Debugger objects. Activate returns self. CloneValue creates a new debug channel.
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.
var ListTag tagList
ListTag is the Tag for List objects. Activate returns self. CloneValue creates a shallow copy of the parent's list value.
var MapTag tagMap
MapTag is the Tag for Map objects. Activate returns self. CloneValue copies the keys and values in the map.
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.)
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 PtrCompare ¶
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 ¶
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) CloneValue ¶
func (t BasicTag) CloneValue(value interface{}) interface{}
CloneValue returns value.
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 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.
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 ¶
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 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 ¶
ForeachArgs gets the arguments for a foreach method utilizing the standard foreach([[key,] value,] message) syntax.
func (*Message) ArgAt ¶
ArgAt returns the argument at position n, or nil if the position is out of bounds.
func (*Message) AsStringArgAt ¶
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 ¶
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 ¶
DeepCopy creates a copy of the message linked to copies of each message forward.
func (*Message) Eval ¶
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) InsertAfter ¶
InsertAfter links another message to follow this one.
func (*Message) IsStart ¶
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 ¶
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 ¶
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 ¶
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) NumberArgAt ¶
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 ¶
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 ¶
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 ¶
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) StringArgAt ¶
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 ¶
BlockArgumentNames is a Block method.
argumentNames returns a list of the argument names of the block.
func BlockAsString ¶
BlockAsString is a Block method.
asString creates a string representation of an object.
func BlockPassStops ¶
BlockPassStops is a Block method.
passStops returns whether the block returns control flow signals upward.
func BlockPerformOn ¶
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 ¶
BlockScope is a Block method.
scope returns the scope of the block, or nil if the block is a method.
func BlockSetArgumentNames ¶
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 ¶
BlockSetMessage is a Block method.
setMessage changes the message executed by the block.
func BlockSetPassStops ¶
BlockSetPassStops is a Block method.
setPassStops changes whether the block allows control flow signals to propagate out to the block's caller.
func BlockSetScope ¶
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 ¶
CFunctionAsString is a CFunction method.
asString returns a string representation of the object.
func CFunctionEqual ¶
CFunctionEqual is a CFunction method.
== returns whether the two CFunctions hold the same internal function.
func CFunctionID ¶
CFunctionID is a CFunction method.
id returns a unique number for the function invoked by the CFunction.
func CFunctionPerformOn ¶
CFunctionPerformOn is a CFunction method.
performOn activates the CFunction using the supplied settings.
func CFunctionTypeName ¶
CFunctionTypeName is a CFunction method.
typeName returns the name of the type to which the CFunction is assigned.
func CFunctionUniqueName ¶
CFunctionUniqueName is a CFunction method.
uniqueName returns the name of the function.
func CallActivated ¶
CallActivated is a Call method.
activated returns the currently executing block.
func CallCoroutine ¶
CallCoroutine is a Call method.
coroutine returns the coroutine in which this block is executing.
func CallMessage ¶
CallMessage is a Call method.
message returns the message which caused the current block to activate.
func CallSender ¶
CallSender is a Call method.
sender returns the local context in which this block was activated.
func CallSetStopStatus ¶
CallSetStopStatus is a Call method.
setStopStatus sets a control flow status to propagate to the caller.
func CallSlotContext ¶
CallSlotContext is a Call method.
slotContext returns the object which held the slot containing the executing block.
func CallStopStatus ¶
CallStopStatus is a Call method.
stopStatus returns the control flow type that will propagate to the caller.
func CallTarget ¶
CallTarget is a Call method.
target returns the object to which the message which activated the executing block was sent.
func CoreInstall ¶
CoreInstall is a transitional proxy to vm.coreInstall for core extensions.
func ExceptionError ¶
ExceptionError is an Exception method.
error returns the exception's error message.
func ExceptionRaise ¶
ExceptionRaise is an Exception method.
raise creates an exception with the given error message and raises it.
func ExceptionRaiseFrom ¶
ExceptionRaiseFrom is an Exception method.
raiseFrom raises an exception from the given call site.
func ExceptionSetError ¶
ExceptionSetError is an Exception method.
setError sets the exception's error message.
func ExceptionStack ¶
ExceptionStack is an Exception method.
stack returns the message stack of the exception.
func ListAppendIfAbsent ¶
ListAppendIfAbsent is a List method.
appendIfAbsent adds items to the end of the list if they are not already in it.
func ListAppendSeq ¶
ListAppendSeq is a List method.
appendSeq adds the items in the given lists to the list.
func ListAsString ¶
ListAsString is a List method.
asString creates a string representation of an object.
func ListAt ¶
ListAt is a List method.
at returns the nth item in the list. All out-of-bounds values are nil.
func ListAtInsert ¶
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 ListCapacity ¶
ListCapacity is a List method.
capacity is the number of items for which the list has allocated space.
func ListCompare ¶
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 ¶
ListContains is a List method.
contains returns true if the list contains an item equal to the given object.
func ListContainsAll ¶
ListContainsAll is a List method.
containsAll returns true if the list contains items equal to each of the given objects.
func ListContainsAny ¶
ListContainsAny is a List method.
containsAny returns true if the list contains an item equal to any of the given objects.
func ListContainsIdenticalTo ¶
ListContainsIdenticalTo is a List method.
containsIdenticalTo returns true if the list contains exactly the given object.
func ListForeach ¶
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 ¶
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 ¶
ListPreallocateToSize is a List method.
preallocateToSize ensures that the list has capacity for at least n items.
func ListRemove ¶
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 ListRemoveAt ¶
ListRemoveAt is a List method.
removeAt removes the item in the given position from the list.
func ListReverseForeach ¶
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 ¶
ListReverseInPlace is a List method.
reverseInPlace reverses the order of items in the list.
func ListSetSize ¶
ListSetSize is a List method.
setSize changes the size of the list, removing items from or adding nils to the end as necessary.
func ListSliceInPlace ¶
ListSliceInPlace is a List method.
sliceInPlace reduces the list to a selected linear portion.
func ListSortInPlace ¶
ListSortInPlace is a List method.
sortInPlace sorts the list according to the items' compare method.
func ListSortInPlaceBy ¶
ListSortInPlaceBy is a List method.
sortInPlaceBy sorts the list using a given compare block.
func ListSwapIndices ¶
ListSwapIndices is a List method.
swapIndices swaps the values in two positions in the list.
func LocalsForward ¶
LocalsForward is a Locals method.
forward handles messages to which the object does not respond.
func LocalsUpdateSlot ¶
LocalsUpdateSlot is a Locals method.
updateSlot changes the value of an existing slot.
func MapAt ¶
MapAt is a Map method.
at returns the value at the given key, or the default value if it is missing.
func MapAtIfAbsentPut ¶
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 MapForeach ¶
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 MapValues ¶
MapValues is a Map method.
values returns a list of all values in the map in random order.
func MessageAppendArg ¶
MessageAppendArg is a Message method.
appendArg adds a message as an argument to the message.
func MessageAppendCachedArg ¶
MessageAppendCachedArg is a Message method.
appendCachedArg adds a value as an argument to the message.
func MessageArgAt ¶
MessageArgAt is a Message method.
argAt returns the nth argument, or nil if out of bounds.
func MessageArgCount ¶
MessageArgCount is a Message method.
argCount returns the number of arguments to the message.
func MessageArgsEvaluatedIn ¶
MessageArgsEvaluatedIn is a Message method.
argsEvaluatedIn returns a list containing the message arguments evaluated in the context of the given object.
func MessageArguments ¶
MessageArguments is a Message method.
arguments returns a list of the arguments to the message as messages.
func MessageAsMessageWithEvaluatedArgs ¶
MessageAsMessageWithEvaluatedArgs is a Message method.
asMessageWithEvaluatedArgs creates a copy of the message with its arguments evaluated.
func MessageAsString ¶
MessageAsString is a Message method.
asString creates a string representation of an object.
func MessageCachedResult ¶
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 ¶
MessageCharacterNumber is a Message method.
characterNumber returns the column number of the character within the line at which the message was parsed.
func MessageDoInContext ¶
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 ¶
MessageFromString is a Message method.
fromString parses the string into a message chain.
func MessageHasCachedResult ¶
MessageHasCachedResult is a Message method.
hasCachedResult returns whether the message has a cached value to which the message will evaluate.
func MessageIsEndOfLine ¶
MessageIsEndOfLine is a Message method.
isEndOfLine returns whether the message is a terminator.
func MessageLabel ¶
MessageLabel is a Message method.
label returns the message's label, typically the name of the file from which it was parsed.
func MessageLastBeforeEndOfLine ¶
MessageLastBeforeEndOfLine is a Message method.
lastBeforeEndOfLine returns the last message in the chain before a terminator.
func MessageLineNumber ¶
MessageLineNumber is a Message method.
lineNumber returns the line number at which the message was parsed.
func MessageNext ¶
MessageNext is a Message method.
next returns the next message in the chain, or nil if this is the last one.
func MessageNextIgnoreEndOfLines ¶
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 ¶
MessageOpShuffle is a Message method.
opShuffle performs operator precedence shuffling on the message using the message's OperatorTable.
func MessagePrevious ¶
MessagePrevious is a Message method.
previous returns the previous message in the chain.
func MessageRemoveCachedResult ¶
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 ¶
MessageSetArguments is a Message method.
setArguments sets the message's arguments to deep copies of the messages in the list argument.
func MessageSetCachedResult ¶
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 ¶
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 ¶
MessageSetLabel is a Message method.
setLabel sets the label of the message to the given string.
func MessageSetLineNumber ¶
MessageSetLineNumber is a Message method.
setLineNumber sets the line number of the message to the given integer.
func MessageSetName ¶
MessageSetName is a Message method.
setName sets the message name to the given string.
func MessageSetNext ¶
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 NumberAsBuffer ¶
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 ¶
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 ¶
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 ¶
NumberAsString is a Number method.
asString returns the decimal string representation of the target.
func NumberAsUint32Buffer ¶
NumberAsUint32Buffer is a Number method.
asUint32Buffer returns a 4-byte buffer representing the target's value converted to a uint32.
func NumberAsUppercase ¶
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 NumberAt ¶
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 NumberAtan2 ¶
NumberAtan2 is a Number method.
atan2 returns the directional arctangent of the target divided by the argument.
func NumberBetween ¶
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 ¶
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 ¶
NumberBitwiseComplement is a Number method.
bitwiseComplement returns the bitwise complement of the 64-bit integer value of the target.
func NumberBitwiseOr ¶
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 ¶
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 ¶
NumberCeil is a Number method.
ceil returns the smallest integer larger than or equal to the target.
func NumberClip ¶
NumberClip is a Number method.
clip returns the target if it is between the given bounds or else the exceeded bound.
func NumberCompare ¶
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 NumberCubed ¶
NumberCubed is a Number method.
cubed returns the target raised to the third power.
func NumberDiv ¶
NumberDiv is a Number method.
/ is an operator which divides the left value by the right.
func NumberExp ¶
NumberExp is a Number method.
exp returns e (the base of the natural logarithm) raised to the power of the target.
func NumberFactorial ¶
NumberFactorial is a Number method.
factorial computes the product of each integer between 1 and the target.
func NumberFloor ¶
NumberFloor is a Number method.
floor returns the largest integer smaller than or equal to the target.
func NumberIsAlphaNumeric ¶
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 ¶
NumberIsControlCharacter is a Number method.
isControlCharacter is true if the target is a Unicode codepoint corresponding to a control character.
func NumberIsDigit ¶
NumberIsDigit is a Number method.
isDigit is true if the target is a Unicode codepoint corresponding to a decimal digit.
func NumberIsEven ¶
NumberIsEven is a Number method.
isEven is true if the integer value of the target is divisible by 2.
func NumberIsGraph ¶
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 ¶
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 ¶
NumberIsLetter is a Number method.
isLetter is true if the target is a Unicode codepoint corresponding to a letter (category L).
func NumberIsLowercase ¶
NumberIsLowercase is a Number method.
isLowercase is true if the target is a Unicode codepoint corresponding to a lowercase letter (category Ll).
func NumberIsNan ¶
NumberIsNan is a Number method.
isNan is true if the target is an IEEE-754 Not a Number.
func NumberIsOdd ¶
NumberIsOdd is a Number method.
isOdd is true if the integer value of the target is not divisible by 2.
func NumberIsPrint ¶
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 ¶
NumberIsPunctuation is a Number method.
isPunctuation is true if the target is a Unicode codepoint corresponding to a punctuation character (category P).
func NumberIsSpace ¶
NumberIsSpace is a Number method.
isSpace is true if the target is a Unicode codepoint corresponding to a space character.
func NumberIsUppercase ¶
NumberIsUppercase is a Number method.
isUppercase is true if the target is a Unicode codepoint corresponding to an uppercase letter (category Lu).
func NumberLog10 ¶
NumberLog10 is a Number method.
log10 returns the base-10 logarithm of the target.
func NumberMax ¶
NumberMax is a Number method.
max returns the larger of the target and the argument.
func NumberMin ¶
NumberMin is a Number method.
min returns the smaller of the target and the argument.
func NumberMod ¶
NumberMod is a Number method.
mod returns the remainder of division of the target by the argument.
func NumberPow ¶
NumberPow is a Number method.
pow returns the target raised to the power of the argument. The ** operator is equivalent.
func NumberRepeat ¶
NumberRepeat is a Number method.
repeat performs a loop the given number of times.
func NumberRound ¶
NumberRound is a Number method.
round returns the integer nearest the target, with halfway cases rounding away from zero.
func NumberRoundDown ¶
NumberRoundDown is a Number method.
roundDown returns the integer nearest the target, with halfway cases rounding toward positive infinity.
func NumberShiftLeft ¶
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 ¶
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 NumberSquared ¶
NumberSquared is a Number method.
squared returns the target raised to the second power.
func NumberSub ¶
NumberSub is a Number method.
- is an operator which subtracts the right value from the left.
func NumberToBase ¶
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 ¶
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 ¶
NumberToggle is a Number method.
toggle returns 1 if the target is 0, otherwise 0.
func ObjectAncestorWithSlot ¶
ObjectAncestorWithSlot is an Object method.
ancestorWithSlot returns the proto which owns the given slot.
func ObjectAppendProto ¶
ObjectAppendProto is an Object method.
appendProto adds an object as a proto to the object.
func ObjectAsGoRepr ¶
ObjectAsGoRepr is an Object method.
asGoRepr returns a string containing a Go-syntax representation of the object's value.
func ObjectAsString ¶
ObjectAsString is an Object method.
asString creates a string representation of an object.
func ObjectBlock ¶
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 ¶
ObjectBreak is an Object method.
break ceases execution of a loop and returns a value from it.
func ObjectClone ¶
ObjectClone is an Object method.
clone creates a new object with empty slots and the cloned object as its proto.
func ObjectCloneWithoutInit ¶
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 ¶
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 ¶
ObjectContextWithSlot is an Object method.
contextWithSlot returns the first of the receiver or its protos which contains the given slot.
func ObjectContinue ¶
ObjectContinue is an Object method.
continue immediately returns to the beginning of the current loop.
func ObjectDo ¶
ObjectDo is an Object method.
do evaluates its message in the context of the receiver.
func ObjectDoFile ¶
ObjectDoFile is an Object method.
doFile executes the file at the given path in the context of the receiver.
func ObjectDoMessage ¶
ObjectDoMessage is an Object method.
doMessage sends the message to the receiver.
func ObjectDoString ¶
ObjectDoString is an Object method.
doString executes the string in the context of the receiver.
func ObjectEqual ¶
ObjectEqual is an Object method.
x ==(y) returns true if the result of x compare(y) is 0.
func ObjectEvalArg ¶
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 ¶
ObjectEvalArgAndReturnNil is an Object method.
evalArgAndReturnNil evaluates its argument and returns nil.
func ObjectEvalArgAndReturnSelf ¶
ObjectEvalArgAndReturnSelf is an Object method.
evalArgAndReturnSelf evaluates its argument and returns this object.
func ObjectFor ¶
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 ¶
ObjectForeachSlot is a Object method.
foreachSlot performs a loop on each slot of an object.
func ObjectGetLocalSlot ¶
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 ¶
ObjectGetSlot is an Object method.
getSlot gets the value of a slot. The slot is never activated.
func ObjectGreater ¶
ObjectGreater is an Object method.
x >(y) returns true if the result of x compare(y) is 1.
func ObjectGreaterOrEqual ¶
ObjectGreaterOrEqual is an Object method.
x >=(y) returns true if the result of x compare(y) is not -1.
func ObjectHasLocalSlot ¶
ObjectHasLocalSlot is an Object method.
hasLocalSlot returns whether the object has the given slot name, not checking its protos.
func ObjectIf ¶
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 ¶
ObjectIsIdenticalTo is an Object method.
isIdenticalTo returns whether the object is the same as the argument.
func ObjectIsKindOf ¶
ObjectIsKindOf is an Object method.
isKindOf returns whether the object is the argument or has the argument among its protos.
func ObjectLess ¶
ObjectLess is an Object method.
x <(y) returns true if the result of x compare(y) is -1.
func ObjectLessOrEqual ¶
ObjectLessOrEqual is an Object method.
x <=(y) returns true if the result of x compare(y) is not 1.
func ObjectLexicalDo ¶
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 ObjectMethod ¶
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 ¶
ObjectNotEqual is an Object method.
x !=(y) returns true if the result of x compare(y) is not 0.
func ObjectPerform ¶
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 ¶
ObjectPerformWithArgList is an Object method.
performWithArgList activates the given method with arguments given in the second argument as a list.
func ObjectPrependProto ¶
ObjectPrependProto is an Object method.
prependProto adds a new proto as the first in the object's protos.
func ObjectPrint ¶
ObjectPrint is an Object method.
print converts the receiver to a string and prints it.
func ObjectProtos ¶
ObjectProtos is an Object method.
protos returns a list of the receiver's protos.
func ObjectRemoveAllProtos ¶
ObjectRemoveAllProtos is an Object method.
removeAllProtos removes all protos from the object.
func ObjectRemoveAllSlots ¶
ObjectRemoveAllSlots is an Object method.
removeAllSlots removes all slots from the object.
func ObjectRemoveProto ¶
ObjectRemoveProto is an Object method.
removeProto removes the given object from the object's protos.
func ObjectRemoveSlot ¶
ObjectRemoveSlot is an Object method.
removeSlot removes the given slot from the object.
func ObjectReturn ¶
ObjectReturn is an Object method.
return ceases execution of a block and returns a value from it.
func ObjectSetProto ¶
ObjectSetProto is an Object method.
setProto sets the object's proto list to have only the given object.
func ObjectSetProtos ¶
ObjectSetProtos is an Object method.
setProtos sets the object's protos to the objects in the given list.
func ObjectSetSlot ¶
ObjectSetSlot is an Object method.
setSlot sets the value of a slot on this object. It is typically invoked via the := operator.
func ObjectShallowCopy ¶
ObjectShallowCopy is an Object method.
shallowCopy creates a new object with the receiver's slots and protos.
func ObjectSlotNames ¶
ObjectSlotNames is an Object method.
slotNames returns a list of the names of the slots on this object.
func ObjectSlotValues ¶
ObjectSlotValues is an Object method.
slotValues returns a list of the values of the slots on this obect.
func ObjectStopStatus ¶
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 ¶
ObjectThisContext is an Object method.
thisContext returns the current slot context, which is the receiver.
func ObjectThisLocalContext ¶
ObjectThisLocalContext is an Object method.
thisLocalContext returns the current locals object.
func ObjectThisMessage ¶
ObjectThisMessage is an Object method.
thisMessage returns the message which activated this method, which is likely to be thisMessage.
func ObjectTry ¶
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 ¶
ObjectUniqueID is an Object method.
uniqueId returns a string representation of the object's address.
func ObjectUpdateSlot ¶
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 ¶
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 ¶
ObjectWhile is an Object method.
while performs a loop as long as a condition, its first argument, evaluates to true.
func SchedulerAwaitingCoros ¶
SchedulerAwaitingCoros is a Scheduler method.
awaitingCoros returns a list of all coroutines which are waiting on another coroutine.
func SchedulerCoroCount ¶
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 ¶
SchedulerYieldingCoros is a Scheduler method.
yieldingCoros returns a list of all running coroutines except the current one.
func SequenceAbs ¶
SequenceAbs is a Sequence method.
abs sets each element of the receiver to its absolute value.
func SequenceAcos ¶
SequenceAcos is a Sequence method.
acos sets each element of the receiver to its arc-cosine.
func SequenceAfterSeq ¶
SequenceAfterSeq is a Sequence method.
afterSeq returns the portion of the sequence which follows the first instance of the argument sequence.
func SequenceAppendPathSeq ¶
SequenceAppendPathSeq is a Sequence method.
appendPathSeq appends a path element to the sequence, removing extra path separators between.
func SequenceAppendSeq ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
SequenceAsIoPath is a Sequence method.
asIoPath creates a sequence converting the receiver to Io's path convention.
func SequenceAsJSON ¶
SequenceAsJSON is a Sequence method.
asJson creates a JSON representation of the sequence.
func SequenceAsLatin1 ¶
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 ¶
SequenceAsList is a Sequence method.
asList creates a list containing each element of the sequence.
func SequenceAsMessage ¶
SequenceAsMessage is a Sequence method.
asMessage compiles the sequence to a Message.
func SequenceAsMutable ¶
SequenceAsMutable is a Sequence method.
asMutable creates a mutable copy of the sequence.
func SequenceAsNumber ¶
SequenceAsNumber is a Sequence method.
asNumber parses the sequence as a numeric representation.
func SequenceAsOSPath ¶
SequenceAsOSPath is a Sequence method.
asOSPath creates a sequence converting the receiver to the host operating system's path convention.
func SequenceAsStruct ¶
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 ¶
SequenceAsSymbol is a Sequence method.
asSymbol creates an immutable copy of the sequence.
func SequenceAsUTF16 ¶
SequenceAsUTF16 is a Sequence method.
asUTF16 creates a Sequence encoding the receiver in UTF-16.
func SequenceAsUTF32 ¶
SequenceAsUTF32 is a Sequence method.
asUTF32 creates a Sequence encoding the receiver in UTF-32.
func SequenceAsUTF8 ¶
SequenceAsUTF8 is a Sequence method.
asUTF8 creates a Sequence encoding the receiver in UTF-8.
func SequenceAsin ¶
SequenceAsin is a Sequence method.
asin sets each element of the receiver to its arcsine.
func SequenceAtInsertSeq ¶
SequenceAtInsertSeq is a Sequence method.
atInsertSeq inserts at the index given in the first argument the object asString in the second.
func SequenceAtPut ¶
SequenceAtPut is a Sequence method.
atPut replaces the element at the given position with the given value, growing the sequence if necessary.
func SequenceAtan ¶
SequenceAtan is a Sequence method.
atan sets each element of the receiver to its arctangent.
func SequenceBeforeSeq ¶
SequenceBeforeSeq is a Sequence method.
beforeSeq returns the portion of the sequence which precedes the first instance of the argument sequence.
func SequenceBeginsWithSeq ¶
SequenceBeginsWithSeq is a Sequence method.
beginsWithSeq determines whether the sequence begins with the argument sequence in the bytewise sense.
func SequenceBetween ¶
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 ¶
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 ¶
SequenceBitCount is a Sequence method.
bitCount returns the number of 1 bits in the sequence.
func SequenceBitwiseAnd ¶
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 ¶
SequenceBitwiseNot is a Sequence method.
bitwiseNot sets the receiver to the bitwise NOT of its binary representation.
func SequenceBitwiseOr ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
SequenceClipAfterSeq is a Sequence method.
clipAfterSeq removes the portion of the sequence which follows the end of the argument sequence.
func SequenceClipAfterStartOfSeq ¶
SequenceClipAfterStartOfSeq is a Sequence method.
clipAfterStartOfSeq removes the portion of the sequence which follows the beginning of the argument sequence.
func SequenceClipBeforeEndOfSeq ¶
SequenceClipBeforeEndOfSeq is a Sequence method.
clipBeforeEndOfSeq removes the portion of the sequence which precedes the end of the argument sequence.
func SequenceClipBeforeSeq ¶
SequenceClipBeforeSeq is a Sequence method.
clipBeforeSeq removes the portion of the sequence which precedes the beginning of the argument sequence.
func SequenceCloneAppendPath ¶
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 ¶
SequenceCloneAppendSeq is a Sequence method.
cloneAppendSeq creates a new symbol with the elements of the argument appended to those of the receiver.
func SequenceCompare ¶
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 ¶
SequenceContains is a Sequence method.
contains returns true if any element of the sequence is equal to the given Number.
func SequenceContainsSeq ¶
SequenceContainsSeq is a Sequence method.
containsSeq returns true if the receiver contains the argument sequence.
func SequenceConvertToFixedSizeType ¶
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 ¶
SequenceConvertToItemType is a Sequence method.
convertToItemType changes the item type of the sequence.
func SequenceCopy ¶
SequenceCopy is a Sequence method.
copy sets the receiver to be a copy of the given sequence.
func SequenceCos ¶
SequenceCos is a Sequence method.
cos sets each element of the receiver to its cosine.
func SequenceCosh ¶
SequenceCosh is a Sequence method.
cosh sets each element of the receiver to its hyperbolic cosine.
func SequenceDistanceTo ¶
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 ¶
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 ¶
SequenceDuplicateIndexes is a Sequence method.
duplicateIndexes inserts a copy of each item in the sequence after its position.
func SequenceEmpty ¶
SequenceEmpty is a Sequence method.
empty zeroes all values in the sequence and sets its length to zero.
func SequenceEncoding ¶
SequenceEncoding is a Sequence method.
encoding returns the sequence's encoding.
func SequenceEndsWithSeq ¶
SequenceEndsWithSeq is a Sequence method.
endsWithSeq determines whether the sequence ends with the argument sequence in the bytewise sense.
func SequenceEscape ¶
SequenceEscape is a Sequence method.
escape replaces control and non-printable characters with backslash-escaped equivalents.
func SequenceExSlice ¶
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 ¶
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 ¶
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 ¶
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 ¶
SequenceForeach is a Sequence method.
foreach performs a loop for each element of the sequence.
func SequenceFromBase ¶
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 ¶
SequenceFromBase64 is a Sequence method.
fromBase64 decodes standard (RFC 4648) base64 data from the sequence interpreted bytewise.
func SequenceHash ¶
SequenceHash is a Sequence method.
hash returns a hash of the sequence as a number.
func SequenceInSlice ¶
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 ¶
SequenceInsertSeqEvery is a Sequence method.
insertSeqEvery inserts the argument sequence into the receiver at every nth position.
func SequenceInterpolate ¶
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 ¶
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 ¶
SequenceIsMutable is a Sequence method.
isMutable returns whether the sequence is mutable.
func SequenceIsUppercase ¶
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 ¶
SequenceIsZero is a Sequence method.
isZero returns whether all elements of the sequence are zero.
func SequenceItemSize ¶
SequenceItemSize is a Sequence method.
itemSize returns the size in bytes of each item in the sequence.
func SequenceItemType ¶
SequenceItemType is a Sequence method.
itemType returns the type of the values in the sequence.
func SequenceLastPathComponent ¶
SequenceLastPathComponent is a Sequence method.
lastPathComponent returns the basename of the sequence.
func SequenceLeaveThenRemove ¶
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 ¶
SequenceLog is a Sequence method.
log sets each element of the receiver to its natural logarithm.
func SequenceLog10 ¶
SequenceLog10 is a Sequence method.
log10 sets each element of the receiver to its common logarithm.
func SequenceLowercase ¶
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 ¶
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 ¶
SequenceMax is a Sequence method.
max returns the maximum element in the sequence.
func SequenceMean ¶
SequenceMean is a Sequence method.
mean computes the arithmetic mean of the elements in the sequence.
func SequenceMeanSquare ¶
SequenceMeanSquare is a Sequence method.
meanSquare computes the arithmetic mean of the squares of the elements in the sequence.
func SequenceMin ¶
SequenceMin is a Sequence method.
min returns the minimum element in the sequence.
func SequenceMinusEq ¶
SequenceMinusEq is a Sequence method.
-= sets each element of the receiver to its value minus the respective element of the argument.
func SequenceNegate ¶
SequenceNegate is a Sequence method.
negate sets each element of the receiver to its opposite.
func SequenceNormalize ¶
SequenceNormalize is a Sequence method.
normalize divides each element of the receiver by the sequence's L2 norm.
func SequenceOccurrencesOfSeq ¶
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 ¶
SequencePack is a Sequence method.
pack forms a packed binary sequence with the given format.
func SequencePairwiseMax ¶
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 ¶
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 ¶
SequenceParseJSON is a Sequence method.
parseJson decodes the JSON represented by the receiver.
func SequencePathComponent ¶
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 ¶
SequencePathExtension is a Sequence method.
pathExtension returns a new Sequence with the receiver past the last period.
func SequencePercentDecoded ¶
SequencePercentDecoded is a Sequence method.
percentDecoded unescapes the receiver as a URL path segment.
func SequencePercentEncoded ¶
SequencePercentEncoded is a Sequence method.
percentEncoded escapes the receiver as a URL path segment.
func SequencePlusEq ¶
SequencePlusEq is a Sequence method.
+= sets each element of the receiver to its value plus the respective element of the argument.
func SequencePreallocateToSize ¶
SequencePreallocateToSize is a Sequence method.
preallocateToSize ensures that the receiver can grow to be at least n bytes without reallocating.
func SequenceProduct ¶
SequenceProduct is a Sequence method.
product returns the product of the elements of the sequence.
func SequenceRangeFill ¶
SequenceRangeFill is a Sequence method.
rangeFill sets each element of the sequence to its index.
func SequenceRemoveAt ¶
SequenceRemoveAt is a Sequence method.
removeAt removes the nth element from the sequence.
func SequenceRemoveEvenIndexes ¶
SequenceRemoveEvenIndexes is a Sequence method.
removeEvenIndexes deletes each element whose index in the sequence is even.
func SequenceRemoveLast ¶
SequenceRemoveLast is a Sequence method.
removeLast removes the last element from the sequence and returns the receiver.
func SequenceRemoveOddIndexes ¶
SequenceRemoveOddIndexes is a Sequence method.
removeOddIndexes deletes each element whose index in the sequence is odd.
func SequenceRemovePrefix ¶
SequenceRemovePrefix is a Sequence method.
removePrefix removes a prefix from the receiver, if present.
func SequenceRemoveSeq ¶
SequenceRemoveSeq is a Sequence method.
removeSeq removes all occurrences of a sequence from the receiver.
func SequenceRemoveSlice ¶
SequenceRemoveSlice is a Sequence method.
removeSlice removes items between the given start and end, inclusive.
func SequenceRemoveSuffix ¶
SequenceRemoveSuffix is a Sequence method.
removeSuffix removes a suffix from the receiver, if present.
func SequenceReplaceFirstSeq ¶
SequenceReplaceFirstSeq is a Sequence method.
replaceFirstSeq replaces the first instance of a sequence with another.
func SequenceReplaceSeq ¶
SequenceReplaceSeq is a Sequence method.
replaceSeq replaces all instances of a sequence with another.
func SequenceReverseFindSeq ¶
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 ¶
SequenceReverseInPlace is a Sequence method.
reverseInPlace reverses the elements of the sequence.
func SequenceRstrip ¶
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 ¶
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 ¶
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 ¶
SequenceSetItemsToDouble is a Sequence method.
setItemsToDouble sets all items to the given value.
func SequenceSin ¶
SequenceSin is a Sequence method.
sin sets each element of the receiver to its sine.
func SequenceSinh ¶
SequenceSinh is a Sequence method.
sinh sets each element of the receiver to its hyperbolic sine.
func SequenceSize ¶
SequenceSize is a Sequence method.
size returns the number of items in the sequence.
func SequenceSlashEq ¶
SequenceSlashEq is a Sequence method.
/= sets each element of the receiver to its value divided by the respective element of the argument.
func SequenceSplit ¶
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 ¶
SequenceSplitAt is a Sequence method.
splitAt splits the sequence at the given index.
func SequenceSqrt ¶
SequenceSqrt is a Sequence method.
sqrt sets each element of the receiver to its square root.
func SequenceSquare ¶
SequenceSquare is a Sequence method.
square sets each element of the receiver to its square.
func SequenceStarEq ¶
SequenceStarEq is a Sequence method.
*= sets each element of the receiver to its value times the respective element of the argument.
func SequenceStarStarEq ¶
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 ¶
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 ¶
SequenceSum is a Sequence method.
sum returns the sum of the elements of the sequence.
func SequenceTan ¶
SequenceTan is a Sequence method.
tan sets each element of the receiver to its tangent.
func SequenceTanh ¶
SequenceTanh is a Sequence method.
tanh sets each element of the receiver to its hyperbolic tangent.
func SequenceToBase ¶
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 ¶
SequenceURLDecoded is a Sequence method.
urlDecoded unescapes the sequence as a URL query.
func SequenceURLEncoded ¶
SequenceURLEncoded is a Sequence method.
urlEncoded escapes the sequence for safe use in a URL query.
func SequenceUnescape ¶
SequenceUnescape is a Sequence method.
unescape interprets backslash-escaped codes in the sequence.
func SequenceUnpack ¶
SequenceUnpack is a Sequence method.
unpack reads a packed binary sequence into a List.
func SequenceUppercase ¶
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 ¶
SequenceValidEncodings is a Sequence method.
validEncodings returns a list of valid encoding names.
func SequenceWithStruct ¶
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 ¶
SequenceZero is a Sequence method.
zero sets each element of the receiver to zero.
func SystemActiveCpus ¶
SystemActiveCpus is a System method.
activeCpus returns the number of CPUs available for coroutines.
func SystemExit ¶
SystemExit is a System method.
exit exits the process with an exit code which defaults to 0.
func SystemGetEnvironmentVariable ¶
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 ¶
SystemSetEnvironmentVariable is a System method.
setEnvironmentVariable sets the value of an environment variable.
func SystemSetLobby ¶
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 ¶
SystemThisProcessPid is a System method.
thisProcessPid returns the pid of this process.
func (*Object) AppendProto ¶
AppendProto appends a proto to the end of the object's protos list.
func (*Object) Clone ¶
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 ¶
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 ¶
IsKindOf evaluates whether the object has kind as any of its ancestors, or is itself kind.
func (*Object) PrependProto ¶
PrependProto prepends a proto to the front of the object's protos list.
func (*Object) Protos ¶
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 ¶
RemoveProto removes all instances of a proto from the object's protos list. Comparison is done by identity only.
type RemoteStop ¶
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) Exit ¶
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.
type SeqKind ¶
type SeqKind struct {
// contains filtered or unexported fields
}
SeqKind represents a sequence data type.
type Sequence ¶
A Sequence is a collection of data of one fixed-size type.
func EncodeString ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
FixIndex wraps an index into the sequence's size. If the sequence is mutable, callers should hold its object's lock.
func (Sequence) Insert ¶
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 ¶
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 ¶
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 ¶
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 ¶
Kind returns the SeqKind appropriate for this sequence. If the sequence is mutable, callers should hold its object's lock.
func (Sequence) Len ¶
Len returns the length of the sequence. If the sequence is mutable, callers should hold its object's lock.
func (Sequence) MapBinary ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
SameType returns whether the sequence has the same data type as another. If either sequence is mutable, callers should hold their objects' locks.
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.
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) 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 ¶
Set sets the slot's value. The slot must be locked. Setting a value of nil marks the slot as deleted.
func (SyncSlot) Snap ¶
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.
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 ¶
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 ¶
ActivateBlock activates a block directly, regardless of the value of its Activatable flag. Panics if blk is not a Block object.
func (*VM) AddonProto ¶
AddonProto returns a new Protos list for a type in vm.Addons. Panics if there is no such type!
func (*VM) AsBool ¶
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 ¶
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 ¶
CachedMessage creates a message carrying a cached value.
func (*VM) CheckEncoding ¶
CheckEncoding checks whether the given encoding name is a valid encoding accepted by the VM.
func (*VM) Compare ¶
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 ¶
CoreProto returns a new Protos list for a type in vm.Core. Panics if there is no such type!
func (*VM) DebugMessage ¶
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) ForeachSlot ¶
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 ¶
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 ¶
GetLocalSlot checks only obj's own slots for a slot.
func (*VM) GetLocalSlotSync ¶
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 ¶
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 ¶
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 ¶
IdentMessage creates a message of a given identifier. Additional messages may be passed as arguments.
func (*VM) Install ¶
Install installs an addon proto by appending it to Lobby's protos and setting the corresponding slot in Addons.
func (*VM) IoError ¶
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 ¶
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 ¶
LoadAddon loads an addon. It returns a channel that closes when the addon is loaded.
func (*VM) MessageObject ¶
MessageObject returns an Object with the given Message value. If msg is nil, the result is nil.
func (*VM) MustDoString ¶
MustDoString parses and executes a string, panicking if the result is a raised exception.
func (*VM) NewBlock ¶
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 ¶
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 ¶
NewCall creates a Call object sent from sender to the target's actor using the message msg.
func (*VM) NewException ¶
NewException creates a new Exception object with the given error.
func (*VM) NewExceptionf ¶
NewExceptionf creates a new Io Exception with the given formatted error message.
func (*VM) NewObject ¶
NewObject creates a new object with the given slots and with the VM's Core Object as its proto.
func (*VM) NewSequence ¶
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 ¶
NewString creates a new Sequence object representing the given string in UTF-8 encoding.
func (*VM) NumberMessage ¶
NumberMessage creates a message carrying a numeric value.
func (*VM) ObjectWith ¶
ObjectWith creates a new object with the given slots, protos, value, and tag.
func (*VM) OpShuffle ¶
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 ¶
Parse converts Io source code into a message chain. The message is shuffled according to the VM's default operator table.
func (*VM) ParseScanner ¶
ParseScanner converts Io source code in a RuneScanner into a message chain. No operator precedence parsing is applied.
func (*VM) ParseUnshuffled ¶
ParseUnshuffled converts Io source code into a message chain. No operator precedence parsing is applied.
func (*VM) Perform ¶
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) RaiseException ¶
RaiseException returns vm.Raise(vm.NewException(msg)).
func (*VM) RaiseExceptionf ¶
RaiseExceptionf returns vm.Raise(vm.NewExceptionf(format, args...)).
func (*VM) RemoveAllSlots ¶
RemoveAllSlots removes all slots from obj in a single operation.
func (*VM) RemoveSlot ¶
RemoveSlot removes slots from obj's local slots, if they are present.
func (*VM) SequenceFromBytes ¶
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 ¶
SequenceObject creates a new Sequence object with the given value directly.
func (*VM) SetLaunchScript ¶
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) SetSlotSync ¶
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) Status ¶
Status checks the VM's control flow channel and returns any pending signal, or (result, NoStop) if there is none.
func (*VM) Stop ¶
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 ¶
StringMessage creates a message carrying a string value.
Source Files ¶
- addon.go
- block.go
- bool.go
- cfunction.go
- control.go
- coroutine.go
- debugger.go
- exception.go
- lex.go
- list.go
- map.go
- message.go
- number.go
- object.go
- optable.go
- parse.go
- scheduler.go
- sequence.go
- sequence_immutable.go
- sequence_math.go
- sequence_mutable.go
- sequence_string.go
- slots.go
- system.go
- system_unix.go
- vm.go
- vm_init.go