builtin

package
v0.0.0-...-31ab3be Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2019 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package builtin provides the functions that serve as the bootstrapped routines for the system's runtime environment.

Index

Constants

View Source
const (
	// ChannelType is the type name for a channel
	ChannelType = data.String("channel")

	// EmitKey is the key used to emit to a Channel
	EmitKey = data.Keyword("emit")

	// SequenceKey is the key used to retrieve the Sequence from a Channel
	SequenceKey = data.Keyword("seq")
)
View Source
const (
	// WriterType is the type name for a writer
	WriterType = data.String("writer")

	// WriterKey is the key used to wrap a Writer
	WriterKey = data.Keyword("writer")

	// WriteKey is key used to write to a Writer
	WriteKey = data.Keyword("write")

	// CloseKey is the key used to close a file
	CloseKey = data.Keyword("close")
)
View Source
const (
	CallableRequired = "argument must be callable: %s"
)

Error messages

View Source
const (
	IndexOutOfBounds = "index out of bounds"
)

Error messages

Variables

This section is empty.

Functions

func Add

func Add(args ...data.Value) data.Value

Add returns the sum of the provided numbers

func Append

func Append(args ...data.Value) data.Value

Append adds a value to the end of the provided Appender

func Apply

func Apply(args ...data.Value) data.Value

Apply performs a parameterized function call

func Args

func Args() data.Value

Args returns a vector containing the args passed to this program

func Car

func Car(args ...data.Value) data.Value

Car returns the first element of the provided Pair

func Cdr

func Cdr(args ...data.Value) data.Value

Cdr returns the first element of the provided Pair

func Chan

func Chan(args ...data.Value) data.Value

Chan instantiates a new go channel

func Cons

func Cons(args ...data.Value) data.Value

Cons adds a value to the beginning of the provided Sequence

func CurrentTime

func CurrentTime(_ ...data.Value) data.Value

CurrentTime returns the current system time in nanoseconds

func Defer

func Defer(args ...data.Value) (res data.Value)

Defer invokes a cleanup function, no matter what has happened

func Deque

func Deque(args ...data.Value) data.Value

Deque constructs a new deque

func Div

func Div(args ...data.Value) data.Value

Div will divide one number by the next, in turn

func Env

func Env() data.Value

Env returns an object containing the operating system's environment

func Eq

func Eq(args ...data.Value) data.Value

Eq returns whether or not the provided numbers are equal

func First

func First(args ...data.Value) data.Value

First returns the first value in the sequence

func GenSym

func GenSym(args ...data.Value) data.Value

GenSym generates a unique symbol

func Get

func Get(args ...data.Value) data.Value

Get returns a value by key from the provided mapped sequence

func Go

func Go(args ...data.Value) data.Value

Go runs the provided function asynchronously

func Gt

func Gt(args ...data.Value) data.Value

Gt returns true if each number is greater than the previous

func Gte

func Gte(args ...data.Value) data.Value

Gte returns true if each number is greater than or equal to the previous

func IsAppender

func IsAppender(args ...data.Value) data.Value

IsAppender returns whether or not the provided value is an appender

func IsApply

func IsApply(args ...data.Value) data.Value

IsApply tests whether or not a value is callable

func IsAtom

func IsAtom(args ...data.Value) data.Value

IsAtom returns whether or not the provided value is atomic

func IsBoolean

func IsBoolean(args ...data.Value) data.Value

IsBoolean returns whether or not the provided value is a boolean

func IsCons

func IsCons(args ...data.Value) data.Value

IsCons returns whether or not the provide value is a Cons cell

func IsCounted

func IsCounted(args ...data.Value) data.Value

IsCounted returns whether or not the provided value is a counted sequence

func IsDeque

func IsDeque(args ...data.Value) data.Value

IsDeque returns whether or not the provided value is a deque

func IsEmpty

func IsEmpty(args ...data.Value) data.Value

IsEmpty returns whether or not the provided sequence is empty

func IsIdentical

func IsIdentical(args ...data.Value) data.Value

IsIdentical returns whether or not the two values represent the same object

func IsIndexed

func IsIndexed(args ...data.Value) data.Value

IsIndexed returns whether or not the provided value is an indexed sequence

func IsKeyword

func IsKeyword(args ...data.Value) data.Value

IsKeyword returns whether or not the provided value is a keyword

func IsList

func IsList(args ...data.Value) data.Value

IsList returns whether or not the provided value is a list

func IsLocal

func IsLocal(args ...data.Value) data.Value

IsLocal returns whether or not the provided value is an unqualified symbol

func IsMacro

func IsMacro(args ...data.Value) data.Value

IsMacro returns whether or not the argument is a macro

func IsMapped

func IsMapped(args ...data.Value) data.Value

IsMapped returns whether or not a value is a mapped sequence

func IsNaN

func IsNaN(args ...data.Value) data.Value

IsNaN returns true if the provided value is not a number

func IsNegInf

func IsNegInf(args ...data.Value) data.Value

IsNegInf returns true if the provided number represents negative infinity

func IsNumber

func IsNumber(args ...data.Value) data.Value

IsNumber returns true if the provided value is a number

func IsObject

func IsObject(args ...data.Value) data.Value

IsObject returns whether or not a value is an object

func IsPair

func IsPair(args ...data.Value) data.Value

IsPair returns whether or not the provided value is a Pair

func IsPosInf

func IsPosInf(args ...data.Value) data.Value

IsPosInf returns true if the provided number represents positive infinity

func IsPromise

func IsPromise(args ...data.Value) data.Value

IsPromise returns whether or not the specified value is a promise

func IsQualified

func IsQualified(args ...data.Value) data.Value

IsQualified returns whether or not the provided value is a qualified symbol

func IsResolved

func IsResolved(args ...data.Value) data.Value

IsResolved returns whether or not the specified promise has been resolved

func IsReverser

func IsReverser(args ...data.Value) data.Value

IsReverser returns whether or not the value is a reversible sequence

func IsSeq

func IsSeq(args ...data.Value) data.Value

IsSeq returns whether or not the provided value is a sequence

func IsSpecial

func IsSpecial(args ...data.Value) data.Value

IsSpecial tests whether not a function is a special form

func IsString

func IsString(args ...data.Value) data.Value

IsString returns whether or not the provided value is a string

func IsSymbol

func IsSymbol(args ...data.Value) data.Value

IsSymbol returns whether or not the provided value is a symbol

func IsVector

func IsVector(args ...data.Value) data.Value

IsVector returns whether or not the provided value is a vector

func LazySequence

func LazySequence(args ...data.Value) data.Value

LazySequence treats a function as a lazy sequence

func Length

func Length(args ...data.Value) data.Value

Length returns the element count of the provided sequence

func List

func List(args ...data.Value) data.Value

List constructs a new list

func Lt

func Lt(args ...data.Value) data.Value

Lt returns true if each number is less than the previous

func Lte

func Lte(args ...data.Value) data.Value

Lte returns true if each number is less than or equal to the previous

func Macro

func Macro(args ...data.Value) data.Value

Macro converts a function into a macro

func MakeReader

func MakeReader(r io.Reader, i stdlib.InputFunc) stdlib.Reader

MakeReader wraps the go Reader with an input function

func MakeWriter

func MakeWriter(w io.Writer, o stdlib.OutputFunc) data.Object

MakeWriter wraps the go Writer with an output function

func Mod

func Mod(args ...data.Value) data.Value

Mod will produce the remainder of dividing one number by the next, in turn

func Mul

func Mul(args ...data.Value) data.Value

Mul will generate the product of all the provided numbers

func Neq

func Neq(args ...data.Value) data.Value

Neq returns true if any of the numbers is not equal to the others

func Nth

func Nth(args ...data.Value) data.Value

Nth returns the nth element of the provided sequence or a default

func Object

func Object(args ...data.Value) data.Value

Object creates a new object instance

func Promise

func Promise(args ...data.Value) data.Value

Promise instantiates a new eventually-fulfilled promise

func Raise

func Raise(args ...data.Value) data.Value

Raise will cause a panic

func Read

func Read(args ...data.Value) data.Value

Read performs the standard LISP read of a string

func ReaderStr

func ReaderStr(args ...data.Value) data.Value

ReaderStr converts the provided arguments to a delimited string

func Recover

func Recover(args ...data.Value) (res data.Value)

Recover invokes a function and runs a recovery function if Go panics

func Rest

func Rest(args ...data.Value) data.Value

Rest returns the sequence elements after the first value

func Reverse

func Reverse(args ...data.Value) data.Value

Reverse returns a reversed copy of a Sequence

func Str

func Str(args ...data.Value) data.Value

Str converts the provided arguments to an undelimited string

func Sub

func Sub(args ...data.Value) data.Value

Sub will subtract one number from the previous, in turn

func Sym

func Sym(args ...data.Value) data.Value

Sym instantiates a new symbol

func Vector

func Vector(args ...data.Value) data.Value

Vector creates a new vector

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL