core

package
v0.0.0-...-73cd16d Latest Latest
Warning

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

Go to latest
Published: May 22, 2024 License: EPL-1.0 Imports: 42 Imported by: 0

Documentation

Index

Constants

View Source
const (
	INTEGER_CATEGORY  = iota
	FLOATING_CATEGORY = iota
	RATIO_CATEGORY    = iota
)
View Source
const EOF = -1
View Source
const KeywordHashMask uint32 = 0x7334c790
View Source
const MAX_RUNE = int(^uint32(0) >> 1)
View Source
const MIN_RUNE = -MAX_RUNE - 1
View Source
const VERSION = "v0.14.2"

Variables

View Source
var (
	Stdin          io.Reader = os.Stdin
	Stdout         io.Writer = os.Stdout
	Stderr         io.Writer = os.Stderr
	VerbosityLevel           = 0
)
View Source
var (
	INT_OPS      = IntOps{}
	DOUBLE_OPS   = DoubleOps{}
	BIGINT_OPS   = BigIntOps{}
	BIGFLOAT_OPS = BigFloatOps{}
	RATIO_OPS    = RatioOps{}
)
View Source
var (
	LOCAL_BINDINGS *Bindings = nil
	KNOWN_MACROS   *Var
	REQUIRE_VAR    *Var
	ALIAS_VAR      *Var
	REFER_VAR      *Var
	CREATE_NS_VAR  *Var
	IN_NS_VAR      *Var
	WARNINGS       = Warnings{
					// contains filtered or unexported fields
	}
)
View Source
var (
	LINTER_MODE   bool = false
	PROBLEM_COUNT      = 0
	DIALECT       Dialect
	LINTER_CONFIG *Var
)
View Source
var (
	EmptyHashMap = &HashMap{}
)
View Source
var EmptyList = NewList(NIL, nil)
View Source
var ErrCustomError = errors.New("custom error")
View Source
var ErrStackOverflow = errors.New("stack overflow, not enough stack room")
View Source
var Exit func(rc int)
View Source
var (
	HASHMAP_THRESHOLD int64 = 16
)
View Source
var NIL = TinyNil{}
View Source
var NativeRegistry = map[string]NativeSetup{}
View Source
var (
	STR = Str{
		// contains filtered or unexported fields
	}
)

Functions

func AddContext

func AddContext(env *Env, err error, str string, args ...any) error

func AddNativeNamespace

func AddNativeNamespace(name string, setup NativeSetup)

func AssertInts

func AssertInts(env *Env, args []any) (Int, Int, error)

func Assertio_Reader

func Assertio_Reader(env *Env, obj any, msg string) (io.Reader, error)

func Assertio_RuneReader

func Assertio_RuneReader(env *Env, obj any, msg string) (io.RuneReader, error)

func Assertio_Writer

func Assertio_Writer(env *Env, obj any, msg string) (io.Writer, error)

func CallVar

func CallVar(env *Env, varName string, args ...any) (any, error)

func Cast

func Cast[A any](env *Env, obj any, a *A) error

func CastReflect

func CastReflect[T any](env *Env, obj any, v *T) error

func CheckArity

func CheckArity(env *Env, args []any, min int, max int) error

func ClearMeta

func ClearMeta(obj any)

func CoerceString

func CoerceString(env *Env, obj any, a *string) error

func CombineToString

func CombineToString(env *Env, args []any) (any, error)

Combine many values into a single string.

func CompareNumbers

func CompareNumbers(x Number, y Number) int

func ConcatSimple

func ConcatSimple(env *Env, args []any) (any, error)

Concatinate N sequences together

func Conj

func Conj(env *Env, col any, val any) (any, error)

Create a new Sequence by combine the value with the collection.

func Cons

func Cons(env *Env, val any, seq Seqable) (any, error)

Add an element to a Seq value, returning a new Seq

func ConvertToSeq

func ConvertToSeq(env *Env, s Seqable) (any, error)

Convert the given value to a Seq

func DeriveReadObject

func DeriveReadObject(base any, obj any) any

func DisplayError

func DisplayError(env *Env, err error)

func EngineRun

func EngineRun(env *Env, fn *Fn) (any, error)

func Ensureio_Reader

func Ensureio_Reader(env *Env, args []any, index int) (io.Reader, error)

func Ensureio_RuneReader

func Ensureio_RuneReader(env *Env, args []any, index int) (io.RuneReader, error)

func Ensureio_Writer

func Ensureio_Writer(env *Env, args []any, index int) (io.Writer, error)

func Equals

func Equals(env *Env, a, b any) bool

func EqualsValues

func EqualsValues(env *Env, a, b any) (any, error)

Compare two values returning a boolean if they are equal or not

func ErrorArity

func ErrorArity(env *Env, n int) error

func ErrorArityMinMax

func ErrorArityMinMax(env *Env, n, min, max int) error

func Errorf

func Errorf(env *Env, str string, args ...any) error

func Eval

func Eval(genv *Env, expr Expr, env *LocalEnv) (any, error)

func ExtractBoolean

func ExtractBoolean(env *Env, args []any, index int) (bool, error)

func ExtractChar

func ExtractChar(env *Env, args []any, index int) (rune, error)

func ExtractDouble

func ExtractDouble(env *Env, args []any, index int) (float64, error)

func ExtractIOReader

func ExtractIOReader(env *Env, args []any, index int) (io.Reader, error)

func ExtractIOWriter

func ExtractIOWriter(env *Env, args []any, index int) (io.Writer, error)

func ExtractInt

func ExtractInt(env *Env, args []any, index int) (int, error)

func ExtractKeyword

func ExtractKeyword(env *Env, args []any, index int) (string, error)

func ExtractObject

func ExtractObject(env *Env, args []any, index int) (any, error)

func ExtractOpaque

func ExtractOpaque[T any](env *Env, obj any, dest *T) error

func ExtractRegex

func ExtractRegex(env *Env, args []any, index int) (*regexp.Regexp, error)

func ExtractString

func ExtractString(env *Env, args []any, index int) (string, error)

func ExtractStringable

func ExtractStringable(env *Env, args []any, index int) (string, error)

func ExtractStrings

func ExtractStrings(env *Env, args []any, index int) ([]string, error)

func ExtractTime

func ExtractTime(env *Env, args []any, index int) (time.Time, error)

func First

func First(env *Env, s Seqable) (any, error)

Return the first element in a Seq

func Fourth

func Fourth(env *Env, seq Seq) (any, error)

func GetType

func GetType(obj any) any

func HashPtr

func HashPtr[T any](val *T) uint32

func HashValue

func HashValue(env *Env, obj any) (uint32, error)

func IsEqualOrImplements

func IsEqualOrImplements(at reflect.Type, ct reflect.Type) bool

func IsInstance

func IsInstance(env *Env, t Type, obj any) bool

func IsSeq

func IsSeq(obj any) bool

func IsSeqEqual

func IsSeqEqual(env *Env, seq Seq, other interface{}) bool

func IsSpecialSymbol

func IsSpecialSymbol(obj any) bool

func IsSymbol

func IsSymbol(obj any) bool

func IsVector

func IsVector(obj any) bool

func Load

func Load(env *Env, libname string) (any, error)

func LoadLibFromPath

func LoadLibFromPath(env *Env, libnamev Symbol, pathnamev String) (any, error)

Attempt to load a given lib from a given path.

func MakeList

func MakeList(env *Env, args []any) (any, error)

Create a new lace List from the given arguments

func MakeReadObject

func MakeReadObject(reader *Reader, obj any) any

func MarshalCode

func MarshalCode(env *Env, code *Code) ([]byte, error)

func Next

func Next(env *Env, s Seqable) (any, error)

Return elements other than the first one in a Seq

func PopulateNativeNamespaceToEnv

func PopulateNativeNamespaceToEnv(env *Env, name string) (bool, error)

func PopulateNativeNamespacesToEnv

func PopulateNativeNamespacesToEnv(env *Env) error

func PrintObject

func PrintObject(env *Env, obj any, w io.Writer)

func ProcessLinterFile

func ProcessLinterFile(env *Env, configDir string, filename string) error

func ProcessLinterFiles

func ProcessLinterFiles(env *Env, dialect Dialect, filename string, workingDir string) error

func ProcessReader

func ProcessReader(env *Env, reader *Reader, filename string) (any, error)

func ProcessReaderFromEval

func ProcessReaderFromEval(env *Env, reader *Reader, filename string) error

func PushBindings

func PushBindings(env *Env, assoc Map) (any, error)

Add given bindings to the set of current Var bindings, returning the original set.

func Read

func Read(env *Env, reader *Reader) (any, bool, error)

func ReadConfig

func ReadConfig(env *Env, filename string, workingDir string) error

func ReadIntoBytecode

func ReadIntoBytecode(env *Env, reader *Reader, filename string) ([]byte, error)

func ResetUsage

func ResetUsage(env *Env)

func Rest

func Rest(env *Env, s Seqable) (any, error)

Return all elements of a seq except for the first one.

func ReturnArityMinMax

func ReturnArityMinMax(env *Env, n, min, max int) error

func RunFile

func RunFile(env *Env, filename string) error

func SError

func SError(env *Env, cat, str string, args ...any) error

func Second

func Second(env *Env, seq Seq) (any, error)

func SeqCount

func SeqCount(env *Env, seq Seq) (int, error)

func SeqNth

func SeqNth(env *Env, seq Seq, n int) (any, error)

func SeqToString

func SeqToString(env *Env, seq Seq, escape bool) (string, error)

func SeqTryNth

func SeqTryNth(env *Env, seq Seq, n int, d any) (any, error)

func SeqsEqual

func SeqsEqual(env *Env, seq1, seq2 Seq) bool

func SetBindings

func SetBindings(env *Env, assoc Associative) (any, error)

Reset the local var bindings to the given value.

func SetExit

func SetExit(fn func(rc int))

func SetInfo

func SetInfo(obj any, info *ObjectInfo) any

func SimpleToString

func SimpleToString(obj any) string

func StartGoRoutine

func StartGoRoutine(parent *Env, callable Callable) (any, error)

StartGoRoutine runs the given callable in a new goroutine, returning a channel that can be used to retrieve the return value.

func Third

func Third(env *Env, seq Seq) (any, error)

func ToBool

func ToBool(obj any) bool

func ToNative

func ToNative(env *Env, obj any) (any, error)

func ToSlice

func ToSlice(env *Env, seq Seq) ([]any, error)

func ToString

func ToString(env *Env, obj any) (string, error)

func TryCoerceString

func TryCoerceString(obj any, a *string) bool

func TryEval

func TryEval(env *Env, expr Expr) (obj any, err error)

func TryRead

func TryRead(env *Env, reader *Reader) (obj any, err error)

func TypeName

func TypeName(obj any) string

func WarnOnGloballyUnusedNamespaces

func WarnOnGloballyUnusedNamespaces(env *Env)

func WarnOnGloballyUnusedVars

func WarnOnGloballyUnusedVars(env *Env)

func WarnOnUnusedNamespaces

func WarnOnUnusedNamespaces(env *Env)

func WarnOnUnusedVars

func WarnOnUnusedVars(env *Env)

func WrapToProc0_0

func WrapToProc0_0(fn func()) any

func WrapToProc0_1

func WrapToProc0_1[O any](fn func() O) any

func WrapToProc0_2

func WrapToProc0_2[O, O2 any](fn func() (O, O2)) any

func WrapToProc1_0

func WrapToProc1_0[A any](fn func(a A)) any

func WrapToProc1_1

func WrapToProc1_1[A, O any](fn func(a A) O) any

func WrapToProc1_2

func WrapToProc1_2[A, O, O2 any](fn func(A) (O, O2)) any

func WrapToProc2_0

func WrapToProc2_0[E, A any](fn func(e E, a A)) any

func WrapToProc2_1

func WrapToProc2_1[E, A, O any](fn func(e E, a A) O) any

func WrapToProc2_2

func WrapToProc2_2[E, A, O, O2 any](fn func(e E, a A) (O, O2)) any

func WrapToProc3_0

func WrapToProc3_0[E, A, B any](fn func(e E, a A, b B)) any

func WrapToProc3_1

func WrapToProc3_1[E, A, B, O any](fn func(e E, a A, b B) O) any

func WrapToProc3_2

func WrapToProc3_2[E, A, B, O, O2 any](fn func(e E, a A, b B) (O, O2)) any

Types

type ArityFn

type ArityFn struct {
	Args []string
	Fn   any
}

type ArrayMap

type ArrayMap struct {
	InfoHolder
	MetaHolder
	// contains filtered or unexported fields
}

A Map implementation that uses a simple array. Very efficient for small maps.

func EmptyArrayMap

func EmptyArrayMap() *ArrayMap

func MakeMeta

func MakeMeta(arglists Seq, docstring string, added string) *ArrayMap

func (*ArrayMap) Add

func (m *ArrayMap) Add(env *Env, key any, value any) bool

func (*ArrayMap) AddEqu

func (m *ArrayMap) AddEqu(key Equ, value any) bool

func (*ArrayMap) Assoc

func (m *ArrayMap) Assoc(env *Env, key any, value any) (Associative, error)

func (*ArrayMap) Call

func (m *ArrayMap) Call(env *Env, args []any) (any, error)

func (*ArrayMap) Clone

func (m *ArrayMap) Clone() *ArrayMap

func (*ArrayMap) Conj

func (m *ArrayMap) Conj(env *Env, obj any) (Conjable, error)

func (*ArrayMap) Count

func (m *ArrayMap) Count() int

func (*ArrayMap) Empty

func (m *ArrayMap) Empty() Collection

func (*ArrayMap) EntryAt

func (m *ArrayMap) EntryAt(env *Env, key any) (*Vector, error)

func (*ArrayMap) Equals

func (m *ArrayMap) Equals(env *Env, other interface{}) bool

func (*ArrayMap) Get

func (m *ArrayMap) Get(env *Env, key any) (bool, any, error)

func (*ArrayMap) GetEqu

func (m *ArrayMap) GetEqu(key Equ) (bool, any)

func (*ArrayMap) Hash

func (m *ArrayMap) Hash(env *Env) (uint32, error)

func (*ArrayMap) Iter

func (m *ArrayMap) Iter() MapIterator

func (*ArrayMap) Keys

func (m *ArrayMap) Keys() Seq

func (*ArrayMap) Merge

func (m *ArrayMap) Merge(env *Env, other Map) (Map, error)

func (*ArrayMap) Plus

func (m *ArrayMap) Plus(env *Env, key any, value any) *ArrayMap

func (*ArrayMap) Pprint

func (m *ArrayMap) Pprint(env *Env, w io.Writer, indent int) (int, error)

func (*ArrayMap) Seq

func (m *ArrayMap) Seq() Seq

func (*ArrayMap) Set

func (m *ArrayMap) Set(env *Env, key any, value any)

func (*ArrayMap) ToString

func (m *ArrayMap) ToString(env *Env, escape bool) (string, error)

func (*ArrayMap) Vals

func (m *ArrayMap) Vals() Seq

func (*ArrayMap) WithInfo

func (x *ArrayMap) WithInfo(info *ObjectInfo) any

func (*ArrayMap) WithMeta

func (v *ArrayMap) WithMeta(env *Env, meta Map) (any, error)

func (*ArrayMap) Without

func (m *ArrayMap) Without(env *Env, key any) (Map, error)

type ArrayMapIterator

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

func (*ArrayMapIterator) HasNext

func (iter *ArrayMapIterator) HasNext() bool

func (*ArrayMapIterator) Next

func (iter *ArrayMapIterator) Next() *Pair

type ArrayMapSeq

type ArrayMapSeq struct {
	InfoHolder
	MetaHolder
	// contains filtered or unexported fields
}

func (*ArrayMapSeq) Cons

func (seq *ArrayMapSeq) Cons(obj any) Seq

func (*ArrayMapSeq) Equals

func (seq *ArrayMapSeq) Equals(env *Env, other interface{}) bool

func (*ArrayMapSeq) First

func (seq *ArrayMapSeq) First(env *Env) (any, error)

func (*ArrayMapSeq) Hash

func (seq *ArrayMapSeq) Hash(env *Env) (uint32, error)

func (*ArrayMapSeq) IsEmpty

func (seq *ArrayMapSeq) IsEmpty(env *Env) (bool, error)

func (*ArrayMapSeq) Pprint

func (seq *ArrayMapSeq) Pprint(env *Env, w io.Writer, indent int) (int, error)

func (*ArrayMapSeq) Rest

func (seq *ArrayMapSeq) Rest(env *Env) (Seq, error)

func (*ArrayMapSeq) Seq

func (seq *ArrayMapSeq) Seq() Seq

func (*ArrayMapSeq) ToString

func (seq *ArrayMapSeq) ToString(env *Env, escape bool) (string, error)

func (*ArrayMapSeq) WithInfo

func (x *ArrayMapSeq) WithInfo(info *ObjectInfo) any

func (*ArrayMapSeq) WithMeta

func (seq *ArrayMapSeq) WithMeta(env *Env, meta Map) (any, error)

type ArrayNode

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

type ArrayNodeIterator

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

func (*ArrayNodeIterator) HasNext

func (iter *ArrayNodeIterator) HasNext() bool

func (*ArrayNodeIterator) Next

func (iter *ArrayNodeIterator) Next() *Pair

type ArrayNodeSeq

type ArrayNodeSeq struct {
	InfoHolder
	MetaHolder
	// contains filtered or unexported fields
}

func (*ArrayNodeSeq) Cons

func (s *ArrayNodeSeq) Cons(obj any) Seq

func (*ArrayNodeSeq) Equals

func (s *ArrayNodeSeq) Equals(env *Env, other interface{}) bool

func (*ArrayNodeSeq) First

func (s *ArrayNodeSeq) First(env *Env) (any, error)

func (*ArrayNodeSeq) Hash

func (s *ArrayNodeSeq) Hash(env *Env) (uint32, error)

func (*ArrayNodeSeq) IsEmpty

func (s *ArrayNodeSeq) IsEmpty(env *Env) (bool, error)

func (*ArrayNodeSeq) Pprint

func (seq *ArrayNodeSeq) Pprint(env *Env, w io.Writer, indent int) (int, error)

func (*ArrayNodeSeq) Rest

func (s *ArrayNodeSeq) Rest(env *Env) (Seq, error)

func (*ArrayNodeSeq) Seq

func (s *ArrayNodeSeq) Seq() Seq

func (*ArrayNodeSeq) ToString

func (s *ArrayNodeSeq) ToString(env *Env, escape bool) (string, error)

func (*ArrayNodeSeq) WithInfo

func (x *ArrayNodeSeq) WithInfo(info *ObjectInfo) any

func (*ArrayNodeSeq) WithMeta

func (s *ArrayNodeSeq) WithMeta(env *Env, meta Map) (any, error)

type ArraySeq

type ArraySeq struct {
	InfoHolder
	MetaHolder
	// contains filtered or unexported fields
}

func ArraySeqFromArrayMap

func ArraySeqFromArrayMap(m *ArrayMap) *ArraySeq

func (*ArraySeq) Cons

func (seq *ArraySeq) Cons(obj any) Seq

func (*ArraySeq) Equals

func (seq *ArraySeq) Equals(env *Env, other interface{}) bool

func (*ArraySeq) First

func (seq *ArraySeq) First(env *Env) (any, error)

func (*ArraySeq) Hash

func (seq *ArraySeq) Hash(env *Env) (uint32, error)

func (*ArraySeq) IsEmpty

func (seq *ArraySeq) IsEmpty(env *Env) (bool, error)

func (*ArraySeq) Pprint

func (seq *ArraySeq) Pprint(env *Env, w io.Writer, indent int) (int, error)

func (*ArraySeq) Rest

func (seq *ArraySeq) Rest(env *Env) (Seq, error)

func (*ArraySeq) Seq

func (seq *ArraySeq) Seq() Seq

func (*ArraySeq) ToString

func (seq *ArraySeq) ToString(env *Env, escape bool) (string, error)

func (*ArraySeq) WithInfo

func (x *ArraySeq) WithInfo(info *ObjectInfo) any

func (*ArraySeq) WithMeta

func (seq *ArraySeq) WithMeta(env *Env, meta Map) (any, error)

type Associative

type Associative interface {
	Conjable
	Gettable
	EntryAt(env *Env, key any) (*Vector, error)
	Assoc(env *Env, key, val any) (Associative, error)
}

When a collection can store and retrieve values by an associated key.

func AssertAssociative

func AssertAssociative(env *Env, obj any, msg string) (Associative, error)

func EnsureAssociative

func EnsureAssociative(env *Env, args []any, index int) (Associative, error)

func NewArrayMap

func NewArrayMap(key Equ, value any) (Associative, error)

type AssociativeImpl

type AssociativeImpl struct {
	AssocFn   func(*Env, any, any) (Associative, error)
	ConjFn    func(*Env, any) (Conjable, error)
	EntryAtFn func(*Env, any) (*Vector, error)
	GetFn     func(*Env, any) (bool, any, error)
}

func (*AssociativeImpl) Assoc

func (s *AssociativeImpl) Assoc(a0 *Env, a1 any, a2 any) (Associative, error)

func (*AssociativeImpl) Conj

func (s *AssociativeImpl) Conj(a0 *Env, a1 any) (Conjable, error)

func (*AssociativeImpl) EntryAt

func (s *AssociativeImpl) EntryAt(a0 *Env, a1 any) (*Vector, error)

func (*AssociativeImpl) Get

func (s *AssociativeImpl) Get(a0 *Env, a1 any) (bool, any, error)

type Atom

type Atom struct {
	MetaHolder
	// contains filtered or unexported fields
}

A value that contains space for a single other value that can be swapped in. Ie an atom is an atomic value.

func AssertAtom

func AssertAtom(env *Env, obj any, msg string) (*Atom, error)

func EnsureAtom

func EnsureAtom(env *Env, args []any, index int) (*Atom, error)

func (*Atom) AlterMeta

func (a *Atom) AlterMeta(env *Env, fn *Fn, args []any) (Map, error)

func (*Atom) Deref

func (a *Atom) Deref(env *Env) (any, error)

func (*Atom) Equals

func (a *Atom) Equals(env *Env, other interface{}) bool

func (*Atom) GetInfo

func (a *Atom) GetInfo() *ObjectInfo

func (*Atom) Hash

func (a *Atom) Hash(env *Env) (uint32, error)

func (*Atom) ResetMeta

func (a *Atom) ResetMeta(newMeta Map) Map

func (*Atom) ToString

func (a *Atom) ToString(env *Env, escape bool) (string, error)

func (*Atom) WithInfo

func (a *Atom) WithInfo(info *ObjectInfo) any

func (*Atom) WithMeta

func (a *Atom) WithMeta(env *Env, meta Map) (any, error)

type BigFloat

type BigFloat struct {
	InfoHolder
	// contains filtered or unexported fields
}

A floating point value that can be any size, practically.

func MakeBigFloatFrom

func MakeBigFloatFrom(bi *big.Float) *BigFloat

func (*BigFloat) BigFloat

func (b *BigFloat) BigFloat() *big.Float

func (*BigFloat) BigInt

func (b *BigFloat) BigInt() *big.Int

func (*BigFloat) Compare

func (bf *BigFloat) Compare(env *Env, other any) (int, error)

func (*BigFloat) Double

func (b *BigFloat) Double() Double

func (*BigFloat) Equals

func (bf *BigFloat) Equals(env *Env, other interface{}) bool

func (*BigFloat) Hash

func (bf *BigFloat) Hash(env *Env) (uint32, error)

func (*BigFloat) Int

func (b *BigFloat) Int() Int

func (*BigFloat) NativeNumber

func (b *BigFloat) NativeNumber() any

func (*BigFloat) Ratio

func (b *BigFloat) Ratio() *big.Rat

func (*BigFloat) ToString

func (bf *BigFloat) ToString(env *Env, escape bool) (string, error)

func (*BigFloat) WithInfo

func (x *BigFloat) WithInfo(info *ObjectInfo) any

type BigFloatOps

type BigFloatOps struct{}

func (BigFloatOps) Add

func (ops BigFloatOps) Add(x, y Number) (Number, error)

func (BigFloatOps) Combine

func (ops BigFloatOps) Combine(other Ops) Ops

func (BigFloatOps) Divide

func (ops BigFloatOps) Divide(x, y Number) (Number, error)

func (BigFloatOps) Eq

func (ops BigFloatOps) Eq(x Number, y Number) bool

func (BigFloatOps) Gt

func (ops BigFloatOps) Gt(x Number, y Number) bool

func (BigFloatOps) Gte

func (ops BigFloatOps) Gte(x Number, y Number) bool

func (BigFloatOps) IsZero

func (ops BigFloatOps) IsZero(x Number) bool

func (BigFloatOps) Lt

func (ops BigFloatOps) Lt(x Number, y Number) bool

func (BigFloatOps) Lte

func (ops BigFloatOps) Lte(x Number, y Number) bool

func (BigFloatOps) Multiply

func (ops BigFloatOps) Multiply(x, y Number) (Number, error)

func (BigFloatOps) Quotient

func (ops BigFloatOps) Quotient(x, y Number) (Number, error)

func (BigFloatOps) Rem

func (ops BigFloatOps) Rem(x, y Number) (Number, error)

func (BigFloatOps) Subtract

func (ops BigFloatOps) Subtract(x, y Number) (Number, error)

type BigInt

type BigInt struct {
	InfoHolder
	// contains filtered or unexported fields
}

An integer value that can be so large, it's hard to understand it.

func MakeBigInt

func MakeBigInt(bi int64) *BigInt

func MakeBigIntFrom

func MakeBigIntFrom(bi *big.Int) *BigInt

func (*BigInt) BigFloat

func (b *BigInt) BigFloat() *big.Float

func (*BigInt) BigInt

func (b *BigInt) BigInt() *big.Int

func (*BigInt) Compare

func (bi *BigInt) Compare(env *Env, other any) (int, error)

func (*BigInt) Double

func (b *BigInt) Double() Double

func (*BigInt) Equals

func (bi *BigInt) Equals(env *Env, other interface{}) bool

func (*BigInt) Hash

func (bi *BigInt) Hash(env *Env) (uint32, error)

func (*BigInt) I64

func (bi *BigInt) I64() int64

func (*BigInt) Int

func (b *BigInt) Int() Int

func (*BigInt) NativeNumber

func (b *BigInt) NativeNumber() any

func (*BigInt) Ratio

func (b *BigInt) Ratio() *big.Rat

func (*BigInt) ToString

func (bi *BigInt) ToString(env *Env, escape bool) (string, error)

func (*BigInt) WithInfo

func (x *BigInt) WithInfo(info *ObjectInfo) any

type BigIntOps

type BigIntOps struct{}

func (BigIntOps) Add

func (ops BigIntOps) Add(x, y Number) (Number, error)

func (BigIntOps) Combine

func (ops BigIntOps) Combine(other Ops) Ops

func (BigIntOps) Divide

func (ops BigIntOps) Divide(x, y Number) (Number, error)

func (BigIntOps) Eq

func (ops BigIntOps) Eq(x Number, y Number) bool

func (BigIntOps) Gt

func (ops BigIntOps) Gt(x Number, y Number) bool

func (BigIntOps) Gte

func (ops BigIntOps) Gte(x Number, y Number) bool

func (BigIntOps) IsZero

func (ops BigIntOps) IsZero(x Number) bool

func (BigIntOps) Lt

func (ops BigIntOps) Lt(x Number, y Number) bool

func (BigIntOps) Lte

func (ops BigIntOps) Lte(x Number, y Number) bool

func (BigIntOps) Multiply

func (ops BigIntOps) Multiply(x, y Number) (Number, error)

func (BigIntOps) Quotient

func (ops BigIntOps) Quotient(x, y Number) (Number, error)

func (BigIntOps) Rem

func (ops BigIntOps) Rem(x, y Number) (Number, error)

func (BigIntOps) Subtract

func (ops BigIntOps) Subtract(x, y Number) (Number, error)

type Binding

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

type BindingData

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

func (*BindingData) String

func (v *BindingData) String() string

type BindingExpr

type BindingExpr struct {
	Position
	// contains filtered or unexported fields
}

func (*BindingExpr) Dump

func (expr *BindingExpr) Dump(pos bool) Map

func (*BindingExpr) Eval

func (expr *BindingExpr) Eval(genv *Env, env *LocalEnv) (any, error)

type Bindings

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

func (*Bindings) AddBinding

func (b *Bindings) AddBinding(sym Symbol, index int, skipUnused bool)

func (*Bindings) GetBinding

func (b *Bindings) GetBinding(sym Symbol) *Binding

func (*Bindings) PopFrame

func (b *Bindings) PopFrame() *Bindings

func (*Bindings) PushFrame

func (b *Bindings) PushFrame() *Bindings

func (*Bindings) ToMap

func (b *Bindings) ToMap(env *Env) (Map, error)

type BitmapIndexedNode

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

type Boolean

type Boolean bool

It's true, or it's false. Never both.

func AssertBoolean

func AssertBoolean(env *Env, obj any, msg string) (Boolean, error)

func EnsureBoolean

func EnsureBoolean(env *Env, args []any, index int) (Boolean, error)

func MakeBoolean

func MakeBoolean(b bool) Boolean

func (Boolean) Compare

func (b Boolean) Compare(env *Env, other any) (int, error)

func (Boolean) Equals

func (b Boolean) Equals(env *Env, other interface{}) bool

func (Boolean) GetInfo

func (b Boolean) GetInfo() *ObjectInfo

func (Boolean) Hash

func (b Boolean) Hash(env *Env) (uint32, error)

func (Boolean) Native

func (b Boolean) Native() interface{}

func (Boolean) ToString

func (b Boolean) ToString(env *Env, escape bool) (string, error)

func (Boolean) WithInfo

func (x Boolean) WithInfo(info *ObjectInfo) any

type Box

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

type Buffer

type Buffer struct {
	*bytes.Buffer
	// contains filtered or unexported fields
}

func MakeBuffer

func MakeBuffer(b *bytes.Buffer) *Buffer

func (*Buffer) Equals

func (b *Buffer) Equals(env *Env, other interface{}) bool

func (*Buffer) GetInfo

func (b *Buffer) GetInfo() *ObjectInfo

func (*Buffer) Hash

func (b *Buffer) Hash(env *Env) (uint32, error)

func (*Buffer) ToString

func (b *Buffer) ToString(env *Env, escape bool) (string, error)

func (*Buffer) WithInfo

func (b *Buffer) WithInfo(info *ObjectInfo) any

type BufferedReader

type BufferedReader struct {
	*bufio.Reader
	// contains filtered or unexported fields
}

A value that can return data that has been buffered.

func MakeBufferedReader

func MakeBufferedReader(rd io.Reader) *BufferedReader

type BySymbolName

type BySymbolName []Symbol

func (BySymbolName) Len

func (s BySymbolName) Len() int

func (BySymbolName) Less

func (s BySymbolName) Less(i, j int) bool

func (BySymbolName) Swap

func (s BySymbolName) Swap(i, j int)

type BytecodeEncoder

type BytecodeEncoder struct {
	CodeData
}

func (*BytecodeEncoder) Encode

func (e *BytecodeEncoder) Encode(i *Instruction) error

type CallExpr

type CallExpr struct {
	Position
	// contains filtered or unexported fields
}

func (*CallExpr) Dump

func (expr *CallExpr) Dump(pos bool) Map

func (*CallExpr) Eval

func (expr *CallExpr) Eval(genv *Env, env *LocalEnv) (any, error)

func (*CallExpr) Name

func (expr *CallExpr) Name() string

type Callable

type Callable interface {
	Call(env *Env, args []any) (any, error)
}

When a value can be called and passed arguments, like a Function.

func AssertCallable

func AssertCallable(env *Env, obj any, msg string) (Callable, error)

func EnsureCallable

func EnsureCallable(env *Env, args []any, index int) (Callable, error)

func ExtractCallable

func ExtractCallable(env *Env, args []any, index int) (Callable, error)

type CallableImpl

type CallableImpl struct {
	CallFn func(*Env, []any) (any, error)
}

func (*CallableImpl) Call

func (s *CallableImpl) Call(a0 *Env, a1 []any) (any, error)

type CatchExpr

type CatchExpr struct {
	Position
	// contains filtered or unexported fields
}

func (*CatchExpr) Dump

func (expr *CatchExpr) Dump(pos bool) Map

func (*CatchExpr) Eval

func (expr *CatchExpr) Eval(genv *Env, env *LocalEnv) (any, error)

type Channel

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

func AssertChannel

func AssertChannel(env *Env, obj any, msg string) (*Channel, error)

func EnsureChannel

func EnsureChannel(env *Env, args []any, index int) (*Channel, error)

func ExtractChannel

func ExtractChannel(env *Env, args []any, index int) (*Channel, error)

func MakeChannel

func MakeChannel(ch chan FutureResult) *Channel

func (*Channel) Close

func (ch *Channel) Close()

func (*Channel) Equals

func (ch *Channel) Equals(env *Env, other interface{}) bool

func (*Channel) GetInfo

func (ch *Channel) GetInfo() *ObjectInfo

func (*Channel) Hash

func (ch *Channel) Hash(env *Env) (uint32, error)

func (*Channel) ToString

func (ch *Channel) ToString(env *Env, escape bool) (string, error)

func (*Channel) WithInfo

func (ch *Channel) WithInfo(info *ObjectInfo) any

type Char

type Char interface {
	any
	Comparable

	Ch() rune
	// contains filtered or unexported methods
}

A single unicode rune.

func AssertChar

func AssertChar(env *Env, obj any, msg string) (Char, error)

func EnsureChar

func EnsureChar(env *Env, args []any, index int) (Char, error)

func NewChar

func NewChar(ch rune) Char

type CharImpl

type CharImpl struct {
	ChFn      func() rune
	CompareFn func(*Env, any) (int, error)
	// contains filtered or unexported fields
}

func (*CharImpl) Ch

func (s *CharImpl) Ch() rune

func (*CharImpl) Compare

func (s *CharImpl) Compare(a0 *Env, a1 any) (int, error)

type CheckTypeData

type CheckTypeData struct {
	Type Type
}

type Code

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

func (*Code) AsData

func (c *Code) AsData(env *Env) (*CodeAsData, error)

func (*Code) Position

func (c *Code) Position() string

type CodeAsData

type CodeAsData struct {
	NumBindings    int            `json:"num_bindings" cbor:"1,keyasint,omitempty"`
	ImportUpvals   int            `json:"import_upvals" cbor:"2,keyasint,omitempty"`
	TotalUpvals    int            `json:"total_upvals" cbor:"3,keyasint,omitempty"`
	Filename       string         `json:"filename" cbor:"4,keyasint,omitempty"`
	Lines          []int          `json:"lines" cbor:"5,keyasint,omitempty"`
	ImportBindings []string       `json:"import_bindings" cbor:"6,keyasint,omitempty"`
	VarNames       []CodeSymbol   `json:"var_names" cbor:"7,keyasint,omitempty"`
	DefVarNames    []string       `json:"def_var_names" cbor:"8,keyasint,omitempty"`
	Literals       []*CodeLiteral `json:"literals" cbor:"9,keyasint,omitempty"`
	Codes          []*CodeAsData  `json:"codes" cbor:"10,keyasint,omitempty"`
	Methods        []CodeMethod   `json:"methods" cbor:"11,keyasint,omitempty"`
	Instructions   []uint32       `json:"instructions" cbor:"12,keyasint,omitempty"`
	StackSize      uint32         `json:"stack_size" cbor:"13,keyasint,omitempty"`
}

func (*CodeAsData) AsCode

func (cad *CodeAsData) AsCode(env *Env) (*Code, error)

type CodeBoolean

type CodeBoolean struct {
	Bool bool `json:"bool" cbor:"1,keyasint"`
}

type CodeChar

type CodeChar struct {
	Ch rune `json:"char" cbor:"1,keyasint"`
}

type CodeData

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

type CodeDouble

type CodeDouble struct {
	Double float64 `json:"double" cbor:"1,keyasint"`
}

type CodeEncoded

type CodeEncoded struct {
	Data []byte `json:"data" cbor:"1,keyasint"`
}

type CodeInt

type CodeInt struct {
	Int int64 `json:"int" cbor:"1,keyasint"`
}

type CodeKeyword

type CodeKeyword struct {
	Position  *CodePosition
	Namespace string `json:"ns" cbor:"1,keyasint"`
	Name      string `json:"name" cbor:"2,keyasint"`
}

func (*CodeKeyword) Keyword

func (c *CodeKeyword) Keyword() Keyword

func (*CodeKeyword) Set

func (c *CodeKeyword) Set(kw Keyword)

type CodeLiteral

type CodeLiteral struct {
	Symbol  *CodeSymbol    `json:"symbol,omitempty" cbor:"1,keyasint,omitempty"`
	Var     *CodeVar       `json:"var,omitempty" cbor:"2,keyasint,omitempty"`
	Type    *CodeType      `json:"type,omitempty" cbor:"3,keyasint,omitempty"`
	Encoded *CodeEncoded   `json:"encoded,omitempty" cbor:"4,keyasint,omitempty"`
	String  *CodeString    `json:"string,omitempty" cbor:"5,keyasint,omitempty"`
	Keyword *CodeKeyword   `json:"keyword,omitempty" cbor:"6,keyasint,omitempty"`
	Map     *CodeMap       `json:"map,omitempty" cbor:"7,keyasint,omitempty"`
	Int     *CodeInt       `json:"int,omitempty" cbor:"8,keyasint,omitempty"`
	Seq     *CodeSeq       `json:"seq,omitempty" cbor:"9,keyasint,omitempty"`
	Vector  *CodeVector    `json:"vector,omitempty" cbor:"10,keyasint,omitempty"`
	NS      *CodeNamespace `json:"ns,omitempty" cbor:"11,keyasint,omitempty"`
	Bool    *CodeBoolean   `json:"bool,omitempty" cbor:"12,keyasint,omitempty"`
	Char    *CodeChar      `json:"char,omitempty" cbor:"13,keyasint,omitempty"`
	Regex   *CodeRegex     `json:"regex,omitempty" cbor:"14,keyasint,omitempty"`
	Double  *CodeDouble    `json:"double,omitempty" cbor:"15,keyasint,omitempty"`
}

func (*CodeLiteral) AsValue

func (lit *CodeLiteral) AsValue(env *Env) (any, error)

func (*CodeLiteral) Set

func (cl *CodeLiteral) Set(env *Env, lit any) error

type CodeMap

type CodeMap struct {
	Pairs []CodeMapPair `json:"pairs" cbor:"1,keyasint"`
}

type CodeMapPair

type CodeMapPair struct {
	Key   CodeLiteral `json:"key" cbor:"1,keyasint"`
	Value CodeLiteral `json:"value" cbor:"2,keyasint"`
}

type CodeMethod

type CodeMethod struct {
	Method string `json:"method" cbor:"1,keyasint"`
	Arity  uint   `json:"arity" cbor:"2,keyasint"`
}

type CodeNamespace

type CodeNamespace struct {
	Name CodeSymbol `json:"name" cbor:"1,keyasint"`
}

type CodePosition

type CodePosition struct {
	StartLine   int    `json:"start_line" cbor:"1,keyasint"`
	EndLine     int    `json:"end_line" cbor:"2,keyasint"`
	StartColumn int    `json:"start_column" cbor:"3,keyasint"`
	EndColumn   int    `json:"end_column" cbor:"4,keyasint"`
	Filename    string `json:"filename" cbor:"5,keyasint"`
}

func (*CodePosition) Position

func (c *CodePosition) Position() Position

func (*CodePosition) Set

func (c *CodePosition) Set(pos Position)

type CodeRegex

type CodeRegex struct {
	Regex string `json:"regex" cbor:"1,keyasint"`
}

type CodeSeq

type CodeSeq struct {
	Elements []CodeLiteral `json:"elements" cbor:"1,keyasint"`
}

type CodeString

type CodeString struct {
	String string `json:"string" cbor:"1,keyasint"`
}

type CodeSymbol

type CodeSymbol struct {
	Position  *CodePosition
	Namespace string `json:"ns" cbor:"1,keyasint"`
	Name      string `json:"name" cbor:"2,keyasint"`
}

func (*CodeSymbol) Set

func (c *CodeSymbol) Set(sym Symbol)

func (*CodeSymbol) Symbol

func (c *CodeSymbol) Symbol() Symbol

type CodeType

type CodeType struct {
	Name string `json:"name" cbor:"1,keyasint"`
}

type CodeVar

type CodeVar struct {
	Name CodeSymbol `json:"name" cbor:"1,keyasint"`
}

type CodeVector

type CodeVector struct {
	Elements []CodeLiteral `json:"elements" cbor:"1,keyasint"`
}

type Collection

type Collection interface {
	Counted
	Seqable
	Empty() Collection
}

When a value has the standard collection interfaces.

type CollectionImpl

type CollectionImpl struct {
	CountFn func() int
	EmptyFn func() Collection
	SeqFn   func() Seq
}

func (*CollectionImpl) Count

func (s *CollectionImpl) Count() int

func (*CollectionImpl) Empty

func (s *CollectionImpl) Empty() Collection

func (*CollectionImpl) Seq

func (s *CollectionImpl) Seq() Seq

type Comparable

type Comparable interface {
	Compare(env *Env, other any) (int, error)
}

When a value can report if it's less, same, or bigger than another value.

func AssertComparable

func AssertComparable(env *Env, obj any, msg string) (Comparable, error)

func EnsureComparable

func EnsureComparable(env *Env, args []any, index int) (Comparable, error)

type ComparableImpl

type ComparableImpl struct {
	CompareFn func(*Env, any) (int, error)
}

func (*ComparableImpl) Compare

func (s *ComparableImpl) Compare(a0 *Env, a1 any) (int, error)

type Comparator

type Comparator interface {
	Compare(env *Env, a, b any) (int, error)
}

When a value can report if two values are are less, same, or bigger than another value.

func AssertComparator

func AssertComparator(env *Env, obj any, msg string) (Comparator, error)

func EnsureComparator

func EnsureComparator(env *Env, args []any, index int) (Comparator, error)

type ComparatorImpl

type ComparatorImpl struct {
	CompareFn func(*Env, any, any) (int, error)
}

func (*ComparatorImpl) Compare

func (s *ComparatorImpl) Compare(a0 *Env, a1 any, a2 any) (int, error)

type Compiler

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

func (*Compiler) Export

func (c *Compiler) Export(show bool) *Code

func (*Compiler) Process

func (c *Compiler) Process(env *Env, expr Expr) error

type Conjable

type Conjable interface {
	Conj(env *Env, obj any) (Conjable, error)
}

interfaces

type ConsSeq

type ConsSeq struct {
	InfoHolder
	MetaHolder
	// contains filtered or unexported fields
}

func NewConsSeq

func NewConsSeq(first any, rest Seq) *ConsSeq

func (*ConsSeq) Cons

func (seq *ConsSeq) Cons(obj any) Seq

func (*ConsSeq) Equals

func (seq *ConsSeq) Equals(env *Env, other interface{}) bool

func (*ConsSeq) First

func (seq *ConsSeq) First(env *Env) (any, error)

func (*ConsSeq) Hash

func (seq *ConsSeq) Hash(env *Env) (uint32, error)

func (*ConsSeq) IsEmpty

func (seq *ConsSeq) IsEmpty(env *Env) (bool, error)

func (*ConsSeq) Pprint

func (seq *ConsSeq) Pprint(env *Env, w io.Writer, indent int) (int, error)

func (*ConsSeq) Rest

func (seq *ConsSeq) Rest(env *Env) (Seq, error)

func (*ConsSeq) Seq

func (seq *ConsSeq) Seq() Seq

func (*ConsSeq) ToString

func (seq *ConsSeq) ToString(env *Env, escape bool) (string, error)

func (*ConsSeq) WithInfo

func (x *ConsSeq) WithInfo(info *ObjectInfo) any

func (*ConsSeq) WithMeta

func (seq *ConsSeq) WithMeta(env *Env, meta Map) (any, error)

type ConvRegistry

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

func (*ConvRegistry) ConverterForFunc

func (c *ConvRegistry) ConverterForFunc(v reflect.Value) (ProcFn, *conversionSet, error)

type Counted

type Counted interface {
	Count() int
}

Values that can report how many they contain.

type CountedImpl

type CountedImpl struct {
	CountFn func() int
}

func (*CountedImpl) Count

func (s *CountedImpl) Count() int

type DefData

type DefData struct {
	Meta *ArrayMap
	// contains filtered or unexported fields
}

func (*DefData) String

func (v *DefData) String() string

type DefExpr

type DefExpr struct {
	Position
	// contains filtered or unexported fields
}

func (*DefExpr) Dump

func (expr *DefExpr) Dump(pos bool) Map

func (*DefExpr) Eval

func (expr *DefExpr) Eval(genv *Env, env *LocalEnv) (any, error)

type DefTypeInfo

type DefTypeInfo struct {
	Name  string
	Doc   string
	Added string
	Tag   string

	Type reflect.Type

	Aliases []string
}

type DefVarInfo

type DefVarInfo struct {
	Name  string
	Doc   string
	Added string
	Tag   string

	Value reflect.Value
}

type DefnInfo

type DefnInfo struct {
	Name  string
	Args  []string
	Rest  bool
	Doc   string
	Added string
	Tag   string
	Tags  []DefnTag
	Fn    any

	ArgTags map[string]string

	Aliases []string

	Fns []ArityFn
}

type DefnTag

type DefnTag struct {
	Name string
	Tag  string
}

type Delay

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

A value that runs a function to produce a new value. Ie, it 'delays' running the function until the value is needed.

func (*Delay) Deref

func (d *Delay) Deref(env *Env) (any, error)

func (*Delay) Equals

func (d *Delay) Equals(env *Env, other interface{}) bool

func (*Delay) Force

func (d *Delay) Force(env *Env) (any, error)

func (*Delay) GetInfo

func (d *Delay) GetInfo() *ObjectInfo

func (*Delay) Hash

func (d *Delay) Hash(env *Env) (uint32, error)

func (*Delay) IsRealized

func (d *Delay) IsRealized() bool

func (*Delay) ToString

func (d *Delay) ToString(env *Env, escape bool) (string, error)

func (*Delay) WithInfo

func (d *Delay) WithInfo(info *ObjectInfo) any

type Deref

type Deref interface {
	Deref(env *Env) (any, error)
}

When a value can be dereference to return another value.

func AssertDeref

func AssertDeref(env *Env, obj any, msg string) (Deref, error)

func EnsureDeref

func EnsureDeref(env *Env, args []any, index int) (Deref, error)

type DerefImpl

type DerefImpl struct {
	DerefFn func(*Env) (any, error)
}

func (*DerefImpl) Deref

func (s *DerefImpl) Deref(a0 *Env) (any, error)

type Dialect

type Dialect int
const (
	CLJ Dialect = iota
	CLJS
	LACE
	EDN
	UNKNOWN
)

type DoExpr

type DoExpr struct {
	Position
	// contains filtered or unexported fields
}

func (*DoExpr) Dump

func (expr *DoExpr) Dump(pos bool) Map

func (*DoExpr) Eval

func (doExpr *DoExpr) Eval(genv *Env, env *LocalEnv) (any, error)

type Double

type Double struct {
	InfoHolder
	D float64
}

A floating point value who's size is constraint to the host's largest floating point value.

func AssertDouble

func AssertDouble(env *Env, obj any, msg string) (Double, error)

func EnsureDouble

func EnsureDouble(env *Env, args []any, index int) (Double, error)

func MakeDouble

func MakeDouble(d float64) Double

func (Double) BigFloat

func (d Double) BigFloat() *big.Float

func (Double) BigInt

func (d Double) BigInt() *big.Int

func (Double) Compare

func (d Double) Compare(env *Env, other any) (int, error)

func (Double) Double

func (d Double) Double() Double

func (Double) Equals

func (d Double) Equals(env *Env, other interface{}) bool

func (Double) Hash

func (d Double) Hash(env *Env) (uint32, error)

func (Double) Int

func (d Double) Int() Int

func (Double) Native

func (d Double) Native() interface{}

func (Double) NativeNumber

func (d Double) NativeNumber() any

func (Double) Ratio

func (d Double) Ratio() *big.Rat

func (Double) ToString

func (d Double) ToString(env *Env, escape bool) (string, error)

func (Double) WithInfo

func (x Double) WithInfo(info *ObjectInfo) any

type DoubleOps

type DoubleOps struct{}

func (DoubleOps) Add

func (ops DoubleOps) Add(x, y Number) (Number, error)

func (DoubleOps) Combine

func (ops DoubleOps) Combine(other Ops) Ops

func (DoubleOps) Divide

func (ops DoubleOps) Divide(x, y Number) (Number, error)

func (DoubleOps) Eq

func (ops DoubleOps) Eq(x Number, y Number) bool

func (DoubleOps) Gt

func (ops DoubleOps) Gt(x Number, y Number) bool

func (DoubleOps) Gte

func (ops DoubleOps) Gte(x Number, y Number) bool

func (DoubleOps) IsZero

func (ops DoubleOps) IsZero(x Number) bool

func (DoubleOps) Lt

func (ops DoubleOps) Lt(x Number, y Number) bool

func (DoubleOps) Lte

func (ops DoubleOps) Lte(x Number, y Number) bool

func (DoubleOps) Multiply

func (ops DoubleOps) Multiply(x, y Number) (Number, error)

func (DoubleOps) Quotient

func (ops DoubleOps) Quotient(x, y Number) (Number, error)

func (DoubleOps) Rem

func (ops DoubleOps) Rem(x, y Number) (Number, error)

func (DoubleOps) Subtract

func (ops DoubleOps) Subtract(x, y Number) (Number, error)

type EmptyMapIterator

type EmptyMapIterator struct {
}

func (*EmptyMapIterator) HasNext

func (iter *EmptyMapIterator) HasNext() bool

func (*EmptyMapIterator) Next

func (iter *EmptyMapIterator) Next() *Pair

type EmptySetIterator

type EmptySetIterator struct{}

func (*EmptySetIterator) HasNext

func (iter *EmptySetIterator) HasNext(env *Env) bool

func (*EmptySetIterator) Next

func (iter *EmptySetIterator) Next(env *Env) (any, error)

type Engine

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

func NewEngine

func NewEngine() *Engine

func (*Engine) RunBC

func (e *Engine) RunBC(env *Env, fn *Fn) (any, error)

func (*Engine) RunWithArgs

func (e *Engine) RunWithArgs(env *Env, fn *Fn, args []any) (any, error)

type EngineFrame

type EngineFrame struct {
	Ip        int
	Stack     []any
	SP        int32
	Code      *Fn
	Bindings  []any
	Upvals    []any
	Arity     int32
	Args      []any
	FrameSize int

	Handlers []handler
}

type Env

type Env struct {
	*State

	Parent *Env

	CurrentVar Associative
	Context    context.Context

	Engine *Engine

	DebugBytecode bool
	// contains filtered or unexported fields
}

func NewEnv

func NewEnv() (*Env, error)

func (*Env) AllNamespaceValues

func (env *Env) AllNamespaceValues() []any

func (*Env) AllNamespaces

func (env *Env) AllNamespaces() []string

func (*Env) Child

func (env *Env) Child() *Env

func (*Env) CurrentNamespace

func (env *Env) CurrentNamespace() *Namespace

func (*Env) EnsureNamespace

func (env *Env) EnsureNamespace(sym Symbol) *Namespace

func (*Env) Eval

func (env *Env) Eval(str string) (any, error)

func (*Env) FindInCurrentVars

func (env *Env) FindInCurrentVars(vr *Var) (any, bool, error)

func (*Env) FindNamespace

func (env *Env) FindNamespace(s Symbol) *Namespace

func (*Env) InitEnv

func (env *Env) InitEnv(stdin io.Reader, stdout, stderr io.Writer, args []string)

This runs after invariant initialization, which includes calling

NewEnv().

func (*Env) InitNamespace

func (env *Env) InitNamespace(sym Symbol) (*Namespace, error)

func (*Env) IsStdIn

func (env *Env) IsStdIn(obj any) bool

func (*Env) LookupNamespace

func (env *Env) LookupNamespace(s Symbol) (*Namespace, bool)

func (*Env) MakeVar

func (env *Env) MakeVar(s Symbol) (*Var, error)

func (*Env) NamespaceFor

func (env *Env) NamespaceFor(ns *Namespace, s Symbol) *Namespace

func (*Env) NewArgTypeError

func (e *Env) NewArgTypeError(index int, obj any, expectedType string) *EvalError

func (*Env) NewError

func (e *Env) NewError(msg string, args ...any) *EvalError

func (*Env) ProtoNamespace

func (env *Env) ProtoNamespace(sym Symbol) (*Namespace, error)

func (*Env) REPL

func (env *Env) REPL(in io.Reader, out io.Writer) error

func (*Env) RemoveNamespace

func (env *Env) RemoveNamespace(s Symbol) *Namespace

func (*Env) Resolve

func (env *Env) Resolve(s Symbol) (*Var, bool)

func (*Env) ResolveIn

func (env *Env) ResolveIn(n *Namespace, s Symbol) (*Var, bool)

func (*Env) ResolveSymbol

func (env *Env) ResolveSymbol(s Symbol) (Symbol, error)

func (*Env) ResolveType

func (env *Env) ResolveType(sym Symbol) any

func (*Env) ResolveTypeFroMeta

func (env *Env) ResolveTypeFroMeta(obj any) any

func (*Env) SetClassPath

func (env *Env) SetClassPath(cp string)

This runs after invariant initialization, which includes calling

NewEnv().

func (*Env) SetContext

func (e *Env) SetContext(ctx context.Context) error

func (*Env) SetCurrentNamespace

func (env *Env) SetCurrentNamespace(ns *Namespace)

func (*Env) SetEnvArgs

func (env *Env) SetEnvArgs(newArgs []string)

func (*Env) SetFilename

func (env *Env) SetFilename(obj any)

This runs after invariant initialization, which includes calling

NewEnv().

func (*Env) SetMainFilename

func (env *Env) SetMainFilename(filename string)

This runs after invariant initialization, which includes calling

NewEnv().

func (*Env) SetStdIO

func (env *Env) SetStdIO(stdin, stdout, stderr any)

func (*Env) SetupNamespace

func (env *Env) SetupNamespace(ns *Namespace) error

func (*Env) StdIO

func (env *Env) StdIO() (stdin, stdout, stderr any)

func (*Env) TypeError

func (e *Env) TypeError(ctx TCContext, obj any, expectedType string) *EvalError

type Equ

type Equ interface {
	any

	Is(o any) bool
	IsHash() uint32
}

type Equality

type Equality interface {
	Equals(env *Env, other interface{}) bool
}

interfaces

type Error

type Error interface {
	error
	Message() any
}

When things how wrong, these show up.

func AssertError

func AssertError(env *Env, obj any, msg string) (Error, error)

func EnsureError

func EnsureError(env *Env, args []any, index int) (Error, error)

type ErrorData

type ErrorData interface {
	ErrorData() Map
}

type ErrorImpl

type ErrorImpl struct {
	ErrorFn   func() string
	MessageFn func() any
}

func (*ErrorImpl) Error

func (s *ErrorImpl) Error() string

func (*ErrorImpl) Message

func (s *ErrorImpl) Message() any

type EvalError

type EvalError struct {
	Map
	// contains filtered or unexported fields
}

The standard error thrown when evalution of a program encounters an error.

func NewEvalError

func NewEvalError(env *Env, str string) *EvalError

func StubNewArgTypeError

func StubNewArgTypeError(index int, obj any, expectedType string) *EvalError

func StubNewError

func StubNewError(msg string) *EvalError

func TypeError

func TypeError[T any](env *Env, obj any) *EvalError

func WrapError

func WrapError(env *Env, err error) *EvalError

func (*EvalError) AddData

func (e *EvalError) AddData(env *Env, obj any)

func (*EvalError) Category

func (e *EvalError) Category() string

func (*EvalError) Error

func (err *EvalError) Error() string

func (*EvalError) ErrorData

func (err *EvalError) ErrorData() Map

func (*EvalError) Hash

func (err *EvalError) Hash(env *Env) (uint32, error)

func (*EvalError) Is

func (err *EvalError) Is(target error) bool

func (*EvalError) Message

func (err *EvalError) Message() any

func (*EvalError) ToString

func (err *EvalError) ToString(env *Env, escape bool) (string, error)

func (*EvalError) Unwrap

func (err *EvalError) Unwrap() error

func (*EvalError) WithInfo

func (err *EvalError) WithInfo(info *ObjectInfo) any

type ExInfo

type ExInfo struct {
	ArrayMap
	// contains filtered or unexported fields
}

func (*ExInfo) Equals

func (exInfo *ExInfo) Equals(env *Env, other interface{}) bool

func (*ExInfo) Error

func (exInfo *ExInfo) Error() string

func (*ExInfo) Hash

func (exInfo *ExInfo) Hash(env *Env) (uint32, error)

func (*ExInfo) Message

func (exInfo *ExInfo) Message() any

func (*ExInfo) ToString

func (exInfo *ExInfo) ToString(env *Env, escape bool) (string, error)

func (*ExInfo) Unwrap

func (e *ExInfo) Unwrap() error

func (*ExInfo) WithInfo

func (x *ExInfo) WithInfo(info *ObjectInfo) any

type ExitError

type ExitError struct {
	Code int
}

func (*ExitError) Error

func (e *ExitError) Error() string

type Expr

type Expr interface {
	Eval(genv *Env, env *LocalEnv) (any, error)
	Pos() Position
	Dump(includePosition bool) Map
}

func Parse

func Parse(obj any, ctx *ParseContext) (Expr, error)

func TryParse

func TryParse(obj any, ctx *ParseContext) (expr Expr, err error)

type File

type File struct {
	*os.File
}

func AssertFile

func AssertFile(env *Env, obj any, msg string) (*File, error)

func EnsureFile

func EnsureFile(env *Env, args []any, index int) (*File, error)

func ExtractFile

func ExtractFile(env *Env, args []any, index int) (*File, error)

func MakeFile

func MakeFile(f *os.File) *File

func (*File) ToString

func (f *File) ToString(env *Env, escape bool) (string, error)

type Fn

type Fn struct {
	InfoHolder
	MetaHolder
	// contains filtered or unexported fields
}

A value that contains code and can be called to run that code.

func AssertFn

func AssertFn(env *Env, obj any, msg string) (*Fn, error)

func Compile

func Compile(env *Env, exprs []Expr) (*Fn, error)

func CompileScript

func CompileScript(env *Env, exprs []Expr) (*Fn, error)

func EnsureFn

func EnsureFn(env *Env, args []any, index int) (*Fn, error)

func UnmarshalCode

func UnmarshalCode(env *Env, data []byte) (*Fn, error)

func (*Fn) Call

func (fn *Fn) Call(env *Env, args []any) (any, error)

func (*Fn) Compare

func (fn *Fn) Compare(env *Env, a, b any) (int, error)

func (*Fn) Equals

func (fn *Fn) Equals(env *Env, other interface{}) bool

func (*Fn) Hash

func (fn *Fn) Hash(env *Env) (uint32, error)

func (*Fn) String

func (fn *Fn) String() string

func (*Fn) ToString

func (fn *Fn) ToString(env *Env, escape bool) (string, error)

func (*Fn) WithInfo

func (x *Fn) WithInfo(info *ObjectInfo) any

func (*Fn) WithMeta

func (fn *Fn) WithMeta(env *Env, meta Map) (any, error)

type FnArityExpr

type FnArityExpr struct {
	Position
	// contains filtered or unexported fields
}

func (*FnArityExpr) Dump

func (expr *FnArityExpr) Dump(pos bool) Map

func (*FnArityExpr) Eval

func (expr *FnArityExpr) Eval(genv *Env, env *LocalEnv) (any, error)

type FnData

type FnData struct {
	Code *Code
}

func (*FnData) String

func (v *FnData) String() string

type FnExpr

type FnExpr struct {
	Position
	// contains filtered or unexported fields
}

func (*FnExpr) Dump

func (expr *FnExpr) Dump(pos bool) Map

func (*FnExpr) Eval

func (expr *FnExpr) Eval(genv *Env, env *LocalEnv) (any, error)

type FrameRope

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

type Future

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

func NewFuture

func NewFuture(env *Env, call Callable) (*Future, error)

NewFuture creates a new Future value and schedules the future to be run. Deref'ing the Future will retrieve the value (potentially waiting if the value is not yet ready)

func (*Future) Deref

func (f *Future) Deref(env *Env) (any, error)

func (*Future) IsRealized

func (f *Future) IsRealized() bool

func (*Future) Schedule

func (f *Future) Schedule(env *Env) error

type FutureResult

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

func MakeFutureResult

func MakeFutureResult(value any, err Error) FutureResult

type Gettable

type Gettable interface {
	Get(env *Env, key any) (bool, any, error)
}

When a collection can return a value by it's key.

type GettableImpl

type GettableImpl struct {
	GetFn func(*Env, any) (bool, any, error)
}

func (*GettableImpl) Get

func (s *GettableImpl) Get(a0 *Env, a1 any) (bool, any, error)

type GoString

type GoString string

func (GoString) AppendTo

func (s GoString) AppendTo(str String) String

func (GoString) Compare

func (s GoString) Compare(env *Env, other any) (int, error)

func (GoString) Count

func (s GoString) Count() int

func (GoString) Equals

func (s GoString) Equals(env *Env, other interface{}) bool

func (GoString) GetInfo

func (s GoString) GetInfo() *ObjectInfo

func (GoString) Hash

func (s GoString) Hash(env *Env) (uint32, error)

func (GoString) Native

func (s GoString) Native() interface{}

func (GoString) Nth

func (s GoString) Nth(env *Env, i int) (any, error)

func (GoString) S

func (s GoString) S() string

func (GoString) Seq

func (s GoString) Seq() Seq

func (GoString) ToString

func (s GoString) ToString(env *Env, escape bool) (string, error)

func (GoString) TryNth

func (s GoString) TryNth(env *Env, i int, d any) (any, error)

func (GoString) WithInfo

func (s GoString) WithInfo(info *ObjectInfo) any

type HasCategory

type HasCategory interface {
	Category() string
}

type HasEquals

type HasEquals interface {
	Equals(env *Env, other any) bool
}

type HasGetType

type HasGetType interface {
	GetType() Type
}

type HasHash

type HasHash interface {
	Hash(env *Env) (uint32, error)
}

type HasInfo

type HasInfo interface {
	GetInfo() *ObjectInfo
	WithInfo(info *ObjectInfo) any
}

type HasReflectType

type HasReflectType interface {
	ReflectType() reflect.Type
}

type HasToString

type HasToString interface {
	ToString(env *Env, escape bool) (string, error)
}

type HashCollisionNode

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

type HashMap

type HashMap struct {
	InfoHolder
	MetaHolder
	// contains filtered or unexported fields
}

A Map implementation that can store a large number of values efficiently.

func NewHashMap

func NewHashMap(env *Env, keyvals ...any) (*HashMap, error)

func (*HashMap) Assoc

func (m *HashMap) Assoc(env *Env, key, val any) (Associative, error)

func (*HashMap) Call

func (m *HashMap) Call(env *Env, args []any) (any, error)

func (*HashMap) Conj

func (m *HashMap) Conj(env *Env, obj any) (Conjable, error)

func (*HashMap) Count

func (m *HashMap) Count() int

func (*HashMap) Empty

func (m *HashMap) Empty() Collection

func (*HashMap) EntryAt

func (m *HashMap) EntryAt(env *Env, key any) (*Vector, error)

func (*HashMap) Equals

func (m *HashMap) Equals(env *Env, other interface{}) bool

func (*HashMap) Get

func (m *HashMap) Get(env *Env, key any) (bool, any, error)

func (*HashMap) GetEqu

func (m *HashMap) GetEqu(key Equ) (bool, any)

func (*HashMap) Hash

func (m *HashMap) Hash(env *Env) (uint32, error)

func (*HashMap) Iter

func (m *HashMap) Iter() MapIterator

func (*HashMap) Keys

func (m *HashMap) Keys() Seq

func (*HashMap) Merge

func (m *HashMap) Merge(env *Env, other Map) (Map, error)

func (*HashMap) Pprint

func (m *HashMap) Pprint(env *Env, w io.Writer, indent int) (int, error)

func (*HashMap) Seq

func (m *HashMap) Seq() Seq

func (*HashMap) ToString

func (m *HashMap) ToString(env *Env, escape bool) (string, error)

func (*HashMap) Vals

func (m *HashMap) Vals() Seq

func (*HashMap) WithInfo

func (x *HashMap) WithInfo(info *ObjectInfo) any

func (*HashMap) WithMeta

func (m *HashMap) WithMeta(env *Env, meta Map) (any, error)

func (*HashMap) Without

func (m *HashMap) Without(env *Env, key any) (Map, error)

type HeavyChar

type HeavyChar struct {
	InfoHolder
	// contains filtered or unexported fields
}

func (*HeavyChar) Ch

func (x *HeavyChar) Ch() rune

func (*HeavyChar) Compare

func (c *HeavyChar) Compare(env *Env, other any) (int, error)

func (*HeavyChar) Equals

func (c *HeavyChar) Equals(env *Env, other interface{}) bool

func (*HeavyChar) Hash

func (c *HeavyChar) Hash(env *Env) (uint32, error)

func (*HeavyChar) Native

func (c *HeavyChar) Native() interface{}

func (*HeavyChar) ToString

func (c *HeavyChar) ToString(env *Env, escape bool) (string, error)

func (*HeavyChar) WithInfo

func (x *HeavyChar) WithInfo(info *ObjectInfo) any

type HeavyKeyword

type HeavyKeyword struct {
	InfoHolder
	// contains filtered or unexported fields
}

func (*HeavyKeyword) Call

func (k *HeavyKeyword) Call(env *Env, args []any) (any, error)

func (*HeavyKeyword) Compare

func (k *HeavyKeyword) Compare(env *Env, other any) (int, error)

func (*HeavyKeyword) Equals

func (k *HeavyKeyword) Equals(env *Env, other interface{}) bool

func (*HeavyKeyword) Hash

func (k *HeavyKeyword) Hash(env *Env) (uint32, error)

func (*HeavyKeyword) Is

func (k *HeavyKeyword) Is(other any) bool

func (*HeavyKeyword) IsHash

func (k *HeavyKeyword) IsHash() uint32

func (*HeavyKeyword) Name

func (k *HeavyKeyword) Name() string

func (*HeavyKeyword) Namespace

func (k *HeavyKeyword) Namespace() string

func (*HeavyKeyword) RawString

func (k *HeavyKeyword) RawString() string

func (*HeavyKeyword) String

func (k *HeavyKeyword) String() string

func (*HeavyKeyword) ToString

func (k *HeavyKeyword) ToString(env *Env, escape bool) (string, error)

func (*HeavyKeyword) WithInfo

func (k *HeavyKeyword) WithInfo(info *ObjectInfo) any

type HeavyNil

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

func (HeavyNil) Assoc

func (n HeavyNil) Assoc(env *Env, key, value any) (Associative, error)

func (HeavyNil) Conj

func (n HeavyNil) Conj(env *Env, obj any) (Conjable, error)

func (HeavyNil) Cons

func (n HeavyNil) Cons(obj any) Seq

func (HeavyNil) Count

func (n HeavyNil) Count() int

func (HeavyNil) Disjoin

func (n HeavyNil) Disjoin(env *Env, key any) (Set, error)

func (HeavyNil) EntryAt

func (n HeavyNil) EntryAt(env *Env, key any) (*Vector, error)

func (HeavyNil) Equals

func (n HeavyNil) Equals(env *Env, other interface{}) bool

func (HeavyNil) First

func (n HeavyNil) First(env *Env) (any, error)

func (HeavyNil) Get

func (n HeavyNil) Get(env *Env, key any) (bool, any, error)

func (HeavyNil) GetEqu

func (n HeavyNil) GetEqu(key Equ) (bool, any)

func (HeavyNil) GetInfo

func (x HeavyNil) GetInfo() *ObjectInfo

func (HeavyNil) Has

func (n HeavyNil) Has(key Equ) bool

func (HeavyNil) Hash

func (n HeavyNil) Hash(env *Env) (uint32, error)

func (HeavyNil) IsEmpty

func (n HeavyNil) IsEmpty(env *Env) (bool, error)

func (HeavyNil) Iter

func (n HeavyNil) Iter() MapIterator

func (HeavyNil) Keys

func (n HeavyNil) Keys() Seq

func (HeavyNil) Merge

func (n HeavyNil) Merge(env *Env, other Map) (Map, error)

func (HeavyNil) Rest

func (n HeavyNil) Rest(env *Env) (Seq, error)

func (HeavyNil) Seq

func (n HeavyNil) Seq() Seq

func (HeavyNil) SetIter

func (n HeavyNil) SetIter() SetIter

func (HeavyNil) String

func (x HeavyNil) String() string

func (HeavyNil) ToString

func (n HeavyNil) ToString(env *Env, escape bool) (string, error)

func (HeavyNil) Vals

func (n HeavyNil) Vals() Seq

func (HeavyNil) WithInfo

func (x HeavyNil) WithInfo(info *ObjectInfo) any

func (HeavyNil) Without

func (n HeavyNil) Without(env *Env, key any) (Map, error)

type HeavySymbol

type HeavySymbol struct {
	InfoHolder
	MetaHolder
	// contains filtered or unexported fields
}

func MakeHeavySymbol

func MakeHeavySymbol(nsname string) *HeavySymbol

func (*HeavySymbol) Call

func (s *HeavySymbol) Call(env *Env, args []any) (any, error)

func (*HeavySymbol) Compare

func (s *HeavySymbol) Compare(env *Env, other any) (int, error)

func (*HeavySymbol) Equals

func (s *HeavySymbol) Equals(env *Env, other interface{}) bool

func (*HeavySymbol) Hash

func (s *HeavySymbol) Hash(env *Env) (uint32, error)

func (*HeavySymbol) Is

func (s *HeavySymbol) Is(other any) bool

func (*HeavySymbol) IsHash

func (s *HeavySymbol) IsHash() uint32

func (*HeavySymbol) Name

func (s *HeavySymbol) Name() string

func (*HeavySymbol) Namespace

func (s *HeavySymbol) Namespace() string

func (*HeavySymbol) String

func (s *HeavySymbol) String() string

func (*HeavySymbol) ToString

func (s *HeavySymbol) ToString(env *Env, escape bool) (string, error)

func (*HeavySymbol) WithInfo

func (x *HeavySymbol) WithInfo(info *ObjectInfo) any

func (*HeavySymbol) WithMeta

func (sym *HeavySymbol) WithMeta(env *Env, meta Map) (any, error)

type IOReader

type IOReader struct {
	io.Reader
	// contains filtered or unexported fields
}

func MakeIOReader

func MakeIOReader(r io.Reader) *IOReader

func (*IOReader) Close

func (ior *IOReader) Close(env *Env) error

func (*IOReader) ToString

func (ior *IOReader) ToString(env *Env, escape bool) (string, error)

type IOWriter

type IOWriter struct {
	io.Writer
	// contains filtered or unexported fields
}

func MakeIOWriter

func MakeIOWriter(w io.Writer) *IOWriter

func (*IOWriter) Close

func (iow *IOWriter) Close(env *Env) error

func (*IOWriter) ToString

func (iow *IOWriter) ToString(env *Env, escape bool) (string, error)

type IPending

type IPending interface {
	IsRealized() bool
}

type IfExpr

type IfExpr struct {
	Position
	// contains filtered or unexported fields
}

func (*IfExpr) Dump

func (expr *IfExpr) Dump(pos bool) Map

func (*IfExpr) Eval

func (expr *IfExpr) Eval(genv *Env, env *LocalEnv) (any, error)

type IndexCounted

type IndexCounted interface {
	Indexed
	Counted
}

interfaces

type Indexed

type Indexed interface {
	Nth(env *Env, i int) (any, error)
	TryNth(env *Env, i int, d any) (any, error)
}

When a collection can return a contained value an a fixed offset.

type IndexedImpl

type IndexedImpl struct {
	NthFn    func(*Env, int) (any, error)
	TryNthFn func(*Env, int, any) (any, error)
}

func (*IndexedImpl) Nth

func (s *IndexedImpl) Nth(a0 *Env, a1 int) (any, error)

func (*IndexedImpl) TryNth

func (s *IndexedImpl) TryNth(a0 *Env, a1 int, a2 any) (any, error)

type InfoHolder

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

implementations

func (InfoHolder) GetInfo

func (i InfoHolder) GetInfo() *ObjectInfo

type Instruction

type Instruction struct {
	Op   OpCode
	A0   int32
	S    string
	Data InstructionData
}

type InstructionData

type InstructionData interface {
	// contains filtered or unexported methods
}

type Int

type Int int

The host int value

func AssertInt

func AssertInt(env *Env, obj any, msg string) (Int, error)

func EnsureInt

func EnsureInt(env *Env, args []any, index int) (Int, error)

func MakeInt

func MakeInt(i int) Int

func (Int) BigFloat

func (i Int) BigFloat() *big.Float

func (Int) BigInt

func (i Int) BigInt() *big.Int

func (Int) Compare

func (i Int) Compare(env *Env, other any) (int, error)

func (Int) Double

func (i Int) Double() Double

func (Int) Equals

func (i Int) Equals(env *Env, other interface{}) bool

func (Int) GetInfo

func (i Int) GetInfo() *ObjectInfo

func (Int) Hash

func (i Int) Hash(env *Env) (uint32, error)

func (Int) I

func (i Int) I() int

func (Int) I64

func (i Int) I64() int64

func (Int) Int

func (i Int) Int() Int

func (Int) Native

func (i Int) Native() interface{}

func (Int) NativeNumber

func (i Int) NativeNumber() any

func (Int) Ratio

func (i Int) Ratio() *big.Rat

func (Int) ToString

func (i Int) ToString(env *Env, escape bool) (string, error)

func (Int) WithInfo

func (i Int) WithInfo(info *ObjectInfo) any

type IntOps

type IntOps struct{}

func (IntOps) Add

func (ops IntOps) Add(x, y Number) (Number, error)

func (IntOps) Combine

func (ops IntOps) Combine(other Ops) Ops

func (IntOps) Divide

func (ops IntOps) Divide(x, y Number) (Number, error)

func (IntOps) Eq

func (ops IntOps) Eq(x Number, y Number) bool

func (IntOps) Gt

func (ops IntOps) Gt(x Number, y Number) bool

func (IntOps) Gte

func (ops IntOps) Gte(x Number, y Number) bool

func (IntOps) IsZero

func (ops IntOps) IsZero(x Number) bool

func (IntOps) Lt

func (ops IntOps) Lt(x Number, y Number) bool

func (IntOps) Lte

func (ops IntOps) Lte(x Number, y Number) bool

func (IntOps) Multiply

func (ops IntOps) Multiply(x, y Number) (Number, error)

func (IntOps) Quotient

func (ops IntOps) Quotient(x, y Number) (Number, error)

func (IntOps) Rem

func (ops IntOps) Rem(x, y Number) (Number, error)

func (IntOps) Subtract

func (ops IntOps) Subtract(x, y Number) (Number, error)

type Integer

type Integer interface {
	I64() int64
	// contains filtered or unexported methods
}

The Common integer type (can be Int or BigInt)

type IntegerImpl

type IntegerImpl struct {
	I64Fn func() int64
	// contains filtered or unexported fields
}

func (*IntegerImpl) I64

func (s *IntegerImpl) I64() int64

type KVReduce

type KVReduce interface {
	// contains filtered or unexported methods
}

When a value can orchestrate reducing itself value a callable.

func AssertKVReduce

func AssertKVReduce(env *Env, obj any, msg string) (KVReduce, error)

func EnsureKVReduce

func EnsureKVReduce(env *Env, args []any, index int) (KVReduce, error)

type KVReduceImpl

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

type Keyword

type Keyword interface {
	Equ
	Comparable
	Callable
	HasInfo

	Name() string
	Namespace() string
	String() string
	RawString() string
	// contains filtered or unexported methods
}

A value that is just a name who's meaning is itself. It sounds meta, I know. It's just a name, usually used as a key in a association. Maybe you want to think of it as a short, compact, namespace'd string? That's fine.

func AssertKeyword

func AssertKeyword(env *Env, obj any, msg string) (Keyword, error)

func EnsureKeyword

func EnsureKeyword(env *Env, args []any, index int) (Keyword, error)

func MakeKeyword

func MakeKeyword(nsname string) Keyword

func NewKeyword

func NewKeyword(ns, name string) Keyword

type KeywordImpl

type KeywordImpl struct {
	CallFn      func(*Env, []any) (any, error)
	CompareFn   func(*Env, any) (int, error)
	GetInfoFn   func() *ObjectInfo
	IsFn        func(any) bool
	IsHashFn    func() uint32
	NameFn      func() string
	NamespaceFn func() string
	RawStringFn func() string
	StringFn    func() string
	WithInfoFn  func(*ObjectInfo) any
	// contains filtered or unexported fields
}

func (*KeywordImpl) Call

func (s *KeywordImpl) Call(a0 *Env, a1 []any) (any, error)

func (*KeywordImpl) Compare

func (s *KeywordImpl) Compare(a0 *Env, a1 any) (int, error)

func (*KeywordImpl) GetInfo

func (s *KeywordImpl) GetInfo() *ObjectInfo

func (*KeywordImpl) Is

func (s *KeywordImpl) Is(a0 any) bool

func (*KeywordImpl) IsHash

func (s *KeywordImpl) IsHash() uint32

func (*KeywordImpl) Name

func (s *KeywordImpl) Name() string

func (*KeywordImpl) Namespace

func (s *KeywordImpl) Namespace() string

func (*KeywordImpl) RawString

func (s *KeywordImpl) RawString() string

func (*KeywordImpl) String

func (s *KeywordImpl) String() string

func (*KeywordImpl) WithInfo

func (s *KeywordImpl) WithInfo(a0 *ObjectInfo) any

type Keywords

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

type LazySeq

type LazySeq struct {
	InfoHolder
	MetaHolder
	// contains filtered or unexported fields
}

func NewLazySeq

func NewLazySeq(c Callable) *LazySeq

func (*LazySeq) Cons

func (seq *LazySeq) Cons(obj any) Seq

func (*LazySeq) Equals

func (seq *LazySeq) Equals(env *Env, other interface{}) bool

func (*LazySeq) First

func (seq *LazySeq) First(env *Env) (any, error)

func (*LazySeq) Hash

func (seq *LazySeq) Hash(env *Env) (uint32, error)

func (*LazySeq) IsEmpty

func (seq *LazySeq) IsEmpty(env *Env) (bool, error)

func (*LazySeq) IsRealized

func (seq *LazySeq) IsRealized() bool

func (*LazySeq) Pprint

func (seq *LazySeq) Pprint(env *Env, w io.Writer, indent int) (int, error)

func (*LazySeq) Rest

func (seq *LazySeq) Rest(env *Env) (Seq, error)

func (*LazySeq) Seq

func (seq *LazySeq) Seq() Seq

func (*LazySeq) ToString

func (seq *LazySeq) ToString(env *Env, escape bool) (string, error)

func (*LazySeq) WithInfo

func (x *LazySeq) WithInfo(info *ObjectInfo) any

func (*LazySeq) WithMeta

func (seq *LazySeq) WithMeta(env *Env, meta Map) (any, error)

type LetExpr

type LetExpr struct {
	Position
	// contains filtered or unexported fields
}

func (*LetExpr) Dump

func (expr *LetExpr) Dump(pos bool) Map

func (*LetExpr) Eval

func (expr *LetExpr) Eval(genv *Env, env *LocalEnv) (any, error)

type LightSymbol

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

func (*LightSymbol) Call

func (s *LightSymbol) Call(env *Env, args []any) (any, error)

func (*LightSymbol) Compare

func (s *LightSymbol) Compare(env *Env, other any) (int, error)

func (*LightSymbol) Equals

func (s *LightSymbol) Equals(env *Env, other interface{}) bool

func (*LightSymbol) GetInfo

func (sym *LightSymbol) GetInfo() *ObjectInfo

func (*LightSymbol) GetMeta

func (sym *LightSymbol) GetMeta() Map

func (*LightSymbol) Hash

func (s *LightSymbol) Hash(env *Env) (uint32, error)

func (*LightSymbol) Is

func (s *LightSymbol) Is(other any) bool

func (*LightSymbol) IsHash

func (s *LightSymbol) IsHash() uint32

func (*LightSymbol) Name

func (s *LightSymbol) Name() string

func (*LightSymbol) Namespace

func (s *LightSymbol) Namespace() string

func (*LightSymbol) String

func (s *LightSymbol) String() string

func (*LightSymbol) ToString

func (s *LightSymbol) ToString(env *Env, escape bool) (string, error)

func (*LightSymbol) WithInfo

func (sym *LightSymbol) WithInfo(info *ObjectInfo) any

func (*LightSymbol) WithMeta

func (sym *LightSymbol) WithMeta(env *Env, meta Map) (any, error)

type LineRuneReader

type LineRuneReader struct {
	Prompt string
	// contains filtered or unexported fields
}

func NewLineRuneReader

func NewLineRuneReader(rl *liner.State) *LineRuneReader

func (*LineRuneReader) ReadRune

func (lrr *LineRuneReader) ReadRune() (rune, int, error)

type List

type List struct {
	InfoHolder
	MetaHolder
	// contains filtered or unexported fields
}

The standard lisp persistent list.

func NewList

func NewList(first any, rest *List) *List

func NewListFrom

func NewListFrom(objs ...any) *List

func (*List) Conj

func (list *List) Conj(env *Env, obj any) (Conjable, error)

func (*List) Cons

func (list *List) Cons(obj any) Seq

func (*List) Count

func (list *List) Count() int

func (*List) Empty

func (list *List) Empty() Collection

func (*List) Equals

func (list *List) Equals(env *Env, other interface{}) bool

func (*List) First

func (list *List) First(env *Env) (any, error)

func (*List) Forth

func (list *List) Forth() any

func (*List) Hash

func (list *List) Hash(env *Env) (uint32, error)

func (*List) IsEmpty

func (list *List) IsEmpty(env *Env) (bool, error)

func (*List) Peek

func (list *List) Peek(env *Env) (any, error)

func (*List) Pop

func (list *List) Pop(env *Env) (Stack, error)

func (*List) Pprint

func (seq *List) Pprint(env *Env, w io.Writer, indent int) (int, error)

func (*List) Rest

func (list *List) Rest(env *Env) (Seq, error)

func (*List) Second

func (list *List) Second() any

func (*List) Seq

func (list *List) Seq() Seq

func (*List) Third

func (list *List) Third() any

func (*List) ToString

func (list *List) ToString(env *Env, escape bool) (string, error)

func (*List) WithInfo

func (x *List) WithInfo(info *ObjectInfo) any

func (*List) WithMeta

func (list *List) WithMeta(env *Env, meta Map) (any, error)

type LiteralData

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

func (*LiteralData) String

func (v *LiteralData) String() string

type LiteralExpr

type LiteralExpr struct {
	Position
	// contains filtered or unexported fields
}

func NewLiteralExpr

func NewLiteralExpr(obj any) *LiteralExpr

func NewSurrogateExpr

func NewSurrogateExpr(obj any) *LiteralExpr

func (*LiteralExpr) Dump

func (expr *LiteralExpr) Dump(pos bool) Map

func (*LiteralExpr) Eval

func (expr *LiteralExpr) Eval(genv *Env, env *LocalEnv) (any, error)

type LocalEnv

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

type LoopExpr

type LoopExpr LetExpr

func (*LoopExpr) Dump

func (expr *LoopExpr) Dump(pos bool) Map

func (*LoopExpr) Eval

func (expr *LoopExpr) Eval(genv *Env, env *LocalEnv) (any, error)

type MacroCallExpr

type MacroCallExpr struct {
	Position
	// contains filtered or unexported fields
}

func (*MacroCallExpr) Dump

func (expr *MacroCallExpr) Dump(pos bool) Map

func (*MacroCallExpr) Eval

func (expr *MacroCallExpr) Eval(genv *Env, env *LocalEnv) (any, error)

func (*MacroCallExpr) Name

func (expr *MacroCallExpr) Name() string

type Map

type Map interface {
	Associative
	Seqable
	Counted
	Without(env *Env, key any) (Map, error)
	Keys() Seq
	Vals() Seq
	Merge(env *Env, m Map) (Map, error)
	Iter() MapIterator
	GetEqu(key Equ) (bool, any)
}

A collection that contains the full complement of functionality for dealing with having objects that are stored by association with a key.

func AlterMeta

func AlterMeta(env *Env, m *MetaHolder, fn *Fn, args []any) (Map, error)

func AssertMap

func AssertMap(env *Env, obj any, msg string) (Map, error)

func EnsureMap

func EnsureMap(env *Env, args []any, index int) (Map, error)

func ExtractMap

func ExtractMap(env *Env, args []any, index int) (Map, error)

func FileInfoMap

func FileInfoMap(env *Env, name string, info os.FileInfo) Map

func GetMeta

func GetMeta(obj any) Map

func SafeMerge

func SafeMerge(env *Env, m1, m2 Map) (Map, error)

type MapExpr

type MapExpr struct {
	Position
	// contains filtered or unexported fields
}

func (*MapExpr) Dump

func (expr *MapExpr) Dump(pos bool) Map

func (*MapExpr) Eval

func (expr *MapExpr) Eval(genv *Env, env *LocalEnv) (any, error)

type MapImpl

type MapImpl struct {
	AssocFn   func(*Env, any, any) (Associative, error)
	ConjFn    func(*Env, any) (Conjable, error)
	CountFn   func() int
	EntryAtFn func(*Env, any) (*Vector, error)
	GetFn     func(*Env, any) (bool, any, error)
	GetEquFn  func(Equ) (bool, any)
	IterFn    func() MapIterator
	KeysFn    func() Seq
	MergeFn   func(*Env, Map) (Map, error)
	SeqFn     func() Seq
	ValsFn    func() Seq
	WithoutFn func(*Env, any) (Map, error)
}

func (*MapImpl) Assoc

func (s *MapImpl) Assoc(a0 *Env, a1 any, a2 any) (Associative, error)

func (*MapImpl) Conj

func (s *MapImpl) Conj(a0 *Env, a1 any) (Conjable, error)

func (*MapImpl) Count

func (s *MapImpl) Count() int

func (*MapImpl) EntryAt

func (s *MapImpl) EntryAt(a0 *Env, a1 any) (*Vector, error)

func (*MapImpl) Get

func (s *MapImpl) Get(a0 *Env, a1 any) (bool, any, error)

func (*MapImpl) GetEqu

func (s *MapImpl) GetEqu(a0 Equ) (bool, any)

func (*MapImpl) Iter

func (s *MapImpl) Iter() MapIterator

func (*MapImpl) Keys

func (s *MapImpl) Keys() Seq

func (*MapImpl) Merge

func (s *MapImpl) Merge(a0 *Env, a1 Map) (Map, error)

func (*MapImpl) Seq

func (s *MapImpl) Seq() Seq

func (*MapImpl) Vals

func (s *MapImpl) Vals() Seq

func (*MapImpl) Without

func (s *MapImpl) Without(a0 *Env, a1 any) (Map, error)

type MapIterator

type MapIterator interface {
	HasNext() bool
	Next() *Pair
}

type MapSet

type MapSet struct {
	InfoHolder
	MetaHolder
	// contains filtered or unexported fields
}

A Set implementation that uses a Map.

func EmptySet

func EmptySet() *MapSet

func NewSetFromSeq

func NewSetFromSeq(env *Env, s Seq) (*MapSet, error)

func (*MapSet) Add

func (set *MapSet) Add(env *Env, obj any) (bool, error)

func (*MapSet) Call

func (set *MapSet) Call(env *Env, args []any) (any, error)

func (*MapSet) Conj

func (set *MapSet) Conj(env *Env, obj any) (Conjable, error)

func (*MapSet) Count

func (set *MapSet) Count() int

func (*MapSet) Disjoin

func (set *MapSet) Disjoin(env *Env, key any) (Set, error)

func (*MapSet) Empty

func (set *MapSet) Empty() Collection

func (*MapSet) Equals

func (set *MapSet) Equals(env *Env, other interface{}) bool

func (*MapSet) Get

func (set *MapSet) Get(env *Env, key any) (bool, any, error)

func (*MapSet) Has

func (set *MapSet) Has(key Equ) bool

func (*MapSet) Hash

func (set *MapSet) Hash(env *Env) (uint32, error)

func (*MapSet) Pprint

func (set *MapSet) Pprint(env *Env, w io.Writer, indent int) (int, error)

func (*MapSet) Seq

func (set *MapSet) Seq() Seq

func (*MapSet) SetIter

func (set *MapSet) SetIter() SetIter

func (*MapSet) ToString

func (set *MapSet) ToString(env *Env, escape bool) (string, error)

func (*MapSet) WithInfo

func (x *MapSet) WithInfo(info *ObjectInfo) any

func (*MapSet) WithMeta

func (v *MapSet) WithMeta(env *Env, meta Map) (any, error)

type MapSetIter

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

func (*MapSetIter) HasNext

func (i *MapSetIter) HasNext(env *Env) bool

func (*MapSetIter) Next

func (i *MapSetIter) Next(env *Env) (any, error)

type MappingSeq

type MappingSeq struct {
	InfoHolder
	MetaHolder
	// contains filtered or unexported fields
}

func (*MappingSeq) Cons

func (seq *MappingSeq) Cons(obj any) Seq

func (*MappingSeq) Equals

func (seq *MappingSeq) Equals(env *Env, other interface{}) bool

func (*MappingSeq) First

func (seq *MappingSeq) First(env *Env) (any, error)

func (*MappingSeq) Hash

func (seq *MappingSeq) Hash(env *Env) (uint32, error)

func (*MappingSeq) IsEmpty

func (seq *MappingSeq) IsEmpty(env *Env) (bool, error)

func (*MappingSeq) Pprint

func (seq *MappingSeq) Pprint(env *Env, w io.Writer, indent int) (int, error)

func (*MappingSeq) Rest

func (seq *MappingSeq) Rest(env *Env) (Seq, error)

func (*MappingSeq) Seq

func (seq *MappingSeq) Seq() Seq

func (*MappingSeq) ToString

func (seq *MappingSeq) ToString(env *Env, escape bool) (string, error)

func (*MappingSeq) WithInfo

func (x *MappingSeq) WithInfo(info *ObjectInfo) any

func (*MappingSeq) WithMeta

func (seq *MappingSeq) WithMeta(env *Env, meta Map) (any, error)

type Meta

type Meta interface {
	GetMeta() Map
	WithMeta(*Env, Map) (any, error)
}

When a value can contain additional information.

func AssertMeta

func AssertMeta(env *Env, obj any, msg string) (Meta, error)

func EnsureMeta

func EnsureMeta(env *Env, args []any, index int) (Meta, error)

type MetaExpr

type MetaExpr struct {
	Position
	// contains filtered or unexported fields
}

func (*MetaExpr) Dump

func (expr *MetaExpr) Dump(pos bool) Map

func (*MetaExpr) Eval

func (expr *MetaExpr) Eval(genv *Env, env *LocalEnv) (any, error)

type MetaHolder

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

implementations

func (*MetaHolder) ClearMeta

func (m *MetaHolder) ClearMeta()

func (MetaHolder) GetMeta

func (m MetaHolder) GetMeta() Map

type MetaImpl

type MetaImpl struct {
	GetMetaFn  func() Map
	WithMetaFn func(*Env, Map) (any, error)
}

func (*MetaImpl) GetMeta

func (s *MetaImpl) GetMeta() Map

func (*MetaImpl) WithMeta

func (s *MetaImpl) WithMeta(a0 *Env, a1 Map) (any, error)

type MethodCallData

type MethodCallData struct {
	Method string
}

type MethodExpr

type MethodExpr struct {
	Position
	// contains filtered or unexported fields
}

func (*MethodExpr) Dump

func (expr *MethodExpr) Dump(pos bool) Map

func (*MethodExpr) Eval

func (expr *MethodExpr) Eval(genv *Env, env *LocalEnv) (any, error)

type MethodSite

type MethodSite struct {
	Method string
	Arity  uint
}

type NSBuilder

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

func NewNSBuilder

func NewNSBuilder(env *Env, name string) *NSBuilder

func (*NSBuilder) Def

func (b *NSBuilder) Def(name string, obj any)

func (*NSBuilder) DefType

func (b *NSBuilder) DefType(i *DefTypeInfo) *NSBuilder

func (*NSBuilder) DefVar

func (b *NSBuilder) DefVar(i *DefVarInfo) *NSBuilder

func (*NSBuilder) Defn

func (n *NSBuilder) Defn(b *DefnInfo) *NSBuilder

func (*NSBuilder) NSMeta

func (b *NSBuilder) NSMeta(doc, added string)

func (*NSBuilder) Namespace

func (b *NSBuilder) Namespace() *Namespace

func (*NSBuilder) ReferCore

func (b *NSBuilder) ReferCore()

func (*NSBuilder) Run

func (b *NSBuilder) Run(code []byte) error

type Named

type Named interface {
	Name() string
	Namespace() string
}

When a value has a name.

func AssertNamed

func AssertNamed(env *Env, obj any, msg string) (Named, error)

func EnsureNamed

func EnsureNamed(env *Env, args []any, index int) (Named, error)

type NamedImpl

type NamedImpl struct {
	NameFn      func() string
	NamespaceFn func() string
}

func (*NamedImpl) Name

func (s *NamedImpl) Name() string

func (*NamedImpl) Namespace

func (s *NamedImpl) Namespace() string

type NamedPair

type NamedPair struct {
	Key   any
	Value any
}

func MakeNamedPair

func MakeNamedPair(key any, obj any) *NamedPair

func (*NamedPair) Equals

func (p *NamedPair) Equals(env *Env, other interface{}) bool

func (*NamedPair) Hash

func (p *NamedPair) Hash(env *Env) (uint32, error)

func (*NamedPair) ToString

func (p *NamedPair) ToString(env *Env, escape bool) (string, error)

func (*NamedPair) WithInfo

func (p *NamedPair) WithInfo(info *ObjectInfo) any

type Namespace

type Namespace struct {
	MetaHolder
	Name Symbol
	Lazy func(env *Env, ns *Namespace)
	// contains filtered or unexported fields
}

A namespace is a named collection and the foundation of clojure/lace. A namespace holds vars and functions run in the context of a namespace.

func AssertNamespace

func AssertNamespace(env *Env, obj any, msg string) (*Namespace, error)

func EnsureNamespace

func EnsureNamespace(env *Env, args []any, index int) (*Namespace, error)

func NewNamespace

func NewNamespace(env *Env, sym Symbol) (*Namespace, error)

func SetupPkgReflect

func SetupPkgReflect(env *Env) ([]*Namespace, error)

func (*Namespace) AddAlias

func (ns *Namespace) AddAlias(env *Env, alias Symbol, namespace *Namespace) error

func (*Namespace) AliasNames

func (ns *Namespace) AliasNames() []string

func (*Namespace) AlterMeta

func (ns *Namespace) AlterMeta(env *Env, fn *Fn, args []any) (Map, error)

func (*Namespace) CoreP

func (ns *Namespace) CoreP() bool

func (*Namespace) DeleteVar

func (ns *Namespace) DeleteVar(name string)

func (*Namespace) Equals

func (ns *Namespace) Equals(env *Env, other interface{}) bool

func (*Namespace) GetInfo

func (ns *Namespace) GetInfo() *ObjectInfo

func (*Namespace) Hash

func (ns *Namespace) Hash(env *Env) (uint32, error)

func (*Namespace) Intern

func (ns *Namespace) Intern(env *Env, sym Symbol) (*Var, error)

func (*Namespace) InternVar

func (ns *Namespace) InternVar(env *Env, name string, val any, meta *ArrayMap) (*Var, error)

func (*Namespace) LookupVar

func (ns *Namespace) LookupVar(name string) (*Var, bool)

func (*Namespace) Mappings

func (ns *Namespace) Mappings() map[string]*Var

func (*Namespace) MappingsAsMap

func (ns *Namespace) MappingsAsMap(env *Env) Map

func (*Namespace) MaybeLazy

func (ns *Namespace) MaybeLazy(env *Env, doc string)

func (*Namespace) Print

func (ns *Namespace) Print(w io.Writer, printReadably bool)

func (*Namespace) Qual

func (ns *Namespace) Qual() string

func (*Namespace) Refer

func (ns *Namespace) Refer(env *Env, sym Symbol, vr *Var) (*Var, error)

func (*Namespace) ReferAll

func (ns *Namespace) ReferAll(other *Namespace, safe bool)

func (*Namespace) ResetMeta

func (ns *Namespace) ResetMeta(newMeta Map) Map

func (*Namespace) Resolve

func (ns *Namespace) Resolve(name string) *Var

func (*Namespace) ToString

func (ns *Namespace) ToString(env *Env, escape bool) (string, error)

func (*Namespace) VarNames

func (ns *Namespace) VarNames() []string

func (*Namespace) WithInfo

func (ns *Namespace) WithInfo(info *ObjectInfo) any

func (*Namespace) WithMeta

func (ns *Namespace) WithMeta(env *Env, meta Map) (any, error)

type Native

type Native interface {
	Native() interface{}
}

interfaces

type NativeSetup

type NativeSetup func(env *Env) error

type Nil

type Nil interface {
	any
	Conjable
	Counted
	Gettable
	Associative
	HasInfo
	Seq
	Map
	// contains filtered or unexported methods
}

The nothing type.

type NilImpl

type NilImpl struct {
	AssocFn    func(*Env, any, any) (Associative, error)
	ConjFn     func(*Env, any) (Conjable, error)
	ConsFn     func(any) Seq
	CountFn    func() int
	EntryAtFn  func(*Env, any) (*Vector, error)
	FirstFn    func(*Env) (any, error)
	GetFn      func(*Env, any) (bool, any, error)
	GetEquFn   func(Equ) (bool, any)
	GetInfoFn  func() *ObjectInfo
	IsEmptyFn  func(*Env) (bool, error)
	IterFn     func() MapIterator
	KeysFn     func() Seq
	MergeFn    func(*Env, Map) (Map, error)
	RestFn     func(*Env) (Seq, error)
	SeqFn      func() Seq
	ValsFn     func() Seq
	WithInfoFn func(*ObjectInfo) any
	WithoutFn  func(*Env, any) (Map, error)
	// contains filtered or unexported fields
}

func (*NilImpl) Assoc

func (s *NilImpl) Assoc(a0 *Env, a1 any, a2 any) (Associative, error)

func (*NilImpl) Conj

func (s *NilImpl) Conj(a0 *Env, a1 any) (Conjable, error)

func (*NilImpl) Cons

func (s *NilImpl) Cons(a0 any) Seq

func (*NilImpl) Count

func (s *NilImpl) Count() int

func (*NilImpl) EntryAt

func (s *NilImpl) EntryAt(a0 *Env, a1 any) (*Vector, error)

func (*NilImpl) First

func (s *NilImpl) First(a0 *Env) (any, error)

func (*NilImpl) Get

func (s *NilImpl) Get(a0 *Env, a1 any) (bool, any, error)

func (*NilImpl) GetEqu

func (s *NilImpl) GetEqu(a0 Equ) (bool, any)

func (*NilImpl) GetInfo

func (s *NilImpl) GetInfo() *ObjectInfo

func (*NilImpl) IsEmpty

func (s *NilImpl) IsEmpty(a0 *Env) (bool, error)

func (*NilImpl) Iter

func (s *NilImpl) Iter() MapIterator

func (*NilImpl) Keys

func (s *NilImpl) Keys() Seq

func (*NilImpl) Merge

func (s *NilImpl) Merge(a0 *Env, a1 Map) (Map, error)

func (*NilImpl) Rest

func (s *NilImpl) Rest(a0 *Env) (Seq, error)

func (*NilImpl) Seq

func (s *NilImpl) Seq() Seq

func (*NilImpl) Vals

func (s *NilImpl) Vals() Seq

func (*NilImpl) WithInfo

func (s *NilImpl) WithInfo(a0 *ObjectInfo) any

func (*NilImpl) Without

func (s *NilImpl) Without(a0 *Env, a1 any) (Map, error)

type Node

type Node interface {
	// contains filtered or unexported methods
}

type NodeIterator

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

func (*NodeIterator) HasNext

func (iter *NodeIterator) HasNext() bool

func (*NodeIterator) Next

func (iter *NodeIterator) Next() *Pair

type NodeSeq

type NodeSeq struct {
	InfoHolder
	MetaHolder
	// contains filtered or unexported fields
}

func (*NodeSeq) Cons

func (s *NodeSeq) Cons(obj any) Seq

func (*NodeSeq) Equals

func (s *NodeSeq) Equals(env *Env, other interface{}) bool

func (*NodeSeq) First

func (s *NodeSeq) First(env *Env) (any, error)

func (*NodeSeq) Hash

func (s *NodeSeq) Hash(env *Env) (uint32, error)

func (*NodeSeq) IsEmpty

func (s *NodeSeq) IsEmpty(env *Env) (bool, error)

func (*NodeSeq) Pprint

func (seq *NodeSeq) Pprint(env *Env, w io.Writer, indent int) (int, error)

func (*NodeSeq) Rest

func (s *NodeSeq) Rest(env *Env) (Seq, error)

func (*NodeSeq) Seq

func (s *NodeSeq) Seq() Seq

func (*NodeSeq) ToString

func (s *NodeSeq) ToString(env *Env, escape bool) (string, error)

func (*NodeSeq) WithInfo

func (x *NodeSeq) WithInfo(info *ObjectInfo) any

func (*NodeSeq) WithMeta

func (s *NodeSeq) WithMeta(env *Env, meta Map) (any, error)

type Number

type Number interface {
	any
	Int() Int
	Double() Double
	BigInt() *big.Int
	BigFloat() *big.Float
	Ratio() *big.Rat

	NativeNumber() any
}

A number is any kind of sequence of numerals. This includes normal, integers of any size, floating point values of any size, as well as ratios (like 1/3).

func AssertNumber

func AssertNumber(env *Env, obj any, msg string) (Number, error)

func EnsureNumber

func EnsureNumber(env *Env, args []any, index int) (Number, error)

func ExtractNumber

func ExtractNumber(env *Env, args []any, index int) (Number, error)

func Max

func Max(x Number, y Number) Number

func Min

func Min(x Number, y Number) Number

type NumberImpl

type NumberImpl struct {
	BigFloatFn     func() *big.Float
	BigIntFn       func() *big.Int
	DoubleFn       func() Double
	IntFn          func() Int
	NativeNumberFn func() any
	RatioFn        func() *big.Rat
}

func (*NumberImpl) BigFloat

func (s *NumberImpl) BigFloat() *big.Float

func (*NumberImpl) BigInt

func (s *NumberImpl) BigInt() *big.Int

func (*NumberImpl) Double

func (s *NumberImpl) Double() Double

func (*NumberImpl) Int

func (s *NumberImpl) Int() Int

func (*NumberImpl) NativeNumber

func (s *NumberImpl) NativeNumber() any

func (*NumberImpl) Ratio

func (s *NumberImpl) Ratio() *big.Rat

type ObjectInfo

type ObjectInfo struct {
	Position
}

implementations

func GetInfo

func GetInfo(obj any) *ObjectInfo

type OpCode

type OpCode byte
const (
	Noop OpCode = iota
	Pop
	Dup
	Jump
	JumpIfTrue
	JumpIfFalse
	ResolveVar
	SetMacro
	GetBinding
	GetUpval
	SetUpval
	PushLiteral
	MakeVector
	MakeSmallMap
	MakeLargeMap
	MakeSet
	DefValue
	DefValue3
	Def
	Def3
	SetMeta
	Call
	Apply
	MethodCall
	Throw
	PushHandler
	PopHandler
	CheckType
	SetLocal
	GetLocal
	Return
	CheckArityFixed
	CheckArityMin
	ThrowArity
	MakeFn
	RefUpval
	PushSelfFn
	PushNil
	PushInt
	SetLabel // only used during bytecode generation
	SetLine  // only used during bytecode generation
	SetFile  // only used during bytecode generation
)

func (OpCode) String

func (i OpCode) String() string

type Opaque

type Opaque[T any] struct {
	Value T
}

func MakeOpaque

func MakeOpaque[T any](f T) *Opaque[T]

func (*Opaque[T]) ToString

func (f *Opaque[T]) ToString(env *Env, escape bool) (string, error)

type Ops

type Ops interface {
	Combine(ops Ops) Ops
	Add(Number, Number) (Number, error)
	Subtract(Number, Number) (Number, error)
	Multiply(Number, Number) (Number, error)
	Divide(Number, Number) (Number, error)
	IsZero(Number) bool
	Lt(Number, Number) bool
	Lte(Number, Number) bool
	Gt(Number, Number) bool
	Gte(Number, Number) bool
	Eq(Number, Number) bool
	Quotient(Number, Number) (Number, error)
	Rem(Number, Number) (Number, error)
}

func GetOps

func GetOps(obj any) Ops

type OutConvError

type OutConvError string

func (OutConvError) Error

func (s OutConvError) Error() string

type Pair

type Pair struct {
	Key   any
	Value any
}

type ParseContext

type ParseContext struct {
	Env *Env
	// contains filtered or unexported fields
}

func (*ParseContext) GetLocalBinding

func (ctx *ParseContext) GetLocalBinding(sym Symbol) *Binding

func (*ParseContext) GetLoopBindings

func (ctx *ParseContext) GetLoopBindings() []Symbol

func (*ParseContext) PopLocalFrame

func (ctx *ParseContext) PopLocalFrame()

func (*ParseContext) PopLoopBindings

func (ctx *ParseContext) PopLoopBindings()

func (*ParseContext) PushEmptyLocalFrame

func (ctx *ParseContext) PushEmptyLocalFrame()

func (*ParseContext) PushLocalFrame

func (ctx *ParseContext) PushLocalFrame(names []Symbol)

func (*ParseContext) PushLoopBindings

func (ctx *ParseContext) PushLoopBindings(bindings []Symbol)

type ParseError

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

func (*ParseError) Equals

func (err *ParseError) Equals(env *Env, other interface{}) bool

func (ParseError) Error

func (err ParseError) Error() string

func (*ParseError) GetInfo

func (err *ParseError) GetInfo() *ObjectInfo

func (*ParseError) Hash

func (err *ParseError) Hash(env *Env) (uint32, error)

func (*ParseError) Message

func (err *ParseError) Message() any

func (*ParseError) ToString

func (err *ParseError) ToString(env *Env, escape bool) (string, error)

func (*ParseError) WithInfo

func (err *ParseError) WithInfo(info *ObjectInfo) any

type Pending

type Pending interface {
	IsRealized() bool
}

When a value can report if it has a pending operation.

func AssertPending

func AssertPending(env *Env, obj any, msg string) (Pending, error)

func EnsurePending

func EnsurePending(env *Env, args []any, index int) (Pending, error)

type PendingImpl

type PendingImpl struct {
	IsRealizedFn func() bool
}

func (*PendingImpl) IsRealized

func (s *PendingImpl) IsRealized() bool

type Phase

type Phase int
const (
	READ Phase = iota
	PARSE
	EVAL
	PRINT_IF_NOT_NIL
)

type Position

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

implementations

func GetPosition

func GetPosition(obj any) Position

func (Position) Filename

func (pos Position) Filename() string

func (Position) Pos

func (pos Position) Pos() Position

func (Position) String

func (p Position) String() string

type Pprinter

type Pprinter interface {
	Pprint(env *Env, writer io.Writer, indent int) (int, error)
}

interfaces

type Printer

type Printer interface {
	Print(writer io.Writer, printReadably bool)
}

interfaces

type Proc

type Proc struct {
	Fn      ProcFn
	Name    string
	Package string // "" for core (this package), else e.g. "std/string"
	File    string
	Line    int
}

func (Proc) Call

func (p Proc) Call(env *Env, args []any) (any, error)

func (Proc) Compare

func (p Proc) Compare(env *Env, a, b any) (int, error)

func (Proc) Equals

func (p Proc) Equals(env *Env, other interface{}) bool

func (Proc) GetInfo

func (p Proc) GetInfo() *ObjectInfo

func (Proc) Hash

func (p Proc) Hash(env *Env) (uint32, error)

func (Proc) ToString

func (p Proc) ToString(env *Env, escape bool) (string, error)

func (Proc) WithInfo

func (p Proc) WithInfo(*ObjectInfo) any

type ProcFn

type ProcFn func(env *Env, args []any) (any, error)

type Ratio

type Ratio struct {
	InfoHolder
	// contains filtered or unexported fields
}

A value that presents the division of two integers.

func AssertRatio

func AssertRatio(env *Env, obj any, msg string) (*Ratio, error)

func EnsureRatio

func EnsureRatio(env *Env, args []any, index int) (*Ratio, error)

func MakeRatio

func MakeRatio(x, y *big.Int) *Ratio

func (*Ratio) BigFloat

func (r *Ratio) BigFloat() *big.Float

func (*Ratio) BigInt

func (r *Ratio) BigInt() *big.Int

func (*Ratio) Compare

func (rat *Ratio) Compare(env *Env, other any) (int, error)

func (*Ratio) Double

func (r *Ratio) Double() Double

func (*Ratio) Equals

func (rat *Ratio) Equals(env *Env, other interface{}) bool

func (*Ratio) Hash

func (rat *Ratio) Hash(env *Env) (uint32, error)

func (*Ratio) Int

func (r *Ratio) Int() Int

func (*Ratio) NativeNumber

func (r *Ratio) NativeNumber() any

func (*Ratio) Ratio

func (r *Ratio) Ratio() *big.Rat

func (*Ratio) ToString

func (rat *Ratio) ToString(env *Env, escape bool) (string, error)

func (*Ratio) WithInfo

func (x *Ratio) WithInfo(info *ObjectInfo) any

type RatioOps

type RatioOps struct{}

func (RatioOps) Add

func (ops RatioOps) Add(x, y Number) (Number, error)

func (RatioOps) Combine

func (ops RatioOps) Combine(other Ops) Ops

func (RatioOps) Divide

func (ops RatioOps) Divide(x, y Number) (Number, error)

func (RatioOps) Eq

func (ops RatioOps) Eq(x Number, y Number) bool

func (RatioOps) Gt

func (ops RatioOps) Gt(x Number, y Number) bool

func (RatioOps) Gte

func (ops RatioOps) Gte(x Number, y Number) bool

func (RatioOps) IsZero

func (ops RatioOps) IsZero(x Number) bool

func (RatioOps) Lt

func (ops RatioOps) Lt(x Number, y Number) bool

func (RatioOps) Lte

func (ops RatioOps) Lte(x Number, y Number) bool

func (RatioOps) Multiply

func (ops RatioOps) Multiply(x, y Number) (Number, error)

func (RatioOps) Quotient

func (ops RatioOps) Quotient(x, y Number) (Number, error)

func (RatioOps) Rem

func (ops RatioOps) Rem(x, y Number) (Number, error)

func (RatioOps) Subtract

func (ops RatioOps) Subtract(x, y Number) (Number, error)

type ReadError

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

func MakeReadError

func MakeReadError(reader *Reader, msg string) ReadError

func MakeReadError3

func MakeReadError3(env *Env, reader *Reader, msg string, obj any) ReadError

func (ReadError) Error

func (err ReadError) Error() string

func (ReadError) Message

func (err ReadError) Message() any

type ReadFunc

type ReadFunc func(reader *Reader) any

type ReadObject

type ReadObject interface {
	HasInfo
}

type Reader

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

func NewReader

func NewReader(runeReader io.RuneReader, filename string) *Reader

func NewReaderFromFile

func NewReaderFromFile(filename string) (*Reader, error)

func (*Reader) Get

func (reader *Reader) Get() (rune, error)

func (*Reader) Peek

func (reader *Reader) Peek() rune

func (*Reader) Unget

func (reader *Reader) Unget()

type RecurBindings

type RecurBindings []any

implementations

func (RecurBindings) Equals

func (rb RecurBindings) Equals(env *Env, other interface{}) bool

func (RecurBindings) GetInfo

func (rb RecurBindings) GetInfo() *ObjectInfo

func (RecurBindings) Hash

func (rb RecurBindings) Hash(env *Env) (uint32, error)

func (RecurBindings) ToString

func (rb RecurBindings) ToString(env *Env, escape bool) (string, error)

func (RecurBindings) WithInfo

func (x RecurBindings) WithInfo(info *ObjectInfo) any

type RecurExpr

type RecurExpr struct {
	Position
	// contains filtered or unexported fields
}

func (*RecurExpr) Dump

func (expr *RecurExpr) Dump(pos bool) Map

func (*RecurExpr) Eval

func (expr *RecurExpr) Eval(genv *Env, env *LocalEnv) (any, error)

type Ref

type Ref interface {
	AlterMeta(env *Env, fn *Fn, args []any) (Map, error)
	ResetMeta(m Map) Map
}

When a value can change it's metadata.

func AssertRef

func AssertRef(env *Env, obj any, msg string) (Ref, error)

func EnsureRef

func EnsureRef(env *Env, args []any, index int) (Ref, error)

type RefImpl

type RefImpl struct {
	AlterMetaFn func(*Env, *Fn, []any) (Map, error)
	ResetMetaFn func(Map) Map
}

func (*RefImpl) AlterMeta

func (s *RefImpl) AlterMeta(a0 *Env, a1 *Fn, a2 []any) (Map, error)

func (*RefImpl) ResetMeta

func (s *RefImpl) ResetMeta(a0 Map) Map

type Regex

type Regex struct {
	InfoHolder
	R *regexp.Regexp
}

A value that contains a pre-compiled regular expression.

func AssertRegex

func AssertRegex(env *Env, obj any, msg string) (*Regex, error)

func EnsureRegex

func EnsureRegex(env *Env, args []any, index int) (*Regex, error)

func MakeRegex

func MakeRegex(r *regexp.Regexp) *Regex

func (*Regex) Equals

func (rx *Regex) Equals(env *Env, other interface{}) bool

func (*Regex) Print

func (rx *Regex) Print(w io.Writer, printReadably bool)

func (*Regex) ToString

func (rx *Regex) ToString(env *Env, escape bool) (string, error)

func (*Regex) WithInfo

func (x *Regex) WithInfo(info *ObjectInfo) any

type ReplContext

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

func NewReplContext

func NewReplContext(env *Env) *ReplContext

func (*ReplContext) PushException

func (ctx *ReplContext) PushException(exc any)

func (*ReplContext) PushValue

func (ctx *ReplContext) PushValue(obj any)

type Reversible

type Reversible interface {
	Rseq() Seq
}

When a collection can return a sequence that returns values in reverse order.

func AssertReversible

func AssertReversible(env *Env, obj any, msg string) (Reversible, error)

func EnsureReversible

func EnsureReversible(env *Env, args []any, index int) (Reversible, error)

type ReversibleImpl

type ReversibleImpl struct {
	RseqFn func() Seq
}

func (*ReversibleImpl) Rseq

func (s *ReversibleImpl) Rseq() Seq

type Rope

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

func (*Rope) AppendTo

func (s *Rope) AppendTo(str String) String

func (*Rope) Compare

func (s *Rope) Compare(env *Env, other any) (int, error)

func (*Rope) Count

func (s *Rope) Count() int

func (*Rope) Equals

func (s *Rope) Equals(env *Env, other interface{}) bool

func (*Rope) Hash

func (s *Rope) Hash(env *Env) (uint32, error)

func (*Rope) Native

func (s *Rope) Native() interface{}

func (*Rope) Nth

func (s *Rope) Nth(env *Env, i int) (any, error)

func (*Rope) S

func (s *Rope) S() string

func (*Rope) Seq

func (s *Rope) Seq() Seq

func (*Rope) ToString

func (s *Rope) ToString(env *Env, escape bool) (string, error)

func (*Rope) TryNth

func (s *Rope) TryNth(env *Env, i int, d any) (any, error)

type RuneWindow

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

type Seq

type Seq interface {
	Seqable
	any
	First(env *Env) (any, error)
	Rest(env *Env) (Seq, error)
	IsEmpty(env *Env) (bool, error)
	Cons(obj any) Seq
}

The Seq interface, provides a sequence of values.

type SeqImpl

type SeqImpl struct {
	ConsFn    func(any) Seq
	FirstFn   func(*Env) (any, error)
	IsEmptyFn func(*Env) (bool, error)
	RestFn    func(*Env) (Seq, error)
	SeqFn     func() Seq
}

func (*SeqImpl) Cons

func (s *SeqImpl) Cons(a0 any) Seq

func (*SeqImpl) First

func (s *SeqImpl) First(a0 *Env) (any, error)

func (*SeqImpl) IsEmpty

func (s *SeqImpl) IsEmpty(a0 *Env) (bool, error)

func (*SeqImpl) Rest

func (s *SeqImpl) Rest(a0 *Env) (Seq, error)

func (*SeqImpl) Seq

func (s *SeqImpl) Seq() Seq

type SeqIterator

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

func (*SeqIterator) HasNext

func (iter *SeqIterator) HasNext(env *Env) bool

func (*SeqIterator) Next

func (iter *SeqIterator) Next(env *Env) (any, error)

type Seqable

type Seqable interface {
	Seq() Seq
}

When a value can be converted into a Seq.

func AssertSeqable

func AssertSeqable(env *Env, obj any, msg string) (Seqable, error)

func EnsureSeqable

func EnsureSeqable(env *Env, args []any, index int) (Seqable, error)

func ExtractSeqable

func ExtractSeqable(env *Env, args []any, index int) (Seqable, error)

type SeqableImpl

type SeqableImpl struct {
	SeqFn func() Seq
}

func (*SeqableImpl) Seq

func (s *SeqableImpl) Seq() Seq

type Sequential

type Sequential interface {
	// contains filtered or unexported methods
}

When a value is sequential.

type SequentialImpl

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

type Set

type Set interface {
	Conjable
	Gettable
	Has(key Equ) bool
	Disjoin(env *Env, key any) (Set, error)
	SetIter() SetIter
}

A collection that can store unique values.

func AssertSet

func AssertSet(env *Env, obj any, msg string) (Set, error)

func EnsureSet

func EnsureSet(env *Env, args []any, index int) (Set, error)

type SetExpr

type SetExpr struct {
	Position
	// contains filtered or unexported fields
}

func (*SetExpr) Dump

func (expr *SetExpr) Dump(pos bool) Map

func (*SetExpr) Eval

func (expr *SetExpr) Eval(genv *Env, env *LocalEnv) (any, error)

type SetImpl

type SetImpl struct {
	ConjFn    func(*Env, any) (Conjable, error)
	DisjoinFn func(*Env, any) (Set, error)
	GetFn     func(*Env, any) (bool, any, error)
	HasFn     func(Equ) bool
	SetIterFn func() SetIter
}

func (*SetImpl) Conj

func (s *SetImpl) Conj(a0 *Env, a1 any) (Conjable, error)

func (*SetImpl) Disjoin

func (s *SetImpl) Disjoin(a0 *Env, a1 any) (Set, error)

func (*SetImpl) Get

func (s *SetImpl) Get(a0 *Env, a1 any) (bool, any, error)

func (*SetImpl) Has

func (s *SetImpl) Has(a0 Equ) bool

func (*SetImpl) SetIter

func (s *SetImpl) SetIter() SetIter

type SetIter

type SetIter interface {
	HasNext(*Env) bool
	Next(*Env) (any, error)
}

type SetMacroExpr

type SetMacroExpr struct {
	Position
	// contains filtered or unexported fields
}

func (*SetMacroExpr) Dump

func (expr *SetMacroExpr) Dump(pos bool) Map

func (*SetMacroExpr) Eval

func (expr *SetMacroExpr) Eval(genv *Env, env *LocalEnv) (any, error)

type SortableSlice

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

implementations

func (*SortableSlice) Len

func (s *SortableSlice) Len() int

func (*SortableSlice) Less

func (s *SortableSlice) Less(i, j int) bool

func (*SortableSlice) Swap

func (s *SortableSlice) Swap(i, j int)

type Stack

type Stack interface {
	Peek(env *Env) (any, error)
	Pop(env *Env) (Stack, error)
}

When a container can add and remove values efficiently without regard for position.

func AssertStack

func AssertStack(env *Env, obj any, msg string) (Stack, error)

func EnsureStack

func EnsureStack(env *Env, args []any, index int) (Stack, error)

type StackImpl

type StackImpl struct {
	PeekFn func(*Env) (any, error)
	PopFn  func(*Env) (Stack, error)
}

func (*StackImpl) Peek

func (s *StackImpl) Peek(a0 *Env) (any, error)

func (*StackImpl) Pop

func (s *StackImpl) Pop(a0 *Env) (Stack, error)

type State

type State struct {
	Namespaces    map[string]*Namespace
	CoreNamespace *Namespace
	LangNamespace *Namespace

	MainFile *Var

	NS_VAR    *Var
	IN_NS_VAR *Var

	Features Set
	// contains filtered or unexported fields
}

type Str

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

type String

type String interface {
	any
	IndexCounted
	Seqable

	S() string
	AppendTo(str String) String
}

A sequence of bytes, usually containing utf-8.

func AssertString

func AssertString(env *Env, obj any, msg string) (String, error)

func AssertStringable

func AssertStringable(obj any, msg string) (String, error)

func EnsureString

func EnsureString(env *Env, args []any, index int) (String, error)

func EnsureStringable

func EnsureStringable(args []any, index int) (String, error)

func MakeString

func MakeString(s string) String

type StringImpl

type StringImpl struct {
	AppendToFn func(String) String
	CountFn    func() int
	NthFn      func(*Env, int) (any, error)
	SFn        func() string
	SeqFn      func() Seq
	TryNthFn   func(*Env, int, any) (any, error)
}

func (*StringImpl) AppendTo

func (s *StringImpl) AppendTo(a0 String) String

func (*StringImpl) Count

func (s *StringImpl) Count() int

func (*StringImpl) Nth

func (s *StringImpl) Nth(a0 *Env, a1 int) (any, error)

func (*StringImpl) S

func (s *StringImpl) S() string

func (*StringImpl) Seq

func (s *StringImpl) Seq() Seq

func (*StringImpl) TryNth

func (s *StringImpl) TryNth(a0 *Env, a1 int, a2 any) (any, error)

type StringReader

type StringReader interface {
	ReadString(delim byte) (s string, e error)
}

func AssertStringReader

func AssertStringReader(env *Env, obj any, msg string) (StringReader, error)

func EnsureStringReader

func EnsureStringReader(env *Env, args []any, index int) (StringReader, error)

type StructMap

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

func (StructMap) Assoc

func (r StructMap) Assoc(env *Env, key any, value any) (Associative, error)

func (StructMap) Clone

func (r StructMap) Clone() StructMap

func (StructMap) Conj

func (r StructMap) Conj(env *Env, obj any) (Conjable, error)

func (StructMap) Count

func (r StructMap) Count() int

func (StructMap) EntryAt

func (r StructMap) EntryAt(env *Env, key any) (*Vector, error)

func (StructMap) Get

func (r StructMap) Get(env *Env, key any) (bool, any, error)

func (StructMap) GetEqu

func (r StructMap) GetEqu(key Equ) (bool, any)

func (StructMap) Iter

func (r StructMap) Iter() MapIterator

func (StructMap) Keys

func (r StructMap) Keys() Seq

func (StructMap) Merge

func (r StructMap) Merge(env *Env, other Map) (Map, error)

func (StructMap) Seq

func (r StructMap) Seq() Seq

func (StructMap) Set

func (r StructMap) Set(env *Env, key, value any) error

func (StructMap) Vals

func (r StructMap) Vals() Seq

func (StructMap) Without

func (r StructMap) Without(env *Env, key any) (Map, error)

type Symbol

type Symbol interface {
	Equ
	Meta
	Comparable

	Name() string
	Namespace() string
	String() string
	// contains filtered or unexported methods
}

A value that represents a value stored elsewhere by name, such as in a namespace or a local variable.

func AssembleSymbol

func AssembleSymbol(ns, name string) Symbol

func AssertSymbol

func AssertSymbol(env *Env, obj any, msg string) (Symbol, error)

func EnsureSymbol

func EnsureSymbol(env *Env, args []any, index int) (Symbol, error)

func ExtractTagFromMeta

func ExtractTagFromMeta(obj any) (Symbol, bool)

func MakeSymbol

func MakeSymbol(nsname string) Symbol

func MakeSymbolWithMeta

func MakeSymbolWithMeta(nsname string, m Map) Symbol

func MakeTaggedSymbol

func MakeTaggedSymbol(nsname string, tag Symbol) Symbol

func SymbolSetInfo

func SymbolSetInfo(sym Symbol, info *ObjectInfo) Symbol

type SymbolImpl

type SymbolImpl struct {
	CompareFn   func(*Env, any) (int, error)
	GetMetaFn   func() Map
	IsFn        func(any) bool
	IsHashFn    func() uint32
	NameFn      func() string
	NamespaceFn func() string
	StringFn    func() string
	WithMetaFn  func(*Env, Map) (any, error)
	// contains filtered or unexported fields
}

func (*SymbolImpl) Compare

func (s *SymbolImpl) Compare(a0 *Env, a1 any) (int, error)

func (*SymbolImpl) GetMeta

func (s *SymbolImpl) GetMeta() Map

func (*SymbolImpl) Is

func (s *SymbolImpl) Is(a0 any) bool

func (*SymbolImpl) IsHash

func (s *SymbolImpl) IsHash() uint32

func (*SymbolImpl) Name

func (s *SymbolImpl) Name() string

func (*SymbolImpl) Namespace

func (s *SymbolImpl) Namespace() string

func (*SymbolImpl) String

func (s *SymbolImpl) String() string

func (*SymbolImpl) WithMeta

func (s *SymbolImpl) WithMeta(a0 *Env, a1 Map) (any, error)

type Symbols

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

type TCContext

type TCContext struct {
	Context string
	Index   int
}

type ThrowExpr

type ThrowExpr struct {
	Position
	// contains filtered or unexported fields
}

func (*ThrowExpr) Dump

func (expr *ThrowExpr) Dump(pos bool) Map

func (*ThrowExpr) Eval

func (expr *ThrowExpr) Eval(genv *Env, env *LocalEnv) (any, error)

type Time

type Time struct {
	InfoHolder
	T time.Time
}

A value that represents a point in time.

func AssertTime

func AssertTime(env *Env, obj any, msg string) (Time, error)

func EnsureTime

func EnsureTime(env *Env, args []any, index int) (Time, error)

func MakeTime

func MakeTime(t time.Time) Time

func (Time) Compare

func (t Time) Compare(env *Env, other any) (int, error)

func (Time) Equals

func (t Time) Equals(env *Env, other interface{}) bool

func (Time) Hash

func (t Time) Hash(env *Env) (uint32, error)

func (Time) Native

func (t Time) Native() interface{}

func (Time) ToString

func (t Time) ToString(env *Env, escape bool) (string, error)

func (Time) WithInfo

func (x Time) WithInfo(info *ObjectInfo) any

type TinyChar

type TinyChar rune

func (TinyChar) Ch

func (x TinyChar) Ch() rune

func (TinyChar) Compare

func (c TinyChar) Compare(env *Env, other any) (int, error)

func (TinyChar) Equals

func (c TinyChar) Equals(env *Env, other interface{}) bool

func (TinyChar) Hash

func (c TinyChar) Hash(env *Env) (uint32, error)

func (TinyChar) Native

func (c TinyChar) Native() interface{}

func (TinyChar) ToString

func (c TinyChar) ToString(env *Env, escape bool) (string, error)

func (TinyChar) WithInfo

func (x TinyChar) WithInfo(info *ObjectInfo) any

type TinyKeyword

type TinyKeyword string

func (TinyKeyword) Call

func (k TinyKeyword) Call(env *Env, args []any) (any, error)

func (TinyKeyword) Compare

func (k TinyKeyword) Compare(env *Env, other any) (int, error)

func (TinyKeyword) Equals

func (k TinyKeyword) Equals(env *Env, other interface{}) bool

func (TinyKeyword) GetInfo

func (TinyKeyword) GetInfo() *ObjectInfo

func (TinyKeyword) Hash

func (k TinyKeyword) Hash(env *Env) (uint32, error)

func (TinyKeyword) Is

func (k TinyKeyword) Is(other any) bool

func (TinyKeyword) IsHash

func (k TinyKeyword) IsHash() uint32

func (TinyKeyword) Name

func (k TinyKeyword) Name() string

func (TinyKeyword) Namespace

func (k TinyKeyword) Namespace() string

func (TinyKeyword) RawString

func (k TinyKeyword) RawString() string

func (TinyKeyword) String

func (k TinyKeyword) String() string

func (TinyKeyword) ToString

func (k TinyKeyword) ToString(env *Env, escape bool) (string, error)

func (TinyKeyword) WithInfo

func (k TinyKeyword) WithInfo(info *ObjectInfo) any

type TinyNil

type TinyNil struct{}

func (TinyNil) Assoc

func (n TinyNil) Assoc(env *Env, key, value any) (Associative, error)

func (TinyNil) Conj

func (n TinyNil) Conj(env *Env, obj any) (Conjable, error)

func (TinyNil) Cons

func (n TinyNil) Cons(obj any) Seq

func (TinyNil) Count

func (n TinyNil) Count() int

func (TinyNil) Disjoin

func (n TinyNil) Disjoin(env *Env, key any) (Set, error)

func (TinyNil) EntryAt

func (n TinyNil) EntryAt(env *Env, key any) (*Vector, error)

func (TinyNil) Equals

func (n TinyNil) Equals(env *Env, other interface{}) bool

func (TinyNil) First

func (n TinyNil) First(env *Env) (any, error)

func (TinyNil) Get

func (n TinyNil) Get(env *Env, key any) (bool, any, error)

func (TinyNil) GetEqu

func (n TinyNil) GetEqu(key Equ) (bool, any)

func (TinyNil) GetInfo

func (x TinyNil) GetInfo() *ObjectInfo

func (TinyNil) Has

func (n TinyNil) Has(key Equ) bool

func (TinyNil) Hash

func (n TinyNil) Hash(env *Env) (uint32, error)

func (TinyNil) IsEmpty

func (n TinyNil) IsEmpty(env *Env) (bool, error)

func (TinyNil) Iter

func (n TinyNil) Iter() MapIterator

func (TinyNil) Keys

func (n TinyNil) Keys() Seq

func (TinyNil) Merge

func (n TinyNil) Merge(env *Env, other Map) (Map, error)

func (TinyNil) Rest

func (n TinyNil) Rest(env *Env) (Seq, error)

func (TinyNil) Seq

func (n TinyNil) Seq() Seq

func (TinyNil) SetIter

func (n TinyNil) SetIter() SetIter

func (TinyNil) String

func (x TinyNil) String() string

func (TinyNil) ToString

func (n TinyNil) ToString(env *Env, escape bool) (string, error)

func (TinyNil) Vals

func (n TinyNil) Vals() Seq

func (TinyNil) WithInfo

func (x TinyNil) WithInfo(info *ObjectInfo) any

func (TinyNil) Without

func (n TinyNil) Without(env *Env, key any) (Map, error)

type TinySymbol

type TinySymbol string

func (TinySymbol) Call

func (s TinySymbol) Call(env *Env, args []any) (any, error)

func (TinySymbol) Compare

func (s TinySymbol) Compare(env *Env, other any) (int, error)

func (TinySymbol) Equals

func (s TinySymbol) Equals(env *Env, other interface{}) bool

func (TinySymbol) GetInfo

func (sym TinySymbol) GetInfo() *ObjectInfo

func (TinySymbol) GetMeta

func (sym TinySymbol) GetMeta() Map

func (TinySymbol) Hash

func (s TinySymbol) Hash(env *Env) (uint32, error)

func (TinySymbol) Is

func (s TinySymbol) Is(other any) bool

func (TinySymbol) IsHash

func (s TinySymbol) IsHash() uint32

func (TinySymbol) Name

func (s TinySymbol) Name() string

func (TinySymbol) Namespace

func (s TinySymbol) Namespace() string

func (TinySymbol) String

func (s TinySymbol) String() string

func (TinySymbol) ToString

func (s TinySymbol) ToString(env *Env, escape bool) (string, error)

func (TinySymbol) WithInfo

func (sym TinySymbol) WithInfo(info *ObjectInfo) any

func (TinySymbol) WithMeta

func (sym TinySymbol) WithMeta(env *Env, meta Map) (any, error)

type TryExpr

type TryExpr struct {
	Position
	// contains filtered or unexported fields
}

func (*TryExpr) Dump

func (expr *TryExpr) Dump(pos bool) Map

func (*TryExpr) Eval

func (expr *TryExpr) Eval(genv *Env, env *LocalEnv) (obj any, err error)

type Type

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

A value that describes a set of values.

func AssertType

func AssertType(env *Env, obj any, msg string) (Type, error)

func EnsureType

func EnsureType(env *Env, args []any, index int) (Type, error)

func (*Type) Call

func (r *Type) Call(env *Env, args []any) (any, error)

func (Type) Name

func (tt Type) Name() string

func (Type) ReflectType

func (t Type) ReflectType() reflect.Type

func (Type) ToString

func (t Type) ToString(env *Env, escape bool) (string, error)

type Upval

type Upval struct {
	Obj any
}

type VMStacktrace

type VMStacktrace struct {
	StackTrace any
	// contains filtered or unexported fields
}

func (*VMStacktrace) Error

func (v *VMStacktrace) Error() string

func (*VMStacktrace) Is

func (v *VMStacktrace) Is(other error) bool

func (*VMStacktrace) PrintTo

func (vs *VMStacktrace) PrintTo(env *Env, w io.Writer)

func (*VMStacktrace) Unwrap

func (v *VMStacktrace) Unwrap() error

type Var

type Var struct {
	InfoHolder
	MetaHolder
	// contains filtered or unexported fields
}

A value that holds another value and can be changed. Ie, a Var is a variable.

func AssertVar

func AssertVar(env *Env, obj any, msg string) (*Var, error)

func EnsureVar

func EnsureVar(env *Env, args []any, index int) (*Var, error)

func InternFakeSymbol

func InternFakeSymbol(env *Env, ns *Namespace, sym Symbol) (*Var, error)

func (*Var) AlterMeta

func (v *Var) AlterMeta(env *Env, fn *Fn, args []any) (Map, error)

func (*Var) Call

func (v *Var) Call(env *Env, args []any) (any, error)

func (*Var) Deref

func (v *Var) Deref(env *Env) (any, error)

func (*Var) Equals

func (v *Var) Equals(env *Env, other interface{}) bool

func (*Var) GetStatic

func (v *Var) GetStatic() any

func (*Var) Hash

func (v *Var) Hash(env *Env) (uint32, error)

func (*Var) Name

func (v *Var) Name() string

func (*Var) ResetMeta

func (v *Var) ResetMeta(newMeta Map) Map

func (*Var) Resolve

func (v *Var) Resolve(env *Env) any

func (*Var) Set

func (v *Var) Set() bool

func (*Var) SetStatic

func (v *Var) SetStatic(val any)

func (*Var) SetValue

func (v *Var) SetValue(env *Env, val any) error

func (*Var) String

func (v *Var) String() string

func (*Var) ToString

func (v *Var) ToString(env *Env, escape bool) (string, error)

func (*Var) WithInfo

func (x *Var) WithInfo(info *ObjectInfo) any

func (*Var) WithMeta

func (v *Var) WithMeta(env *Env, meta Map) (any, error)

type VarData

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

func (*VarData) String

func (v *VarData) String() string

type VarRefExpr

type VarRefExpr struct {
	Position
	// contains filtered or unexported fields
}

func MakeVarRefExpr

func MakeVarRefExpr(vr *Var, obj any) *VarRefExpr

func (*VarRefExpr) Dump

func (expr *VarRefExpr) Dump(pos bool) Map

func (*VarRefExpr) Eval

func (expr *VarRefExpr) Eval(genv *Env, env *LocalEnv) (any, error)

type Vector

type Vector struct {
	InfoHolder
	MetaHolder
	// contains filtered or unexported fields
}

A collection that stores it's values at fixed integer offsets efficiently.

func AssertVector

func AssertVector(env *Env, obj any, msg string) (*Vector, error)

func EmptyVector

func EmptyVector() *Vector

func EmptyVectorWithMeta

func EmptyVectorWithMeta(m Map) *Vector

func EnsureVector

func EnsureVector(env *Env, args []any, index int) (*Vector, error)

func MakeStringVector

func MakeStringVector(ss []string) *Vector

func NewVectorFrom

func NewVectorFrom(objs ...any) *Vector

func NewVectorFromSeq

func NewVectorFromSeq(env *Env, seq Seq) (*Vector, error)

func (*Vector) Assoc

func (v *Vector) Assoc(env *Env, key, val any) (Associative, error)

func (*Vector) Call

func (v *Vector) Call(env *Env, args []any) (any, error)

func (*Vector) Compare

func (v *Vector) Compare(env *Env, other any) (int, error)

func (*Vector) Conj

func (v *Vector) Conj(env *Env, obj any) (Conjable, error)

func (*Vector) Conjoin

func (v *Vector) Conjoin(obj any) (*Vector, error)

func (*Vector) Count

func (v *Vector) Count() int

func (*Vector) Empty

func (v *Vector) Empty() Collection

func (*Vector) EntryAt

func (v *Vector) EntryAt(env *Env, key any) (*Vector, error)

func (*Vector) Equals

func (v *Vector) Equals(env *Env, other interface{}) bool

func (*Vector) Get

func (v *Vector) Get(env *Env, key any) (bool, any, error)

func (*Vector) Hash

func (v *Vector) Hash(env *Env) (uint32, error)

func (*Vector) Nth

func (v *Vector) Nth(env *Env, i int) (any, error)

func (*Vector) Peek

func (v *Vector) Peek(env *Env) (any, error)

func (*Vector) Pop

func (v *Vector) Pop(env *Env) (Stack, error)

func (*Vector) Pprint

func (v *Vector) Pprint(env *Env, w io.Writer, indent int) (int, error)

func (*Vector) Rseq

func (v *Vector) Rseq() Seq

func (*Vector) Seq

func (v *Vector) Seq() Seq

func (*Vector) ToString

func (v *Vector) ToString(env *Env, escape bool) (string, error)

func (*Vector) TryNth

func (v *Vector) TryNth(env *Env, i int, d any) (any, error)

func (*Vector) WithInfo

func (x *Vector) WithInfo(info *ObjectInfo) any

func (*Vector) WithMeta

func (v *Vector) WithMeta(env *Env, meta Map) (any, error)

type VectorExpr

type VectorExpr struct {
	Position
	// contains filtered or unexported fields
}

func (*VectorExpr) Dump

func (expr *VectorExpr) Dump(pos bool) Map

func (*VectorExpr) Eval

func (expr *VectorExpr) Eval(genv *Env, env *LocalEnv) (any, error)

type VectorRSeq

type VectorRSeq struct {
	InfoHolder
	MetaHolder
	// contains filtered or unexported fields
}

func (*VectorRSeq) Cons

func (vseq *VectorRSeq) Cons(obj any) Seq

func (*VectorRSeq) Equals

func (vseq *VectorRSeq) Equals(env *Env, other interface{}) bool

func (*VectorRSeq) First

func (vseq *VectorRSeq) First(env *Env) (any, error)

func (*VectorRSeq) Hash

func (vseq *VectorRSeq) Hash(env *Env) (uint32, error)

func (*VectorRSeq) IsEmpty

func (vseq *VectorRSeq) IsEmpty(env *Env) (bool, error)

func (*VectorRSeq) Pprint

func (seq *VectorRSeq) Pprint(env *Env, w io.Writer, indent int) (int, error)

func (*VectorRSeq) Rest

func (vseq *VectorRSeq) Rest(env *Env) (Seq, error)

func (*VectorRSeq) Seq

func (seq *VectorRSeq) Seq() Seq

func (*VectorRSeq) ToString

func (vseq *VectorRSeq) ToString(env *Env, escape bool) (string, error)

func (*VectorRSeq) WithInfo

func (x *VectorRSeq) WithInfo(info *ObjectInfo) any

func (*VectorRSeq) WithMeta

func (vseq *VectorRSeq) WithMeta(env *Env, meta Map) (any, error)

type VectorSeq

type VectorSeq struct {
	InfoHolder
	MetaHolder
	// contains filtered or unexported fields
}

func (*VectorSeq) Cons

func (vseq *VectorSeq) Cons(obj any) Seq

func (*VectorSeq) Equals

func (vseq *VectorSeq) Equals(env *Env, other interface{}) bool

func (*VectorSeq) First

func (vseq *VectorSeq) First(env *Env) (any, error)

func (*VectorSeq) Hash

func (vseq *VectorSeq) Hash(env *Env) (uint32, error)

func (*VectorSeq) IsEmpty

func (vseq *VectorSeq) IsEmpty(env *Env) (bool, error)

func (*VectorSeq) Pprint

func (seq *VectorSeq) Pprint(env *Env, w io.Writer, indent int) (int, error)

func (*VectorSeq) Rest

func (vseq *VectorSeq) Rest(env *Env) (Seq, error)

func (*VectorSeq) Seq

func (seq *VectorSeq) Seq() Seq

func (*VectorSeq) ToString

func (vseq *VectorSeq) ToString(env *Env, escape bool) (string, error)

func (*VectorSeq) WithInfo

func (x *VectorSeq) WithInfo(info *ObjectInfo) any

func (*VectorSeq) WithMeta

func (vseq *VectorSeq) WithMeta(env *Env, meta Map) (any, error)

type Warnings

type Warnings struct {
	IgnoredFileRegexes []*regexp.Regexp
	// contains filtered or unexported fields
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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