core

package
v0.10.2 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2018 License: EPL-1.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LITERAL_EXPR   = 1
	VECTOR_EXPR    = 2
	MAP_EXPR       = 3
	SET_EXPR       = 4
	IF_EXPR        = 5
	DEF_EXPR       = 6
	CALL_EXPR      = 7
	RECUR_EXPR     = 8
	META_EXPR      = 9
	DO_EXPR        = 10
	FN_ARITY_EXPR  = 11
	FN_EXPR        = 12
	LET_EXPR       = 13
	THROW_EXPR     = 14
	CATCH_EXPR     = 15
	TRY_EXPR       = 16
	VARREF_EXPR    = 17
	BINDING_EXPR   = 18
	LOOP_EXPR      = 19
	SET_MACRO_EXPR = 20
	NULL           = 100
	NOT_NULL       = 101
	SYMBOL_OBJ     = 102
	VAR_OBJ        = 103
	TYPE_OBJ       = 104
)
View Source
const EOF = -1
View Source
const MAX_INT = int(^uint(0) >> 1)
View Source
const MAX_RUNE = int(^uint32(0) >> 1)
View Source
const MIN_INT = -MAX_INT - 1
View Source
const MIN_RUNE = -MAX_RUNE - 1
View Source
const VERSION = "v0.10.2"

Variables

View Source
var (
	Stdin  io.Reader = os.Stdin
	Stdout io.Writer = os.Stdout
	Stderr io.Writer = os.Stderr
)
View Source
var (
	INT_OPS      = IntOps{}
	DOUBLE_OPS   = DoubleOps{}
	BIGINT_OPS   = BigIntOps{}
	BIGFLOAT_OPS = BigFloatOps{}
	RATIO_OPS    = RatioOps{}
)
View Source
var (
	GLOBAL_ENV                = NewEnv(MakeSymbol("user"), Stdin, Stdout, Stderr)
	LOCAL_BINDINGS  *Bindings = nil
	SPECIAL_SYMBOLS           = make(map[*string]bool)
	KNOWN_MACROS    *Var
	REQUIRE_VAR     *Var
	ALIAS_VAR       *Var
	CREATE_NS_VAR   *Var
	WARNINGS        = Warnings{
					// contains filtered or unexported fields
	}
	KEYWORDS = Keywords{
				// contains filtered or unexported fields
	}
	SYMBOLS = Symbols{
			// contains filtered or unexported fields
	}
	STR = Str{
		// contains filtered or unexported fields
	}
)
View Source
var (
	ARGS   map[int]Symbol
	GENSYM int
)
View Source
var (
	EmptyHashMap = &HashMap{}
)
View Source
var EmptyList = NewList(Nil{}, nil)
View Source
var EmptyVector = &Vector{
	count: 0,
	shift: 5,
	root:  empty_node,
	tail:  make([]interface{}, 0, 32),
}
View Source
var ExitJoker func(rc int)
View Source
var (
	HASHMAP_THRESHOLD int = 16
)
View Source
var LINTER_MODE bool = false
View Source
var NIL = Nil{}
View Source
var PROBLEM_COUNT = 0
View Source
var TYPES = map[*string]*Type{}

Functions

func AssertIOWriter

func AssertIOWriter(obj Object, msg string) io.Writer

func AssertInts

func AssertInts(args []Object) (Int, Int)

func CheckArity

func CheckArity(args []Object, min int, max int)

func CompareNumbers

func CompareNumbers(x Number, y Number) int

func EnsureIOWriter

func EnsureIOWriter(args []Object, index int) io.Writer

func EnsureRuneReader added in v0.8.8

func EnsureRuneReader(args []Object, index int) io.RuneReader

func ExtractDouble added in v0.8.9

func ExtractDouble(args []Object, index int) float64

func ExtractInt added in v0.8.0

func ExtractInt(args []Object, index int) int

func ExtractRegex added in v0.8.0

func ExtractRegex(args []Object, index int) *regexp.Regexp

func ExtractString added in v0.8.0

func ExtractString(args []Object, index int) string

func ExtractStrings added in v0.8.0

func ExtractStrings(args []Object, index int) []string

func ExtractTime added in v0.9.0

func ExtractTime(args []Object, index int) time.Time

func IsEqualOrImplements added in v0.8.1

func IsEqualOrImplements(abstractType *Type, concreteType *Type) bool

func IsInstance

func IsInstance(t *Type, obj Object) bool

func IsSeq

func IsSeq(obj Object) bool

func IsSeqEqual

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

func IsSpecialSymbol

func IsSpecialSymbol(obj Object) bool

func IsSymbol

func IsSymbol(obj Object) bool

func IsVector

func IsVector(obj Object) bool

func PackExprOrNull added in v0.10.0

func PackExprOrNull(expr Expr, p []byte, env *PackEnv) []byte

func PackObjectOrNull added in v0.10.0

func PackObjectOrNull(obj Object, p []byte, env *PackEnv) []byte

func PackReader added in v0.10.0

func PackReader(reader *Reader, filename string) ([]byte, error)

func PanicArity added in v0.8.0

func PanicArity(n int)

func PanicOnErr added in v0.8.9

func PanicOnErr(err error)

func ProcessCoreData added in v0.10.0

func ProcessCoreData()

func ProcessLinterData added in v0.6.0

func ProcessLinterData(dialect Dialect)

func ProcessLinterFile added in v0.9.1

func ProcessLinterFile(configDir string, filename string)

func ProcessLinterFiles added in v0.9.1

func ProcessLinterFiles(dialect Dialect, filename string, workingDir string)

func ProcessReader

func ProcessReader(reader *Reader, filename string, phase Phase) error

func ReadConfig added in v0.8.0

func ReadConfig(filename string, workingDir string)

func SeqCount

func SeqCount(seq Seq) int

func SeqToString

func SeqToString(seq Seq, escape bool) string

func SeqsEqual

func SeqsEqual(seq1, seq2 Seq) bool

func SetExitJoker added in v0.10.0

func SetExitJoker(fn func(rc int))

func WarnOnUnusedNamespaces added in v0.7.2

func WarnOnUnusedNamespaces()

func WarnOnUnusedVars added in v0.7.2

func WarnOnUnusedVars()

Types

type ArrayMap

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

func EmptyArrayMap

func EmptyArrayMap() *ArrayMap

func (*ArrayMap) Add

func (m *ArrayMap) Add(key Object, value Object) bool

func (*ArrayMap) Assoc

func (m *ArrayMap) Assoc(key Object, value Object) Associative

func (*ArrayMap) Call

func (m *ArrayMap) Call(args []Object) Object

func (*ArrayMap) Clone

func (m *ArrayMap) Clone() *ArrayMap

func (*ArrayMap) Conj

func (m *ArrayMap) Conj(obj Object) Conjable

func (*ArrayMap) Count

func (m *ArrayMap) Count() int

func (*ArrayMap) Empty

func (m *ArrayMap) Empty() Collection

func (*ArrayMap) EntryAt

func (m *ArrayMap) EntryAt(key Object) *Vector

func (*ArrayMap) Equals

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

func (*ArrayMap) Get

func (m *ArrayMap) Get(key Object) (bool, Object)

func (*ArrayMap) GetType

func (m *ArrayMap) GetType() *Type

func (*ArrayMap) Hash

func (m *ArrayMap) Hash() uint32

func (*ArrayMap) Iter

func (m *ArrayMap) Iter() MapIterator

func (*ArrayMap) Keys

func (m *ArrayMap) Keys() Seq

func (*ArrayMap) Merge

func (m *ArrayMap) Merge(other Map) Map

func (*ArrayMap) Pprint added in v0.8.8

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

func (*ArrayMap) Seq

func (m *ArrayMap) Seq() Seq

func (*ArrayMap) Set

func (m *ArrayMap) Set(key Object, value Object)

func (*ArrayMap) ToString

func (m *ArrayMap) ToString(escape bool) string

func (*ArrayMap) Vals

func (m *ArrayMap) Vals() Seq

func (*ArrayMap) WithInfo

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

func (*ArrayMap) WithMeta

func (v *ArrayMap) WithMeta(meta Map) Object

func (*ArrayMap) Without

func (m *ArrayMap) Without(key Object) Map

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 Object) Seq

func (*ArrayMapSeq) Equals

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

func (*ArrayMapSeq) First

func (seq *ArrayMapSeq) First() Object

func (*ArrayMapSeq) GetType

func (seq *ArrayMapSeq) GetType() *Type

func (*ArrayMapSeq) Hash

func (seq *ArrayMapSeq) Hash() uint32

func (*ArrayMapSeq) IsEmpty

func (seq *ArrayMapSeq) IsEmpty() bool

func (*ArrayMapSeq) Pprint added in v0.8.8

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

func (*ArrayMapSeq) Rest

func (seq *ArrayMapSeq) Rest() Seq

func (*ArrayMapSeq) Seq

func (seq *ArrayMapSeq) Seq() Seq

func (*ArrayMapSeq) ToString

func (seq *ArrayMapSeq) ToString(escape bool) string

func (*ArrayMapSeq) WithInfo

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

func (*ArrayMapSeq) WithMeta

func (seq *ArrayMapSeq) WithMeta(meta Map) Object

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 Object) Seq

func (*ArrayNodeSeq) Equals

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

func (*ArrayNodeSeq) First

func (s *ArrayNodeSeq) First() Object

func (*ArrayNodeSeq) GetType

func (s *ArrayNodeSeq) GetType() *Type

func (*ArrayNodeSeq) Hash

func (s *ArrayNodeSeq) Hash() uint32

func (*ArrayNodeSeq) IsEmpty

func (s *ArrayNodeSeq) IsEmpty() bool

func (*ArrayNodeSeq) Pprint added in v0.8.8

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

func (*ArrayNodeSeq) Rest

func (s *ArrayNodeSeq) Rest() Seq

func (*ArrayNodeSeq) Seq

func (s *ArrayNodeSeq) Seq() Seq

func (*ArrayNodeSeq) ToString

func (s *ArrayNodeSeq) ToString(escape bool) string

func (*ArrayNodeSeq) WithInfo

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

func (*ArrayNodeSeq) WithMeta

func (s *ArrayNodeSeq) WithMeta(meta Map) Object

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 Object) Seq

func (*ArraySeq) Equals

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

func (*ArraySeq) First

func (seq *ArraySeq) First() Object

func (*ArraySeq) GetType

func (seq *ArraySeq) GetType() *Type

func (*ArraySeq) Hash

func (seq *ArraySeq) Hash() uint32

func (*ArraySeq) IsEmpty

func (seq *ArraySeq) IsEmpty() bool

func (*ArraySeq) Pprint added in v0.8.8

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

func (*ArraySeq) Rest

func (seq *ArraySeq) Rest() Seq

func (*ArraySeq) Seq

func (seq *ArraySeq) Seq() Seq

func (*ArraySeq) ToString

func (seq *ArraySeq) ToString(escape bool) string

func (*ArraySeq) WithInfo

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

func (*ArraySeq) WithMeta

func (seq *ArraySeq) WithMeta(meta Map) Object

type Associative

type Associative interface {
	Conjable
	Gettable
	EntryAt(key Object) *Vector
	Assoc(key, val Object) Associative
}

func AssertAssociative

func AssertAssociative(obj Object, msg string) Associative

func EnsureAssociative

func EnsureAssociative(args []Object, index int) Associative

type Atom

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

func AssertAtom

func AssertAtom(obj Object, msg string) *Atom

func EnsureAtom

func EnsureAtom(args []Object, index int) *Atom

func (*Atom) AlterMeta

func (a *Atom) AlterMeta(fn *Fn, args []Object) Map

func (*Atom) Deref

func (a *Atom) Deref() Object

func (*Atom) Equals

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

func (*Atom) GetInfo

func (a *Atom) GetInfo() *ObjectInfo

func (*Atom) GetType

func (a *Atom) GetType() *Type

func (*Atom) Hash

func (a *Atom) Hash() uint32

func (*Atom) ResetMeta

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

func (*Atom) ToString

func (a *Atom) ToString(escape bool) string

func (*Atom) WithInfo

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

func (*Atom) WithMeta

func (a *Atom) WithMeta(meta Map) Object

type BigFloat

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

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(other Object) int

func (*BigFloat) Double

func (b *BigFloat) Double() Double

func (*BigFloat) Equals

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

func (*BigFloat) GetType

func (bf *BigFloat) GetType() *Type

func (*BigFloat) Hash

func (bf *BigFloat) Hash() uint32

func (*BigFloat) Int

func (b *BigFloat) Int() Int

func (*BigFloat) Ratio

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

func (*BigFloat) ToString

func (bf *BigFloat) ToString(escape bool) string

func (*BigFloat) WithInfo

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

type BigFloatOps

type BigFloatOps struct{}

func (BigFloatOps) Add

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

func (BigFloatOps) Combine

func (ops BigFloatOps) Combine(other Ops) Ops

func (BigFloatOps) Divide

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

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

func (BigFloatOps) Quotient

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

func (BigFloatOps) Rem

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

func (BigFloatOps) Subtract

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

type BigInt

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

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(other Object) int

func (*BigInt) Double

func (b *BigInt) Double() Double

func (*BigInt) Equals

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

func (*BigInt) GetType

func (bi *BigInt) GetType() *Type

func (*BigInt) Hash

func (bi *BigInt) Hash() uint32

func (*BigInt) Int

func (b *BigInt) Int() Int

func (*BigInt) Ratio

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

func (*BigInt) ToString

func (bi *BigInt) ToString(escape bool) string

func (*BigInt) WithInfo

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

type BigIntOps

type BigIntOps struct{}

func (BigIntOps) Add

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

func (BigIntOps) Combine

func (ops BigIntOps) Combine(other Ops) Ops

func (BigIntOps) Divide

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

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

func (BigIntOps) Quotient

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

func (BigIntOps) Rem

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

func (BigIntOps) Subtract

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

type Binding

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

func (*Binding) Pack added in v0.10.0

func (b *Binding) Pack(p []byte, env *PackEnv) []byte

type BindingExpr

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

func (*BindingExpr) Dump added in v0.8.2

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

func (*BindingExpr) Eval

func (expr *BindingExpr) Eval(env *LocalEnv) Object

func (*BindingExpr) InferType added in v0.8.2

func (expr *BindingExpr) InferType() *Type

func (*BindingExpr) Pack added in v0.10.0

func (expr *BindingExpr) Pack(p []byte, env *PackEnv) []byte

type Bindings

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

func (*Bindings) AddBinding added in v0.8.4

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

func (*Bindings) GetBinding added in v0.8.4

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

func (*Bindings) PopFrame added in v0.8.4

func (b *Bindings) PopFrame() *Bindings

func (*Bindings) PushFrame added in v0.8.4

func (b *Bindings) PushFrame() *Bindings

func (*Bindings) ToMap

func (b *Bindings) ToMap() Map

type BitmapIndexedNode

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

type Bool

type Bool struct {
	InfoHolder
	B bool
}

func AssertBool

func AssertBool(obj Object, msg string) Bool

func EnsureBool

func EnsureBool(args []Object, index int) Bool

func MakeBool added in v0.8.0

func MakeBool(b bool) Bool

func (Bool) Compare

func (b Bool) Compare(other Object) int

func (Bool) Equals

func (b Bool) Equals(other interface{}) bool

func (Bool) GetType

func (b Bool) GetType() *Type

func (Bool) Hash

func (b Bool) Hash() uint32

func (Bool) Native

func (b Bool) Native() interface{}

func (Bool) ToString

func (b Bool) ToString(escape bool) string

func (Bool) WithInfo

func (x Bool) WithInfo(info *ObjectInfo) Object

type Box

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

type Buffer

type Buffer struct {
	*bytes.Buffer
}

func (*Buffer) Equals

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

func (*Buffer) GetInfo

func (b *Buffer) GetInfo() *ObjectInfo

func (*Buffer) GetType

func (b *Buffer) GetType() *Type

func (*Buffer) Hash

func (b *Buffer) Hash() uint32

func (*Buffer) ToString

func (b *Buffer) ToString(escape bool) string

func (*Buffer) WithInfo

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

type BufferedReader added in v0.8.8

type BufferedReader struct {
	*bufio.Reader
}

func (*BufferedReader) Equals added in v0.8.8

func (br *BufferedReader) Equals(other interface{}) bool

func (*BufferedReader) GetInfo added in v0.8.8

func (br *BufferedReader) GetInfo() *ObjectInfo

func (*BufferedReader) GetType added in v0.8.8

func (br *BufferedReader) GetType() *Type

func (*BufferedReader) Hash added in v0.8.8

func (br *BufferedReader) Hash() uint32

func (*BufferedReader) ToString added in v0.8.8

func (br *BufferedReader) ToString(escape bool) string

func (*BufferedReader) WithInfo added in v0.8.8

func (br *BufferedReader) WithInfo(info *ObjectInfo) Object

type CallExpr

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

func (*CallExpr) Dump added in v0.8.2

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

func (*CallExpr) Eval

func (expr *CallExpr) Eval(env *LocalEnv) Object

func (*CallExpr) InferType added in v0.8.2

func (expr *CallExpr) InferType() *Type

func (*CallExpr) Name

func (expr *CallExpr) Name() string

func (*CallExpr) Pack added in v0.10.0

func (expr *CallExpr) Pack(p []byte, env *PackEnv) []byte

type Callable

type Callable interface {
	Call(args []Object) Object
}

func AssertCallable

func AssertCallable(obj Object, msg string) Callable

func EnsureCallable

func EnsureCallable(args []Object, index int) Callable

func ExtractCallable added in v0.8.0

func ExtractCallable(args []Object, index int) Callable

type Callstack

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

func (*Callstack) String

func (s *Callstack) String() string

type CatchExpr

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

func (*CatchExpr) Dump added in v0.8.2

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

func (*CatchExpr) Eval added in v0.8.2

func (expr *CatchExpr) Eval(env *LocalEnv) (obj Object)

func (*CatchExpr) InferType added in v0.8.2

func (expr *CatchExpr) InferType() *Type

func (*CatchExpr) Pack added in v0.10.0

func (expr *CatchExpr) Pack(p []byte, env *PackEnv) []byte

type Char

type Char struct {
	InfoHolder
	Ch rune
}

func AssertChar

func AssertChar(obj Object, msg string) Char

func EnsureChar

func EnsureChar(args []Object, index int) Char

func (Char) Compare

func (c Char) Compare(other Object) int

func (Char) Equals

func (c Char) Equals(other interface{}) bool

func (Char) GetType

func (c Char) GetType() *Type

func (Char) Hash

func (c Char) Hash() uint32

func (Char) Native

func (c Char) Native() interface{}

func (Char) ToString

func (c Char) ToString(escape bool) string

func (Char) WithInfo

func (x Char) WithInfo(info *ObjectInfo) Object

type Collection

type Collection interface {
	Object
	Counted
	Seqable
	Empty() Collection
}

type Comparable

type Comparable interface {
	Compare(other Object) int
}

func AssertComparable

func AssertComparable(obj Object, msg string) Comparable

func EnsureComparable

func EnsureComparable(args []Object, index int) Comparable

type Comparator

type Comparator interface {
	Compare(a, b Object) int
}

func AssertComparator

func AssertComparator(obj Object, msg string) Comparator

func EnsureComparator

func EnsureComparator(args []Object, index int) Comparator

type Conjable

type Conjable interface {
	Object
	Conj(obj Object) Conjable
}

type ConsSeq

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

func (*ConsSeq) Cons

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

func (*ConsSeq) Equals

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

func (*ConsSeq) First

func (seq *ConsSeq) First() Object

func (*ConsSeq) GetType

func (seq *ConsSeq) GetType() *Type

func (*ConsSeq) Hash

func (seq *ConsSeq) Hash() uint32

func (*ConsSeq) IsEmpty

func (seq *ConsSeq) IsEmpty() bool

func (*ConsSeq) Pprint added in v0.8.8

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

func (*ConsSeq) Rest

func (seq *ConsSeq) Rest() Seq

func (*ConsSeq) Seq

func (seq *ConsSeq) Seq() Seq

func (*ConsSeq) ToString

func (seq *ConsSeq) ToString(escape bool) string

func (*ConsSeq) WithInfo

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

func (*ConsSeq) WithMeta

func (seq *ConsSeq) WithMeta(meta Map) Object

type Counted

type Counted interface {
	Count() int
}

type DefExpr

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

func (*DefExpr) Dump added in v0.8.2

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

func (*DefExpr) Eval

func (expr *DefExpr) Eval(env *LocalEnv) Object

func (*DefExpr) InferType added in v0.8.2

func (expr *DefExpr) InferType() *Type

func (*DefExpr) Pack added in v0.10.0

func (expr *DefExpr) Pack(p []byte, env *PackEnv) []byte

type Delay

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

func (*Delay) Deref

func (d *Delay) Deref() Object

func (*Delay) Equals

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

func (*Delay) Force

func (d *Delay) Force() Object

func (*Delay) GetInfo

func (d *Delay) GetInfo() *ObjectInfo

func (*Delay) GetType

func (d *Delay) GetType() *Type

func (*Delay) Hash

func (d *Delay) Hash() uint32

func (*Delay) IsRealized

func (d *Delay) IsRealized() bool

func (*Delay) ToString

func (d *Delay) ToString(escape bool) string

func (*Delay) WithInfo

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

type Deref

type Deref interface {
	Deref() Object
}

func AssertDeref

func AssertDeref(obj Object, msg string) Deref

func EnsureDeref

func EnsureDeref(args []Object, index int) Deref

type Dialect added in v0.6.2

type Dialect int
const (
	CLJ Dialect = iota
	CLJS
	JOKER
	EDN
	UNKNOWN
)
var DIALECT Dialect

type DoExpr

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

func (*DoExpr) Dump added in v0.8.2

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

func (*DoExpr) Eval

func (doExpr *DoExpr) Eval(env *LocalEnv) Object

func (*DoExpr) InferType added in v0.8.2

func (expr *DoExpr) InferType() *Type

func (*DoExpr) Pack added in v0.10.0

func (expr *DoExpr) Pack(p []byte, env *PackEnv) []byte

type Double

type Double struct {
	InfoHolder
	D float64
}

func AssertDouble added in v0.8.9

func AssertDouble(obj Object, msg string) Double

func EnsureDouble added in v0.8.9

func EnsureDouble(args []Object, index int) Double

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(other Object) int

func (Double) Double

func (d Double) Double() Double

func (Double) Equals

func (d Double) Equals(other interface{}) bool

func (Double) GetType

func (d Double) GetType() *Type

func (Double) Hash

func (d Double) Hash() uint32

func (Double) Int

func (d Double) Int() Int

func (Double) Native

func (d Double) Native() interface{}

func (Double) Ratio

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

func (Double) ToString

func (d Double) ToString(escape bool) string

func (Double) WithInfo

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

type DoubleOps

type DoubleOps struct{}

func (DoubleOps) Add

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

func (DoubleOps) Combine

func (ops DoubleOps) Combine(other Ops) Ops

func (DoubleOps) Divide

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

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

func (DoubleOps) Quotient

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

func (DoubleOps) Rem

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

func (DoubleOps) Subtract

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

type EmptyMapIterator

type EmptyMapIterator struct {
}

func (*EmptyMapIterator) HasNext

func (iter *EmptyMapIterator) HasNext() bool

func (*EmptyMapIterator) Next

func (iter *EmptyMapIterator) Next() *Pair

type Env

type Env struct {
	Namespaces    map[*string]*Namespace
	CoreNamespace *Namespace

	Features Set
	// contains filtered or unexported fields
}

func NewEnv

func NewEnv(currentNs Symbol, stdin io.Reader, stdout io.Writer, stderr io.Writer) *Env

func (*Env) CurrentNamespace

func (env *Env) CurrentNamespace() *Namespace

func (*Env) EnsureNamespace

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

func (*Env) FindNamespace

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

func (*Env) NamespaceFor

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

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

func (*Env) SetCurrentNamespace added in v0.10.0

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

func (*Env) SetEnvArgs added in v0.10.0

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

func (*Env) SetStdIO added in v0.10.2

func (env *Env) SetStdIO(stdin io.Reader, stdout io.Writer, stderr io.Writer)

type Equality

type Equality interface {
	Equals(interface{}) bool
}

type Error

type Error interface {
	error
	Object
}

func AssertError

func AssertError(obj Object, msg string) Error

func EnsureError

func EnsureError(args []Object, index int) Error

type EvalError

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

func (*EvalError) Equals

func (err *EvalError) Equals(other interface{}) bool

func (*EvalError) Error

func (err *EvalError) Error() string

func (*EvalError) GetInfo

func (err *EvalError) GetInfo() *ObjectInfo

func (*EvalError) GetType

func (err *EvalError) GetType() *Type

func (*EvalError) Hash

func (err *EvalError) Hash() uint32

func (*EvalError) ToString

func (err *EvalError) ToString(escape bool) string

func (*EvalError) WithInfo

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

type ExInfo

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

func (*ExInfo) Equals

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

func (*ExInfo) Error

func (exInfo *ExInfo) Error() string

func (*ExInfo) GetType

func (exInfo *ExInfo) GetType() *Type

func (*ExInfo) Hash

func (exInfo *ExInfo) Hash() uint32

func (*ExInfo) ToString

func (exInfo *ExInfo) ToString(escape bool) string

func (*ExInfo) WithInfo

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

type Expr

type Expr interface {
	Eval(env *LocalEnv) Object
	InferType() *Type
	Pos() Position
	Dump(includePosition bool) Map
	Pack(p []byte, env *PackEnv) []byte
}

func Parse

func Parse(obj Object, ctx *ParseContext) Expr

func TryParse

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

func UnpackExpr added in v0.10.0

func UnpackExpr(p []byte, header *PackHeader) (Expr, []byte)

func UnpackExprOrNull added in v0.10.0

func UnpackExprOrNull(p []byte, header *PackHeader) (Expr, []byte)

type File

type File struct {
	*os.File
}

func (*File) Equals

func (f *File) Equals(other interface{}) bool

func (*File) GetInfo

func (f *File) GetInfo() *ObjectInfo

func (*File) GetType

func (f *File) GetType() *Type

func (*File) Hash

func (f *File) Hash() uint32

func (*File) ToString

func (f *File) ToString(escape bool) string

func (*File) WithInfo

func (f *File) WithInfo(info *ObjectInfo) Object

type Fn

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

func AssertFn

func AssertFn(obj Object, msg string) *Fn

func EnsureFn

func EnsureFn(args []Object, index int) *Fn

func (*Fn) Call

func (fn *Fn) Call(args []Object) Object

func (*Fn) Compare

func (fn *Fn) Compare(a, b Object) int

func (*Fn) Equals

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

func (*Fn) GetType

func (fn *Fn) GetType() *Type

func (*Fn) Hash

func (fn *Fn) Hash() uint32

func (*Fn) ToString

func (fn *Fn) ToString(escape bool) string

func (*Fn) WithInfo

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

func (*Fn) WithMeta

func (fn *Fn) WithMeta(meta Map) Object

type FnArityExpr

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

func (*FnArityExpr) Dump added in v0.8.2

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

func (*FnArityExpr) Eval added in v0.8.2

func (expr *FnArityExpr) Eval(env *LocalEnv) Object

func (*FnArityExpr) InferType added in v0.8.2

func (expr *FnArityExpr) InferType() *Type

func (*FnArityExpr) Pack added in v0.10.0

func (expr *FnArityExpr) Pack(p []byte, env *PackEnv) []byte

type FnExpr

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

func (*FnExpr) Dump added in v0.8.2

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

func (*FnExpr) Eval

func (expr *FnExpr) Eval(env *LocalEnv) Object

func (*FnExpr) InferType added in v0.8.2

func (expr *FnExpr) InferType() *Type

func (*FnExpr) Pack added in v0.10.0

func (expr *FnExpr) Pack(p []byte, env *PackEnv) []byte

type Frame

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

type Gettable

type Gettable interface {
	Get(key Object) (bool, Object)
}

type HashCollisionNode

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

type HashMap

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

func NewHashMap

func NewHashMap(keyvals ...Object) *HashMap

func (*HashMap) Assoc

func (m *HashMap) Assoc(key, val Object) Associative

func (*HashMap) Call

func (m *HashMap) Call(args []Object) Object

func (*HashMap) Conj

func (m *HashMap) Conj(obj Object) Conjable

func (*HashMap) Count

func (m *HashMap) Count() int

func (*HashMap) Empty

func (m *HashMap) Empty() Collection

func (*HashMap) EntryAt

func (m *HashMap) EntryAt(key Object) *Vector

func (*HashMap) Equals

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

func (*HashMap) Get

func (m *HashMap) Get(key Object) (bool, Object)

func (*HashMap) GetType

func (m *HashMap) GetType() *Type

func (*HashMap) Hash

func (m *HashMap) Hash() uint32

func (*HashMap) Iter

func (m *HashMap) Iter() MapIterator

func (*HashMap) Keys

func (m *HashMap) Keys() Seq

func (*HashMap) Merge

func (m *HashMap) Merge(other Map) Map

func (*HashMap) Pprint added in v0.8.8

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

func (*HashMap) Seq

func (m *HashMap) Seq() Seq

func (*HashMap) ToString

func (m *HashMap) ToString(escape bool) string

func (*HashMap) Vals

func (m *HashMap) Vals() Seq

func (*HashMap) WithInfo

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

func (*HashMap) WithMeta

func (m *HashMap) WithMeta(meta Map) Object

func (*HashMap) Without

func (m *HashMap) Without(key Object) Map

type IOWriter added in v0.10.2

type IOWriter struct {
	io.Writer
}

func (*IOWriter) Equals added in v0.10.2

func (iow *IOWriter) Equals(other interface{}) bool

func (*IOWriter) GetInfo added in v0.10.2

func (iow *IOWriter) GetInfo() *ObjectInfo

func (*IOWriter) GetType added in v0.10.2

func (iow *IOWriter) GetType() *Type

func (*IOWriter) Hash added in v0.10.2

func (iow *IOWriter) Hash() uint32

func (*IOWriter) ToString added in v0.10.2

func (iow *IOWriter) ToString(escape bool) string

func (*IOWriter) WithInfo added in v0.10.2

func (iow *IOWriter) WithInfo(info *ObjectInfo) Object

type IfExpr

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

func (*IfExpr) Dump added in v0.8.2

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

func (*IfExpr) Eval

func (expr *IfExpr) Eval(env *LocalEnv) Object

func (*IfExpr) InferType added in v0.8.2

func (expr *IfExpr) InferType() *Type

func (*IfExpr) Pack added in v0.10.0

func (expr *IfExpr) Pack(p []byte, env *PackEnv) []byte

type Indexed

type Indexed interface {
	Nth(i int) Object
	TryNth(i int, d Object) Object
}

type InfoHolder

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

func (InfoHolder) GetInfo

func (i InfoHolder) GetInfo() *ObjectInfo

type Int

type Int struct {
	InfoHolder
	I int
}

func AssertInt

func AssertInt(obj Object, msg string) Int

func EnsureInt

func EnsureInt(args []Object, index int) Int

func MakeInt added in v0.8.0

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(other Object) int

func (Int) Double

func (i Int) Double() Double

func (Int) Equals

func (i Int) Equals(other interface{}) bool

func (Int) GetType

func (i Int) GetType() *Type

func (Int) Hash

func (i Int) Hash() uint32

func (Int) Int

func (i Int) Int() Int

func (Int) Native

func (i Int) Native() interface{}

func (Int) Ratio

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

func (Int) ToString

func (i Int) ToString(escape bool) string

func (Int) WithInfo

func (x Int) WithInfo(info *ObjectInfo) Object

type IntOps

type IntOps struct{}

func (IntOps) Add

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

func (IntOps) Combine

func (ops IntOps) Combine(other Ops) Ops

func (IntOps) Divide

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

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

func (IntOps) Quotient

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

func (IntOps) Rem

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

func (IntOps) Subtract

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

type KVReduce

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

func AssertKVReduce

func AssertKVReduce(obj Object, msg string) KVReduce

func EnsureKVReduce

func EnsureKVReduce(args []Object, index int) KVReduce

type Keyword

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

func AssertKeyword

func AssertKeyword(obj Object, msg string) Keyword

func EnsureKeyword

func EnsureKeyword(args []Object, index int) Keyword

func MakeKeyword

func MakeKeyword(nsname string) Keyword

func (Keyword) Call

func (k Keyword) Call(args []Object) Object

func (Keyword) Compare

func (k Keyword) Compare(other Object) int

func (Keyword) Equals

func (k Keyword) Equals(other interface{}) bool

func (Keyword) GetType

func (k Keyword) GetType() *Type

func (Keyword) Hash

func (k Keyword) Hash() uint32

func (Keyword) Name

func (k Keyword) Name() string

func (Keyword) Namespace

func (k Keyword) Namespace() string

func (Keyword) ToString

func (k Keyword) ToString(escape bool) string

func (Keyword) WithInfo

func (x Keyword) WithInfo(info *ObjectInfo) Object

type Keywords added in v0.8.1

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

type LazySeq

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

func (*LazySeq) Cons

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

func (*LazySeq) Equals

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

func (*LazySeq) First

func (seq *LazySeq) First() Object

func (*LazySeq) GetType

func (seq *LazySeq) GetType() *Type

func (*LazySeq) Hash

func (seq *LazySeq) Hash() uint32

func (*LazySeq) IsEmpty

func (seq *LazySeq) IsEmpty() bool

func (*LazySeq) IsRealized

func (seq *LazySeq) IsRealized() bool

func (*LazySeq) Pprint added in v0.8.8

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

func (*LazySeq) Rest

func (seq *LazySeq) Rest() Seq

func (*LazySeq) Seq

func (seq *LazySeq) Seq() Seq

func (*LazySeq) ToString

func (seq *LazySeq) ToString(escape bool) string

func (*LazySeq) WithInfo

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

func (*LazySeq) WithMeta

func (seq *LazySeq) WithMeta(meta Map) Object

type LetExpr

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

func (*LetExpr) Dump added in v0.8.2

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

func (*LetExpr) Eval

func (expr *LetExpr) Eval(env *LocalEnv) Object

func (*LetExpr) InferType added in v0.8.2

func (expr *LetExpr) InferType() *Type

func (*LetExpr) Pack added in v0.10.0

func (expr *LetExpr) Pack(p []byte, env *PackEnv) []byte

type LineRuneReader

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

func NewLineRuneReader

func NewLineRuneReader(rl *readline.Instance) *LineRuneReader

func (*LineRuneReader) ReadRune

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

type List

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

func NewList

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

func NewListFrom

func NewListFrom(objs ...Object) *List

func (*List) Conj

func (list *List) Conj(obj Object) Conjable

func (*List) Cons

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

func (*List) Count

func (list *List) Count() int

func (*List) Empty

func (list *List) Empty() Collection

func (*List) Equals

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

func (*List) First

func (list *List) First() Object

func (*List) Forth

func (list *List) Forth() Object

func (*List) GetType

func (list *List) GetType() *Type

func (*List) Hash

func (list *List) Hash() uint32

func (*List) IsEmpty

func (list *List) IsEmpty() bool

func (*List) Peek

func (list *List) Peek() Object

func (*List) Pop

func (list *List) Pop() Stack

func (*List) Pprint added in v0.8.8

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

func (*List) Rest

func (list *List) Rest() Seq

func (*List) Second

func (list *List) Second() Object

func (*List) Seq

func (list *List) Seq() Seq

func (*List) Third

func (list *List) Third() Object

func (*List) ToString

func (list *List) ToString(escape bool) string

func (*List) WithInfo

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

func (*List) WithMeta

func (list *List) WithMeta(meta Map) Object

type LiteralExpr

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

func NewLiteralExpr

func NewLiteralExpr(obj Object) *LiteralExpr

func NewSurrogateExpr added in v0.8.4

func NewSurrogateExpr(obj Object) *LiteralExpr

func (*LiteralExpr) Dump added in v0.8.2

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

func (*LiteralExpr) Eval

func (expr *LiteralExpr) Eval(env *LocalEnv) Object

func (*LiteralExpr) InferType added in v0.8.2

func (expr *LiteralExpr) InferType() *Type

func (*LiteralExpr) Pack added in v0.10.0

func (expr *LiteralExpr) Pack(p []byte, env *PackEnv) []byte

type LocalEnv

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

type LoopExpr

type LoopExpr LetExpr

func (*LoopExpr) Dump added in v0.8.2

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

func (*LoopExpr) Eval

func (expr *LoopExpr) Eval(env *LocalEnv) Object

func (*LoopExpr) InferType added in v0.8.2

func (expr *LoopExpr) InferType() *Type

func (*LoopExpr) Pack added in v0.10.0

func (expr *LoopExpr) Pack(p []byte, env *PackEnv) []byte

type MacroCallExpr

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

func (*MacroCallExpr) Dump added in v0.8.2

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

func (*MacroCallExpr) Eval

func (expr *MacroCallExpr) Eval(env *LocalEnv) Object

func (*MacroCallExpr) InferType added in v0.8.2

func (expr *MacroCallExpr) InferType() *Type

func (*MacroCallExpr) Name

func (expr *MacroCallExpr) Name() string

type Map

type Map interface {
	Associative
	Seqable
	Counted
	Without(key Object) Map
	Keys() Seq
	Vals() Seq
	Merge(m Map) Map
	Iter() MapIterator
}

func AlterMeta

func AlterMeta(m *MetaHolder, fn *Fn, args []Object) Map

func AssertMap

func AssertMap(obj Object, msg string) Map

func EnsureMap

func EnsureMap(args []Object, index int) Map

func ExtractMap added in v0.8.9

func ExtractMap(args []Object, index int) Map

func MakeMeta added in v0.6.0

func MakeMeta(arglists Seq, docstring string, added string) Map

func SafeMerge

func SafeMerge(m1, m2 Map) Map

type MapExpr

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

func (*MapExpr) Dump added in v0.8.2

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

func (*MapExpr) Eval

func (expr *MapExpr) Eval(env *LocalEnv) Object

func (*MapExpr) InferType added in v0.8.2

func (expr *MapExpr) InferType() *Type

func (*MapExpr) Pack added in v0.10.0

func (expr *MapExpr) Pack(p []byte, env *PackEnv) []byte

type MapIterator

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

type MapSet

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

func EmptySet

func EmptySet() *MapSet

func NewSetFromSeq added in v0.8.1

func NewSetFromSeq(s Seq) *MapSet

func (*MapSet) Add

func (set *MapSet) Add(obj Object) bool

func (*MapSet) Call

func (set *MapSet) Call(args []Object) Object

func (*MapSet) Conj

func (set *MapSet) Conj(obj Object) Conjable

func (*MapSet) Count

func (set *MapSet) Count() int

func (*MapSet) Disjoin

func (set *MapSet) Disjoin(key Object) Set

func (*MapSet) Empty

func (set *MapSet) Empty() Collection

func (*MapSet) Equals

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

func (*MapSet) Get

func (set *MapSet) Get(key Object) (bool, Object)

func (*MapSet) GetType

func (seq *MapSet) GetType() *Type

func (*MapSet) Hash

func (set *MapSet) Hash() uint32

func (*MapSet) Pprint added in v0.8.8

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

func (*MapSet) Seq

func (set *MapSet) Seq() Seq

func (*MapSet) ToString

func (set *MapSet) ToString(escape bool) string

func (*MapSet) WithInfo

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

func (*MapSet) WithMeta

func (v *MapSet) WithMeta(meta Map) Object

type MappingSeq

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

func (*MappingSeq) Cons

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

func (*MappingSeq) Equals

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

func (*MappingSeq) First

func (seq *MappingSeq) First() Object

func (*MappingSeq) GetType

func (seq *MappingSeq) GetType() *Type

func (*MappingSeq) Hash

func (seq *MappingSeq) Hash() uint32

func (*MappingSeq) IsEmpty

func (seq *MappingSeq) IsEmpty() bool

func (*MappingSeq) Pprint added in v0.8.8

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

func (*MappingSeq) Rest

func (seq *MappingSeq) Rest() Seq

func (*MappingSeq) Seq

func (seq *MappingSeq) Seq() Seq

func (*MappingSeq) ToString

func (seq *MappingSeq) ToString(escape bool) string

func (*MappingSeq) WithInfo

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

func (*MappingSeq) WithMeta

func (seq *MappingSeq) WithMeta(meta Map) Object

type Meta

type Meta interface {
	GetMeta() Map
	WithMeta(Map) Object
}

func AssertMeta

func AssertMeta(obj Object, msg string) Meta

func EnsureMeta

func EnsureMeta(args []Object, index int) Meta

type MetaExpr

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

func (*MetaExpr) Dump added in v0.8.2

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

func (*MetaExpr) Eval

func (expr *MetaExpr) Eval(env *LocalEnv) Object

func (*MetaExpr) InferType added in v0.8.2

func (expr *MetaExpr) InferType() *Type

func (*MetaExpr) Pack added in v0.10.0

func (expr *MetaExpr) Pack(p []byte, env *PackEnv) []byte

type MetaHolder

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

func (MetaHolder) GetMeta

func (m MetaHolder) GetMeta() Map

type Named

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

func AssertNamed

func AssertNamed(obj Object, msg string) Named

func EnsureNamed

func EnsureNamed(args []Object, index int) Named

type Namespace

type Namespace struct {
	MetaHolder
	Name Symbol
	// contains filtered or unexported fields
}

func AssertNamespace

func AssertNamespace(obj Object, msg string) *Namespace

func EnsureNamespace

func EnsureNamespace(args []Object, index int) *Namespace

func NewNamespace

func NewNamespace(sym Symbol) *Namespace

func (*Namespace) AddAlias

func (ns *Namespace) AddAlias(alias Symbol, namespace *Namespace)

func (*Namespace) AlterMeta

func (ns *Namespace) AlterMeta(fn *Fn, args []Object) Map

func (*Namespace) Equals

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

func (*Namespace) GetInfo

func (ns *Namespace) GetInfo() *ObjectInfo

func (*Namespace) GetType

func (ns *Namespace) GetType() *Type

func (*Namespace) Hash

func (ns *Namespace) Hash() uint32

func (*Namespace) Intern

func (ns *Namespace) Intern(sym Symbol) *Var

func (*Namespace) InternVar added in v0.6.0

func (ns *Namespace) InternVar(name string, val Object, meta Map) *Var

func (*Namespace) Print added in v0.10.1

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

func (*Namespace) Refer

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

func (*Namespace) ReferAll

func (ns *Namespace) ReferAll(other *Namespace)

func (*Namespace) ResetMeta

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

func (*Namespace) Resolve added in v0.7.0

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

func (*Namespace) ToString

func (ns *Namespace) ToString(escape bool) string

func (*Namespace) WithInfo

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

func (*Namespace) WithMeta

func (ns *Namespace) WithMeta(meta Map) Object

type Native

type Native interface {
	Native() interface{}
}

type Nil

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

func (Nil) Assoc

func (n Nil) Assoc(key, value Object) Associative

func (Nil) Conj

func (n Nil) Conj(obj Object) Conjable

func (Nil) Cons

func (n Nil) Cons(obj Object) Seq

func (Nil) Count

func (n Nil) Count() int

func (Nil) Disjoin

func (n Nil) Disjoin(key Object) Set

func (Nil) EntryAt

func (n Nil) EntryAt(key Object) *Vector

func (Nil) Equals

func (n Nil) Equals(other interface{}) bool

func (Nil) First

func (n Nil) First() Object

func (Nil) Get

func (n Nil) Get(key Object) (bool, Object)

func (Nil) GetType

func (n Nil) GetType() *Type

func (Nil) Hash

func (n Nil) Hash() uint32

func (Nil) IsEmpty

func (n Nil) IsEmpty() bool

func (Nil) Iter

func (n Nil) Iter() MapIterator

func (Nil) Keys

func (n Nil) Keys() Seq

func (Nil) Merge

func (n Nil) Merge(other Map) Map

func (Nil) Rest

func (n Nil) Rest() Seq

func (Nil) Seq

func (n Nil) Seq() Seq

func (Nil) ToString

func (n Nil) ToString(escape bool) string

func (Nil) Vals

func (n Nil) Vals() Seq

func (Nil) WithInfo

func (x Nil) WithInfo(info *ObjectInfo) Object

func (Nil) Without

func (n Nil) Without(key Object) Map

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 Object) Seq

func (*NodeSeq) Equals

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

func (*NodeSeq) First

func (s *NodeSeq) First() Object

func (*NodeSeq) GetType

func (s *NodeSeq) GetType() *Type

func (*NodeSeq) Hash

func (s *NodeSeq) Hash() uint32

func (*NodeSeq) IsEmpty

func (s *NodeSeq) IsEmpty() bool

func (*NodeSeq) Pprint added in v0.8.8

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

func (*NodeSeq) Rest

func (s *NodeSeq) Rest() Seq

func (*NodeSeq) Seq

func (s *NodeSeq) Seq() Seq

func (*NodeSeq) ToString

func (s *NodeSeq) ToString(escape bool) string

func (*NodeSeq) WithInfo

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

func (*NodeSeq) WithMeta

func (s *NodeSeq) WithMeta(meta Map) Object

type Number

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

func AssertNumber

func AssertNumber(obj Object, msg string) Number

func EnsureNumber

func EnsureNumber(args []Object, index int) Number

func ExtractNumber added in v0.8.9

func ExtractNumber(args []Object, index int) Number

func Max

func Max(x Number, y Number) Number

func Min

func Min(x Number, y Number) Number

type Object

type Object interface {
	Equality
	ToString(escape bool) string
	GetInfo() *ObjectInfo
	WithInfo(*ObjectInfo) Object
	GetType() *Type
	Hash() uint32
}

func DeriveReadObject

func DeriveReadObject(base Object, obj Object) Object

func Eval

func Eval(expr Expr, env *LocalEnv) Object

func ExtractObject added in v0.8.0

func ExtractObject(args []Object, index int) Object

func Fourth added in v0.10.0

func Fourth(seq Seq) Object

func MakeReadObject

func MakeReadObject(reader *Reader, obj Object) Object

func Read

func Read(reader *Reader) (Object, bool)

func Second

func Second(seq Seq) Object

func SeqNth

func SeqNth(seq Seq, n int) Object

func SeqTryNth

func SeqTryNth(seq Seq, n int, d Object) Object

func Third

func Third(seq Seq) Object

func ToSlice

func ToSlice(seq Seq) []Object

func TryEval

func TryEval(expr Expr) (obj Object, err error)

func TryRead

func TryRead(reader *Reader) (obj Object, err error)

func UnpackObjectOrNull added in v0.10.0

func UnpackObjectOrNull(p []byte, header *PackHeader) (Object, []byte)

type ObjectInfo

type ObjectInfo struct {
	Position
}

func (*ObjectInfo) Pack added in v0.10.0

func (info *ObjectInfo) Pack(p []byte, env *PackEnv) []byte

type Ops

type Ops interface {
	Combine(ops Ops) Ops
	Add(Number, Number) Number
	Subtract(Number, Number) Number
	Multiply(Number, Number) Number
	Divide(Number, Number) Number
	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
	Rem(Number, Number) Number
}

func GetOps

func GetOps(obj Object) Ops

type PackEnv added in v0.10.0

type PackEnv struct {
	Strings  map[*string]uint16
	Bindings map[*Binding]int
	// contains filtered or unexported fields
}

func NewPackEnv added in v0.10.0

func NewPackEnv() *PackEnv

func (*PackEnv) Pack added in v0.10.0

func (env *PackEnv) Pack(p []byte) []byte

type PackHeader added in v0.10.0

type PackHeader struct {
	GlobalEnv *Env
	Strings   []*string
	Bindings  []Binding
}

func UnpackHeader added in v0.10.0

func UnpackHeader(p []byte, env *Env) (*PackHeader, []byte)

type Pair

type Pair struct {
	Key   Object
	Value Object
}

type ParseContext

type ParseContext struct {
	GlobalEnv *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(other interface{}) bool

func (ParseError) Error

func (err ParseError) Error() string

func (*ParseError) GetInfo

func (err *ParseError) GetInfo() *ObjectInfo

func (*ParseError) GetType

func (err *ParseError) GetType() *Type

func (*ParseError) Hash

func (err *ParseError) Hash() uint32

func (*ParseError) ToString

func (err *ParseError) ToString(escape bool) string

func (*ParseError) WithInfo

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

type Pending

type Pending interface {
	IsRealized() bool
}

func AssertPending

func AssertPending(obj Object, msg string) Pending

func EnsurePending

func EnsurePending(args []Object, index int) Pending

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
}

func GetPosition

func GetPosition(obj Object) Position

func (Position) Filename

func (pos Position) Filename() string

func (Position) Pack added in v0.10.0

func (pos Position) Pack(p []byte, env *PackEnv) []byte

func (Position) Pos

func (pos Position) Pos() Position

type Pprinter added in v0.8.8

type Pprinter interface {
	Pprint(writer io.Writer, indent int) int
}

type Printer

type Printer interface {
	Print(writer io.Writer, printReadably bool)
}

type Proc

type Proc func([]Object) Object

func (Proc) Call

func (p Proc) Call(args []Object) Object

func (Proc) Compare

func (p Proc) Compare(a, b Object) int

func (Proc) Equals

func (p Proc) Equals(other interface{}) bool

func (Proc) GetInfo

func (p Proc) GetInfo() *ObjectInfo

func (Proc) GetType

func (p Proc) GetType() *Type

func (Proc) Hash

func (p Proc) Hash() uint32

func (Proc) ToString

func (p Proc) ToString(escape bool) string

func (Proc) WithInfo

func (p Proc) WithInfo(*ObjectInfo) Object

type Ratio

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

func AssertRatio

func AssertRatio(obj Object, msg string) *Ratio

func EnsureRatio

func EnsureRatio(args []Object, index 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(other Object) int

func (*Ratio) Double

func (r *Ratio) Double() Double

func (*Ratio) Equals

func (rat *Ratio) Equals(other interface{}) bool

func (*Ratio) GetType

func (rat *Ratio) GetType() *Type

func (*Ratio) Hash

func (rat *Ratio) Hash() uint32

func (*Ratio) Int

func (r *Ratio) Int() Int

func (*Ratio) Ratio

func (r *Ratio) Ratio() *big.Rat

func (*Ratio) ToString

func (rat *Ratio) ToString(escape bool) string

func (*Ratio) WithInfo

func (x *Ratio) WithInfo(info *ObjectInfo) Object

type RatioOps

type RatioOps struct{}

func (RatioOps) Add

func (ops RatioOps) Add(x, y Number) Number

func (RatioOps) Combine

func (ops RatioOps) Combine(other Ops) Ops

func (RatioOps) Divide

func (ops RatioOps) Divide(x, y Number) Number

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

func (RatioOps) Quotient

func (ops RatioOps) Quotient(x, y Number) Number

func (RatioOps) Rem

func (ops RatioOps) Rem(x, y Number) Number

func (RatioOps) Subtract

func (ops RatioOps) Subtract(x, y Number) Number

type ReadError

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

func MakeReadError

func MakeReadError(reader *Reader, msg string) ReadError

func (ReadError) Error

func (err ReadError) Error() string

type ReadFunc

type ReadFunc func(reader *Reader) Object

type Reader

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

func NewReader

func NewReader(runeReader io.RuneReader, filename string) *Reader

func NewReaderFromFile added in v0.9.1

func NewReaderFromFile(filename string) (*Reader, error)

func (*Reader) Get

func (reader *Reader) Get() rune

func (*Reader) Peek

func (reader *Reader) Peek() rune

func (*Reader) Unget

func (reader *Reader) Unget()

type RecurBindings

type RecurBindings []Object

func (RecurBindings) Equals

func (rb RecurBindings) Equals(other interface{}) bool

func (RecurBindings) GetInfo

func (rb RecurBindings) GetInfo() *ObjectInfo

func (RecurBindings) GetType

func (rb RecurBindings) GetType() *Type

func (RecurBindings) Hash

func (rb RecurBindings) Hash() uint32

func (RecurBindings) ToString

func (rb RecurBindings) ToString(escape bool) string

func (RecurBindings) WithInfo

func (x RecurBindings) WithInfo(info *ObjectInfo) Object

type RecurExpr

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

func (*RecurExpr) Dump added in v0.8.2

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

func (*RecurExpr) Eval

func (expr *RecurExpr) Eval(env *LocalEnv) Object

func (*RecurExpr) InferType added in v0.8.2

func (expr *RecurExpr) InferType() *Type

func (*RecurExpr) Pack added in v0.10.0

func (expr *RecurExpr) Pack(p []byte, env *PackEnv) []byte

type Ref

type Ref interface {
	AlterMeta(fn *Fn, args []Object) Map
	ResetMeta(m Map) Map
}

func AssertRef

func AssertRef(obj Object, msg string) Ref

func EnsureRef

func EnsureRef(args []Object, index int) Ref

type Regex

type Regex struct {
	InfoHolder
	R *regexp.Regexp
}

func AssertRegex

func AssertRegex(obj Object, msg string) Regex

func EnsureRegex

func EnsureRegex(args []Object, index int) Regex

func (Regex) Equals

func (rx Regex) Equals(other interface{}) bool

func (Regex) GetType

func (rx Regex) GetType() *Type

func (Regex) Hash

func (rx Regex) Hash() uint32

func (Regex) Print

func (rx Regex) Print(w io.Writer, printReadably bool)

func (Regex) ToString

func (rx Regex) ToString(escape bool) string

func (Regex) WithInfo

func (x Regex) WithInfo(info *ObjectInfo) Object

type Reversible

type Reversible interface {
	Rseq() Seq
}

func AssertReversible

func AssertReversible(obj Object, msg string) Reversible

func EnsureReversible

func EnsureReversible(args []Object, index int) Reversible

type RuneWindow

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

type Runtime

type Runtime struct {
	// contains filtered or unexported fields
}
var RT *Runtime = &Runtime{
	callstack: &Callstack{frames: make([]Frame, 0, 50)},
}

func (*Runtime) NewArgTypeError added in v0.8.0

func (rt *Runtime) NewArgTypeError(index int, obj Object, expectedType string) *EvalError

func (*Runtime) NewError

func (rt *Runtime) NewError(msg string) *EvalError

func (*Runtime) NewErrorWithPos added in v0.8.3

func (rt *Runtime) NewErrorWithPos(msg string, pos Position) *EvalError

type Seq

type Seq interface {
	Seqable
	Object
	First() Object
	Rest() Seq
	IsEmpty() bool
	Cons(obj Object) Seq
}

type SeqIterator

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

func (*SeqIterator) HasNext

func (iter *SeqIterator) HasNext() bool

func (*SeqIterator) Next

func (iter *SeqIterator) Next() Object

type Seqable

type Seqable interface {
	Seq() Seq
}

func AssertSeqable

func AssertSeqable(obj Object, msg string) Seqable

func EnsureSeqable

func EnsureSeqable(args []Object, index int) Seqable

func ExtractSeqable added in v0.8.0

func ExtractSeqable(args []Object, index int) Seqable

type Sequential

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

type Set

type Set interface {
	Conjable
	Gettable
	Disjoin(key Object) Set
}

func AssertSet

func AssertSet(obj Object, msg string) Set

func EnsureSet

func EnsureSet(args []Object, index int) Set

type SetExpr

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

func (*SetExpr) Dump added in v0.8.2

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

func (*SetExpr) Eval

func (expr *SetExpr) Eval(env *LocalEnv) Object

func (*SetExpr) InferType added in v0.8.2

func (expr *SetExpr) InferType() *Type

func (*SetExpr) Pack added in v0.10.0

func (expr *SetExpr) Pack(p []byte, env *PackEnv) []byte

type SetMacroExpr added in v0.10.0

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

func (*SetMacroExpr) Dump added in v0.10.0

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

func (*SetMacroExpr) Eval added in v0.10.0

func (expr *SetMacroExpr) Eval(env *LocalEnv) Object

func (*SetMacroExpr) InferType added in v0.10.0

func (expr *SetMacroExpr) InferType() *Type

func (*SetMacroExpr) Pack added in v0.10.0

func (expr *SetMacroExpr) Pack(p []byte, env *PackEnv) []byte

type SortableSlice

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

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() Object
	Pop() Stack
}

func AssertStack

func AssertStack(obj Object, msg string) Stack

func EnsureStack

func EnsureStack(args []Object, index int) Stack

type Str added in v0.8.1

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

type String

type String struct {
	InfoHolder
	S string
}

func AssertString

func AssertString(obj Object, msg string) String

func EnsureString

func EnsureString(args []Object, index int) String

func MakeString

func MakeString(s string) String

func (String) Compare

func (s String) Compare(other Object) int

func (String) Count

func (s String) Count() int

func (String) Equals

func (s String) Equals(other interface{}) bool

func (String) GetType

func (s String) GetType() *Type

func (String) Hash

func (s String) Hash() uint32

func (String) Native

func (s String) Native() interface{}

func (String) Nth

func (s String) Nth(i int) Object

func (String) Seq

func (s String) Seq() Seq

func (String) ToString

func (s String) ToString(escape bool) string

func (String) TryNth

func (s String) TryNth(i int, d Object) Object

func (String) WithInfo

func (x String) WithInfo(info *ObjectInfo) Object

type StringPool

type StringPool map[string]*string
var STRINGS StringPool = StringPool{}

func (StringPool) Intern

func (p StringPool) Intern(s string) *string

type StringReader added in v0.10.2

type StringReader interface {
	ReadString(delim byte) (s string, e error)
}

func AssertStringReader added in v0.10.2

func AssertStringReader(obj Object, msg string) StringReader

type Symbol

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

func AssertSymbol

func AssertSymbol(obj Object, msg string) Symbol

func EnsureSymbol

func EnsureSymbol(args []Object, index int) Symbol

func MakeSymbol

func MakeSymbol(nsname string) Symbol

func (Symbol) Compare

func (s Symbol) Compare(other Object) int

func (Symbol) Equals

func (s Symbol) Equals(other interface{}) bool

func (Symbol) GetType

func (s Symbol) GetType() *Type

func (Symbol) Hash

func (s Symbol) Hash() uint32

func (Symbol) Name

func (s Symbol) Name() string

func (Symbol) Namespace

func (s Symbol) Namespace() string

func (Symbol) Pack added in v0.10.0

func (s Symbol) Pack(p []byte, env *PackEnv) []byte

func (Symbol) ToString

func (s Symbol) ToString(escape bool) string

func (Symbol) WithInfo

func (x Symbol) WithInfo(info *ObjectInfo) Object

func (Symbol) WithMeta

func (sym Symbol) WithMeta(meta Map) Object

type Symbols added in v0.8.1

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

type ThrowExpr

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

func (*ThrowExpr) Dump added in v0.8.2

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

func (*ThrowExpr) Eval

func (expr *ThrowExpr) Eval(env *LocalEnv) Object

func (*ThrowExpr) InferType added in v0.8.2

func (expr *ThrowExpr) InferType() *Type

func (*ThrowExpr) Pack added in v0.10.0

func (expr *ThrowExpr) Pack(p []byte, env *PackEnv) []byte

type Time added in v0.9.0

type Time struct {
	InfoHolder
	T time.Time
}

func AssertTime added in v0.9.0

func AssertTime(obj Object, msg string) Time

func EnsureTime added in v0.9.0

func EnsureTime(args []Object, index int) Time

func MakeTime added in v0.9.0

func MakeTime(t time.Time) Time

func (Time) Compare added in v0.9.0

func (t Time) Compare(other Object) int

func (Time) Equals added in v0.9.0

func (t Time) Equals(other interface{}) bool

func (Time) GetType added in v0.9.0

func (t Time) GetType() *Type

func (Time) Hash added in v0.9.0

func (t Time) Hash() uint32

func (Time) Native added in v0.9.0

func (t Time) Native() interface{}

func (Time) ToString added in v0.9.0

func (t Time) ToString(escape bool) string

func (Time) WithInfo added in v0.9.0

func (x Time) WithInfo(info *ObjectInfo) Object

type Traceable

type Traceable interface {
	Name() string
	Pos() Position
}

type TryExpr

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

func (*TryExpr) Dump added in v0.8.2

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

func (*TryExpr) Eval

func (expr *TryExpr) Eval(env *LocalEnv) (obj Object)

func (*TryExpr) InferType added in v0.8.2

func (expr *TryExpr) InferType() *Type

func (*TryExpr) Pack added in v0.10.0

func (expr *TryExpr) Pack(p []byte, env *PackEnv) []byte

type Type

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

func AssertType

func AssertType(obj Object, msg string) *Type

func EnsureType

func EnsureType(args []Object, index int) *Type

func (*Type) Equals

func (t *Type) Equals(other interface{}) bool

func (*Type) GetInfo

func (t *Type) GetInfo() *ObjectInfo

func (*Type) GetType

func (t *Type) GetType() *Type

func (*Type) Hash

func (t *Type) Hash() uint32

func (*Type) Pack added in v0.10.0

func (t *Type) Pack(p []byte, env *PackEnv) []byte

func (*Type) ToString

func (t *Type) ToString(escape bool) string

func (*Type) WithInfo

func (x *Type) WithInfo(info *ObjectInfo) Object

type Types added in v0.8.1

type Types struct {
	Associative    *Type
	Callable       *Type
	Collection     *Type
	Comparable     *Type
	Comparator     *Type
	Counted        *Type
	Deref          *Type
	Error          *Type
	Gettable       *Type
	Indexed        *Type
	IOReader       *Type
	IOWriter       *Type
	KVReduce       *Type
	Map            *Type
	Meta           *Type
	Named          *Type
	Number         *Type
	Pending        *Type
	Ref            *Type
	Reversible     *Type
	Seq            *Type
	Seqable        *Type
	Sequential     *Type
	Set            *Type
	Stack          *Type
	ArrayMap       *Type
	ArrayMapSeq    *Type
	ArrayNodeSeq   *Type
	ArraySeq       *Type
	MapSet         *Type
	Atom           *Type
	BigFloat       *Type
	BigInt         *Type
	Bool           *Type
	Time           *Type
	Buffer         *Type
	Char           *Type
	ConsSeq        *Type
	Delay          *Type
	Double         *Type
	EvalError      *Type
	ExInfo         *Type
	Fn             *Type
	File           *Type
	BufferedReader *Type
	HashMap        *Type
	Int            *Type
	Keyword        *Type
	LazySeq        *Type
	List           *Type
	MappingSeq     *Type
	Namespace      *Type
	Nil            *Type
	NodeSeq        *Type
	ParseError     *Type
	Proc           *Type
	Ratio          *Type
	RecurBindings  *Type
	Regex          *Type
	String         *Type
	Symbol         *Type
	Type           *Type
	Var            *Type
	Vector         *Type
	VectorRSeq     *Type
	VectorSeq      *Type
}
var TYPE Types

type Var

type Var struct {
	InfoHolder
	MetaHolder

	Value Object
	// contains filtered or unexported fields
}
var LINTER_CONFIG *Var

func AssertVar

func AssertVar(obj Object, msg string) *Var

func EnsureVar

func EnsureVar(args []Object, index int) *Var

func InternFakeSymbol added in v0.7.0

func InternFakeSymbol(ns *Namespace, sym Symbol) *Var

func (*Var) AlterMeta

func (v *Var) AlterMeta(fn *Fn, args []Object) Map

func (*Var) Call

func (v *Var) Call(args []Object) Object

func (*Var) Deref

func (v *Var) Deref() Object

func (*Var) Equals

func (v *Var) Equals(other interface{}) bool

func (*Var) GetType

func (v *Var) GetType() *Type

func (*Var) Hash

func (v *Var) Hash() uint32

func (*Var) Pack added in v0.10.0

func (vr *Var) Pack(p []byte, env *PackEnv) []byte

func (*Var) ResetMeta

func (v *Var) ResetMeta(newMeta Map) Map

func (*Var) Resolve added in v0.6.0

func (v *Var) Resolve() Object

func (*Var) ToString

func (v *Var) ToString(escape bool) string

func (*Var) WithInfo

func (x *Var) WithInfo(info *ObjectInfo) Object

func (*Var) WithMeta

func (v *Var) WithMeta(meta Map) Object

type VarRefExpr

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

func (*VarRefExpr) Dump added in v0.8.2

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

func (*VarRefExpr) Eval

func (expr *VarRefExpr) Eval(env *LocalEnv) Object

func (*VarRefExpr) InferType added in v0.8.2

func (expr *VarRefExpr) InferType() *Type

func (*VarRefExpr) Pack added in v0.10.0

func (expr *VarRefExpr) Pack(p []byte, env *PackEnv) []byte

type Vector

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

func AssertVector

func AssertVector(obj Object, msg string) *Vector

func EnsureVector

func EnsureVector(args []Object, index int) *Vector

func NewVectorFrom

func NewVectorFrom(objs ...Object) *Vector

func NewVectorFromSeq

func NewVectorFromSeq(seq Seq) *Vector

func (*Vector) Assoc

func (v *Vector) Assoc(key, val Object) Associative

func (*Vector) Call

func (v *Vector) Call(args []Object) Object

func (*Vector) Compare

func (v *Vector) Compare(other Object) int

func (*Vector) Conj

func (v *Vector) Conj(obj Object) Conjable

func (*Vector) Conjoin

func (v *Vector) Conjoin(obj Object) *Vector

func (*Vector) Count

func (v *Vector) Count() int

func (*Vector) Empty

func (v *Vector) Empty() Collection

func (*Vector) EntryAt

func (v *Vector) EntryAt(key Object) *Vector

func (*Vector) Equals

func (v *Vector) Equals(other interface{}) bool

func (*Vector) Get

func (v *Vector) Get(key Object) (bool, Object)

func (*Vector) GetType

func (v *Vector) GetType() *Type

func (*Vector) Hash

func (v *Vector) Hash() uint32

func (*Vector) Nth

func (v *Vector) Nth(i int) Object

func (*Vector) Peek

func (v *Vector) Peek() Object

func (*Vector) Pop

func (v *Vector) Pop() Stack

func (*Vector) Pprint added in v0.8.8

func (v *Vector) Pprint(w io.Writer, indent int) int

func (*Vector) Rseq

func (v *Vector) Rseq() Seq

func (*Vector) Seq

func (v *Vector) Seq() Seq

func (*Vector) ToString

func (v *Vector) ToString(escape bool) string

func (*Vector) TryNth

func (v *Vector) TryNth(i int, d Object) Object

func (*Vector) WithInfo

func (x *Vector) WithInfo(info *ObjectInfo) Object

func (*Vector) WithMeta

func (v *Vector) WithMeta(meta Map) Object

type VectorExpr

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

func (*VectorExpr) Dump added in v0.8.2

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

func (*VectorExpr) Eval

func (expr *VectorExpr) Eval(env *LocalEnv) Object

func (*VectorExpr) InferType added in v0.8.2

func (expr *VectorExpr) InferType() *Type

func (*VectorExpr) Pack added in v0.10.0

func (expr *VectorExpr) Pack(p []byte, env *PackEnv) []byte

type VectorRSeq

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

func (*VectorRSeq) Cons

func (vseq *VectorRSeq) Cons(obj Object) Seq

func (*VectorRSeq) Equals

func (vseq *VectorRSeq) Equals(other interface{}) bool

func (*VectorRSeq) First

func (vseq *VectorRSeq) First() Object

func (*VectorRSeq) GetType

func (vseq *VectorRSeq) GetType() *Type

func (*VectorRSeq) Hash

func (vseq *VectorRSeq) Hash() uint32

func (*VectorRSeq) IsEmpty

func (vseq *VectorRSeq) IsEmpty() bool

func (*VectorRSeq) Pprint added in v0.8.8

func (seq *VectorRSeq) Pprint(w io.Writer, indent int) int

func (*VectorRSeq) Rest

func (vseq *VectorRSeq) Rest() Seq

func (*VectorRSeq) Seq

func (seq *VectorRSeq) Seq() Seq

func (*VectorRSeq) ToString

func (vseq *VectorRSeq) ToString(escape bool) string

func (*VectorRSeq) WithInfo

func (x *VectorRSeq) WithInfo(info *ObjectInfo) Object

func (*VectorRSeq) WithMeta

func (vseq *VectorRSeq) WithMeta(meta Map) Object

type VectorSeq

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

func (*VectorSeq) Cons

func (vseq *VectorSeq) Cons(obj Object) Seq

func (*VectorSeq) Equals

func (vseq *VectorSeq) Equals(other interface{}) bool

func (*VectorSeq) First

func (vseq *VectorSeq) First() Object

func (*VectorSeq) GetType

func (vseq *VectorSeq) GetType() *Type

func (*VectorSeq) Hash

func (vseq *VectorSeq) Hash() uint32

func (*VectorSeq) IsEmpty

func (vseq *VectorSeq) IsEmpty() bool

func (*VectorSeq) Pprint added in v0.8.8

func (seq *VectorSeq) Pprint(w io.Writer, indent int) int

func (*VectorSeq) Rest

func (vseq *VectorSeq) Rest() Seq

func (*VectorSeq) Seq

func (seq *VectorSeq) Seq() Seq

func (*VectorSeq) ToString

func (vseq *VectorSeq) ToString(escape bool) string

func (*VectorSeq) WithInfo

func (x *VectorSeq) WithInfo(info *ObjectInfo) Object

func (*VectorSeq) WithMeta

func (vseq *VectorSeq) WithMeta(meta Map) Object

type Warnings added in v0.8.1

type Warnings struct {
	// 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