lang

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2024 License: EPL-1.0 Imports: 29 Imported by: 2

Documentation

Index

Constants

View Source
const (
	CategoryInteger = iota
	CategoryFloating
	CategoryDecimal
	CategoryRatio
)

Variables

View Source
var (
	BuiltinTypes = map[string]reflect.Type{
		"any":        reflect.TypeOf((*interface{})(nil)).Elem(),
		"bool":       reflect.TypeOf(false),
		"uint8":      reflect.TypeOf(uint8(0)),
		"uint16":     reflect.TypeOf(uint16(0)),
		"uint32":     reflect.TypeOf(uint32(0)),
		"uint64":     reflect.TypeOf(uint64(0)),
		"int8":       reflect.TypeOf(int8(0)),
		"int16":      reflect.TypeOf(int16(0)),
		"int32":      reflect.TypeOf(int32(0)),
		"int64":      reflect.TypeOf(int64(0)),
		"float32":    reflect.TypeOf(float32(0)),
		"float64":    reflect.TypeOf(float64(0)),
		"complex64":  reflect.TypeOf(complex64(0)),
		"complex128": reflect.TypeOf(complex128(0)),
		"string":     reflect.TypeOf(""),
		"int":        reflect.TypeOf(int(0)),
		"uint":       reflect.TypeOf(uint(0)),
		"uintptr":    reflect.TypeOf(uintptr(0)),
		"byte":       reflect.TypeOf(byte(0)),
		"rune":       reflect.TypeOf(rune(0)),
		"error":      reflect.TypeOf((*error)(nil)).Elem(),
	}

	Builtins = map[string]interface{}{

		"append":  GoAppend,
		"copy":    GoCopy,
		"delete":  GoDelete,
		"len":     GoLen,
		"cap":     GoCap,
		"make":    GoMake,
		"new":     GoNew,
		"complex": GoComplex,
		"real":    GoReal,
		"imag":    GoImag,
		"close":   GoClose,
		"panic":   GoPanic,

		"slice-of":  reflect.SliceOf,
		"ptr-to":    reflect.PtrTo,
		"chan-of":   GoChanOf,
		"<-chan-of": GoRecvChanOf,
		"chan<--of": GoSendChanOf,
		"map-of":    reflect.MapOf,
		"func-of":   reflect.FuncOf,
		"array-of":  reflect.ArrayOf,

		"deref": GoDeref,

		"index":         GoIndex,
		"slice":         GoSlice,
		"map-index":     GoMapIndex,
		"set-map-index": GoSetMapIndex,
		"send":          GoSend,
		"recv":          GoRecv,
	}
)
View Source
var (
	KWTag       = NewKeyword("tag")
	KWFile      = NewKeyword("file")
	KWLine      = NewKeyword("line")
	KWColumn    = NewKeyword("column")
	KWEndLine   = NewKeyword("end-line")
	KWEndColumn = NewKeyword("end-column")

	KWCtxExpr      = NewKeyword("ctx/expr")
	KWCtxReturn    = NewKeyword("ctx/return")
	KWCtxStatement = NewKeyword("ctx/statement")
	KWTopLevel     = NewKeyword("top-level")
	KWEnv          = NewKeyword("env")
	KWContext      = NewKeyword("context")

	KWIsBody        = NewKeyword("body?")
	KWLoopId        = NewKeyword("loop-id")
	KWBinding       = NewKeyword("binding")
	KWLoopLocals    = NewKeyword("loop-locals")
	KWInTry         = NewKeyword("in-try")
	KWCatch         = NewKeyword("catch")
	KWDoc           = NewKeyword("doc")
	KWOnce          = NewKeyword("once")
	KWHashEquiv     = NewKeyword("hash-equiv")
	KWBool          = NewKeyword("bool")
	KWKeyword       = NewKeyword("keyword")
	KWSymbol        = NewKeyword("symbol")
	KWString        = NewKeyword("string")
	KWSeq           = NewKeyword("seq")
	KWChar          = NewKeyword("char")
	KWRegex         = NewKeyword("regex")
	KWNumber        = NewKeyword("number")
	KWUnknown       = NewKeyword("unknown")
	KWCaseNode      = NewKeyword("case-node")
	KWArgId         = NewKeyword("arg-id")
	KWArg           = NewKeyword("arg")
	KWFnMethod      = NewKeyword("fn-method")
	KWNamespaces    = NewKeyword("namespaces")
	KWAliases       = NewKeyword("aliases")
	KWMappings      = NewKeyword("mappings")
	KWNil           = NewKeyword("nil")
	KWHostField     = NewKeyword("host-field")
	KWLetfn         = NewKeyword("letfn")
	KWCompact       = NewKeyword("compact")
	KWSparse        = NewKeyword("sparse")
	KWInt           = NewKeyword("int")
	KWHashIdentity  = NewKeyword("hash-identity")
	KWArglists      = NewKeyword("arglists")
	KWCatches       = NewKeyword("catches")
	KWLocals        = NewKeyword("locals")
	KWMutable       = NewKeyword("mutable")
	KWType          = NewKeyword("type")
	KWIsLiteral     = NewKeyword("literal?")
	KWIsAssignable  = NewKeyword("assignable?")
	KWMethods       = NewKeyword("methods")
	KWIsVariadic    = NewKeyword("variadic?")
	KWMaxFixedArity = NewKeyword("max-fixed-arity")
	KWLocal         = NewKeyword("local")
	KWName          = NewKeyword("name")
	KWFixedArity    = NewKeyword("fixed-arity")
	KWBody          = NewKeyword("body")
	KWParams        = NewKeyword("params")
	KWOp            = NewKeyword("op")
	KWForm          = NewKeyword("form")
	KWConst         = NewKeyword("const")
	KWDef           = NewKeyword("def")
	KWSetBang       = NewKeyword("set!")
	KWMaybeClass    = NewKeyword("maybe-class")
	KWWithMeta      = NewKeyword("with-meta")
	KWArgs          = NewKeyword("args")
	KWBindings      = NewKeyword("bindings")
	KWCase          = NewKeyword("case")
	KWClass         = NewKeyword("class")
	KWDefault       = NewKeyword("default")
	KWDo            = NewKeyword("do")
	KWElse          = NewKeyword("else")
	KWException     = NewKeyword("exception")
	KWExpr          = NewKeyword("expr")
	KWExprs         = NewKeyword("exprs")
	KWField         = NewKeyword("field")
	KWFinally       = NewKeyword("finally")
	KWFn            = NewKeyword("fn")
	KWHostCall      = NewKeyword("host-call")
	KWHostInterop   = NewKeyword("host-interop")
	KWIf            = NewKeyword("if")
	KWInit          = NewKeyword("init")
	KWInvoke        = NewKeyword("invoke")
	KWItems         = NewKeyword("items")
	KWKeys          = NewKeyword("keys")
	KWLet           = NewKeyword("let")
	KWLoop          = NewKeyword("loop")
	KWMOrF          = NewKeyword("m-or-f")
	KWMap           = NewKeyword("map")
	KWMaybeHostForm = NewKeyword("maybe-host-form")
	KWMeta          = NewKeyword("meta")
	KWMethod        = NewKeyword("method")
	KWNew           = NewKeyword("new")
	KWNodes         = NewKeyword("nodes")
	KWQuote         = NewKeyword("quote")
	KWRecur         = NewKeyword("recur")
	KWRet           = NewKeyword("ret")
	KWSet           = NewKeyword("set")
	KWStatements    = NewKeyword("statements")
	KWTarget        = NewKeyword("target")
	KWTest          = NewKeyword("test")
	KWTests         = NewKeyword("tests")
	KWTheVar        = NewKeyword("the-var")
	KWThen          = NewKeyword("then")
	KWThrow         = NewKeyword("throw")
	KWTry           = NewKeyword("try")
	KWVal           = NewKeyword("val")
	KWVals          = NewKeyword("vals")
	KWVar           = NewKeyword("var")
	KWVector        = NewKeyword("vector")
	KWRawForms      = NewKeyword("raw-forms")
	KWChildren      = NewKeyword("children")

	KWMacro   = NewKeyword("macro")
	KWPrivate = NewKeyword("private")
	KWDynamic = NewKeyword("dynamic")
	KWNS      = NewKeyword("ns")
)
View Source
var (
	LockingTransaction = &LockingTransactor{}

	ErrNoTransaction = errors.New("no transaction running")
)
View Source
var (
	Throwable = reflect.TypeOf((interface{})(nil))

	// TODO: convert use of 'matcher' in core.glj to fit go's
	// regexps. This supresses errors but doesn't actually work.
	Matcher = reflect.TypeOf(&regexp.Regexp{})

	// TODO: rework use of PrintWriter in core.glj
	PrintWriter = reflect.TypeOf(&bytes.Buffer{})
)
View Source
var (
	NSCore = FindOrCreateNamespace(SymbolCoreNamespace)

	VarNS   = InternVar(NSCore, NewSymbol("ns"), false, true)
	VarInNS = InternVar(NSCore, NewSymbol("in-ns"), false, true)

	VarCurrentNS        = InternVarReplaceRoot(NSCore, NewSymbol("*ns*"), NSCore).SetDynamic()
	VarWarnOnReflection = InternVarReplaceRoot(NSCore, NewSymbol("*warn-on-reflection*"), false).SetDynamic()
	VarUncheckedMath    = InternVarReplaceRoot(NSCore, NewSymbol("*unchecked-math*"), false).SetDynamic()
	VarAgent            = InternVarReplaceRoot(NSCore, NewSymbol("*agent*"), nil).SetDynamic()
	VarPrintReadably    = InternVarReplaceRoot(NSCore, NewSymbol("*print-readably*"), true).SetDynamic()
	VarOut              = InternVarReplaceRoot(NSCore, NewSymbol("*out*"), os.Stdout).SetDynamic()
	VarIn               = InternVarReplaceRoot(NSCore, NewSymbol("*in*"), os.Stdin).SetDynamic()
	VarAssert           = InternVarReplaceRoot(NSCore, NewSymbol("*assert*"), false).SetDynamic()
	VarCompileFiles     = InternVarReplaceRoot(NSCore, NewSymbol("*compile-files*"), false).SetDynamic()
	VarFile             = InternVarReplaceRoot(NSCore, NewSymbol("*file*"), "NO_SOURCE_FILE").SetDynamic()
	VarDataReaders      = InternVarReplaceRoot(NSCore, NewSymbol("*data-readers*"), emptyMap).SetDynamic()

	// TODO: use variant of InternVar that doesn't replace root.
	VarPrintInitialized = InternVarName(NSCore.Name(), NewSymbol("print-initialized"))
	VarPrOn             = InternVarName(NSCore.Name(), NewSymbol("pr-on"))
	VarParents          = InternVarName(NSCore.Name(), NewSymbol("parents"))
)
View Source
var (
	Numbers = &NumberMethods{} // eventually make these static; this will prevent inlining
)
View Source
var (
	SymbolCoreNamespace = NewSymbol("glojure.core")
)

Functions

func Abs

func Abs(x any) any

func Add

func Add(x, y any) any

func AddP

func AddP(x, y any) any

func AppendWriter

func AppendWriter(w io.Writer, v interface{}) io.Writer

AppendWriter is a shim for clojure.core's use of Java's append() method, which is not available on go's io.Writer interface.

func Apply

func Apply(fn interface{}, args []interface{}) interface{}

func AsByte

func AsByte(x any) byte

func AsFloat64

func AsFloat64(x any) float64

func AsInt

func AsInt(v any) (int, bool)

AsInt returns any integral value as an int. If the value cannot be represented as an int, it returns false. Floats are not converted.

func AsInt64

func AsInt64(x any) int64

func AsNumber

func AsNumber(v any) (any, bool)

AsNumber returns any value as a number. If the value is not a number, it returns false.

func BooleanCast

func BooleanCast(x any) bool

func ByteCast

func ByteCast(x any) byte

func CharLiteralFromRune

func CharLiteralFromRune(rn rune) string

CharLiteralFromRune returns a character literal from a rune.

func CloneThreadBindingFrame

func CloneThreadBindingFrame() interface{}

func ConcatStrings

func ConcatStrings(strs ...string) string

func Count

func Count(coll any) int

func CreatePersistentHashMap

func CreatePersistentHashMap(keyvals any) any

func CreatePersistentTreeMap

func CreatePersistentTreeMap(keyvals interface{}) interface{}

func CreatePersistentTreeSet

func CreatePersistentTreeSet(keys ISeq) interface{}

func CreatePersistentTreeSetWithComparator

func CreatePersistentTreeSetWithComparator(comparator IFn, keys ISeq) interface{}

func Dissoc

func Dissoc(x any, k any) any

func Divide

func Divide(x, y any) any

func Equals

func Equals(a, b any) bool

func Equiv

func Equiv(a, b any) bool

func FieldOrMethod

func FieldOrMethod(v interface{}, name string) (interface{}, bool)

FieldOrMethod returns the field or method of the given name on the given value or pointer to a value, and a boolean indicating whether the field or method was found. If the given value is a pointer, it is dereferenced. If the value or pointer target is not a struct, or if no such field or method exists, nil and false are returned. The first letter of the name will be capitalized if it is not already. This is because Go exports fields and methods that start with a capital letter.

func First

func First(x interface{}) interface{}

func FloatCast

func FloatCast(x any) float32

func GT

func GT(x, y any) bool

func Get

func Get(coll, key any) any

func GetDefault

func GetDefault(coll, key, def any) any

func GoAppend

func GoAppend(slc interface{}, vals ...interface{}) interface{}

func GoCap

func GoCap(v interface{}) int

func GoChanOf

func GoChanOf(typ reflect.Type) reflect.Type

func GoClose

func GoClose(c interface{})

func GoComplex

func GoComplex(real, imag interface{}) interface{}

func GoCopy

func GoCopy(dst, src interface{}) int

func GoDelete

func GoDelete(m, key interface{})

func GoDeref

func GoDeref(ptr interface{}) interface{}

func GoImag

func GoImag(c interface{}) interface{}

func GoIndex

func GoIndex(slc, i interface{}) interface{}

func GoLen

func GoLen(v interface{}) int

func GoMake

func GoMake(typ reflect.Type, args ...interface{}) interface{}

func GoMapIndex

func GoMapIndex(m, k interface{}) interface{}

func GoNew

func GoNew(typ reflect.Type) interface{}

func GoPanic

func GoPanic(v interface{})

func GoReal

func GoReal(c interface{}) interface{}

func GoRecv

func GoRecv(ch interface{}) (interface{}, bool)

func GoRecvChanOf

func GoRecvChanOf(typ reflect.Type) reflect.Type

func GoSend

func GoSend(ch, val interface{})

func GoSendChanOf

func GoSendChanOf(typ reflect.Type) reflect.Type

func GoSetMapIndex

func GoSetMapIndex(m, k, v interface{})

func GoSlice

func GoSlice(slc interface{}, indices ...interface{}) interface{}

func HasType

func HasType(t reflect.Type, v interface{}) bool

func Hash

func Hash(x interface{}) uint32

func HashEq

func HashEq(x any) uint32

func Identical

func Identical(a, b any) bool

func IdentityHash

func IdentityHash(x interface{}) uint32

func Import

func Import(args ...interface{})

func Inc

func Inc(v any) any

Inc increments a number value by one. If the value is not a number, it returns an error.

func IncP

func IncP(v any) any

IncP increments a number value by one. If incrementing would overflow, it promotes the value to a wider type, or BigInt. If the value is not a number, it returns an error.

func IntCast

func IntCast(x any) int

func IsInteger

func IsInteger(v any) bool

func IsNaN

func IsNaN(x any) bool

func IsNil

func IsNil(v interface{}) bool

func IsNumber

func IsNumber(x any) bool

func IsReduced

func IsReduced(v interface{}) bool

func IsSeq

func IsSeq(x interface{}) bool

func IsTruthy

func IsTruthy(v interface{}) bool

IsTruthy returns true if the value is truthy.

func IsZero

func IsZero(x any) bool

func LT

func LT(x, y any) bool

func LongCast

func LongCast(x any) int64

func Max

func Max(x, y any) any

func Min

func Min(x, y any) any

func Multiply

func Multiply(x, y any) any

func MustAsInt

func MustAsInt(v any) int

func MustAsNumber

func MustAsNumber(v any) any

func MustNth

func MustNth(x interface{}, i int) interface{}

MustNth returns the nth element of the vector. It panics if the index is out of range.

func NewArithmeticError

func NewArithmeticError(msg string) error

func NewIllegalArgumentError

func NewIllegalArgumentError(msg string) error

func NewIllegalStateError

func NewIllegalStateError(msg string) error

func NewIndexOutOfBoundsError

func NewIndexOutOfBoundsError() error

func NewTimeoutError

func NewTimeoutError(msg string) error

NewTimeoutError creates a new timeout error.

func Nth

func Nth(x interface{}, n int) (interface{}, bool)

func NumbersEqual

func NumbersEqual(x, y any) bool

func Ops

func Ops(x any) ops

func Peek

func Peek(stk IPersistentStack) interface{}

func PopThreadBindings

func PopThreadBindings()

func Print

func Print(x interface{}, w io.Writer)

Print prints a value to the given io.Writer. Corresponds to Clojure's RT.print.

func PrintString

func PrintString(v interface{}) string

RTPrintString corresponds to Clojure's RT.printString.

func PushThreadBindings

func PushThreadBindings(bindings IPersistentMap)

func Reduce

func Reduce(f func(interface{}, interface{}) interface{}, seq ISeq) interface{}

Reduce applies the given function to each element of the ISeq.

func ReduceInit

func ReduceInit(f func(interface{}, interface{}) interface{}, init interface{}, seq ISeq) interface{}

func ReduceKV

func ReduceKV(f func(init, k, v interface{}) interface{}, init, coll interface{}) interface{}

func RemoveNamespace

func RemoveNamespace(sym *Symbol)

func ResetThreadBindingFrame

func ResetThreadBindingFrame(frame interface{})

func Rest

func Rest(x interface{}) interface{}

func RuneFromCharLiteral

func RuneFromCharLiteral(lit string) (rune, error)

RuneFromCharLiteral returns the rune value from a character literal.

func SetField

func SetField(target interface{}, name string, val interface{}) error

func ShortCast

func ShortCast(x any) int16

func ShutdownAgents

func ShutdownAgents()

func SliceSet

func SliceSet(slc any, idx int, val any)

func Sub

func Sub(x, y any) any

func SubP

func SubP(x, y any) any

func ToSlice

func ToSlice(x any) []any

func ToString

func ToString(v interface{}) string

ToString converts a value to a string a la Java's .toString method.

func TypeOf

func TypeOf(v interface{}) reflect.Type

func UncheckedByteCast

func UncheckedByteCast(x any) byte

func UncheckedFloatCast

func UncheckedFloatCast(x any) float32

func UncheckedIntCast

func UncheckedIntCast(x any) int

func UncheckedLongCast

func UncheckedLongCast(x any) int64

func UncheckedShortCast

func UncheckedShortCast(x any) int16

func WithMeta

func WithMeta(v any, meta IPersistentMap) (any, error)

WithMeta returns a new value with the given metadata.

func WriteWriter

func WriteWriter(w io.Writer, v interface{}) io.Writer

Types

type AFn

type AFn interface {
	IFn
}

type AMapEntry

type AMapEntry interface {
	APersistentVector

	IMapEntry
}

type APersistentMap

type APersistentMap interface {
	AFn
	IPersistentMap
	IHashEq
}

type APersistentSet

type APersistentSet interface {
	AFn
	IPersistentSet
	IHashEq
}

type APersistentVector

type APersistentVector interface {
	AFn
	IPersistentVector
	IHashEq
	Reversible
}

type Agent

type Agent struct{}

type ArithmeticError

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

func (*ArithmeticError) Error

func (e *ArithmeticError) Error() string

func (*ArithmeticError) Is

func (e *ArithmeticError) Is(other error) bool

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 {
	// contains filtered or unexported fields
}

func (*ArrayNodeSeq) Cons

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

func (*ArrayNodeSeq) Count

func (s *ArrayNodeSeq) Count() int

func (*ArrayNodeSeq) Empty

func (*ArrayNodeSeq) Equals

func (s *ArrayNodeSeq) Equals(obj any) bool

func (*ArrayNodeSeq) Equiv

func (s *ArrayNodeSeq) Equiv(obj any) bool

func (*ArrayNodeSeq) First

func (s *ArrayNodeSeq) First() any

func (*ArrayNodeSeq) Hash

func (s *ArrayNodeSeq) Hash() uint32

func (*ArrayNodeSeq) HashEq

func (s *ArrayNodeSeq) HashEq() uint32

func (*ArrayNodeSeq) Meta

func (s *ArrayNodeSeq) Meta() IPersistentMap

func (*ArrayNodeSeq) More

func (s *ArrayNodeSeq) More() ISeq

func (*ArrayNodeSeq) Next

func (s *ArrayNodeSeq) Next() ISeq

func (*ArrayNodeSeq) Seq

func (s *ArrayNodeSeq) Seq() ISeq

func (*ArrayNodeSeq) String

func (s *ArrayNodeSeq) String() string

func (*ArrayNodeSeq) WithMeta

func (s *ArrayNodeSeq) WithMeta(meta IPersistentMap) any

type Associative

type Associative interface {
	IPersistentCollection
	ILookup

	ContainsKey(any) bool

	EntryAt(any) IMapEntry

	Assoc(k, v any) Associative
}

func Assoc

func Assoc(a any, k, v any) Associative

type Atom

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

func NewAtom

func NewAtom(val interface{}) *Atom

func (*Atom) AddWatch

func (a *Atom) AddWatch(key interface{}, fn IFn)

func (*Atom) CompareAndSet

func (a *Atom) CompareAndSet(oldv, newv interface{}) bool

func (*Atom) Deref

func (a *Atom) Deref() interface{}

func (*Atom) RemoveWatch

func (a *Atom) RemoveWatch(key interface{})

func (*Atom) Reset

func (a *Atom) Reset(newVal interface{}) interface{}

func (*Atom) SetValidator

func (a *Atom) SetValidator(vf IFn)

func (*Atom) Swap

func (a *Atom) Swap(f IFn, args ISeq) interface{}

func (*Atom) Validator

func (a *Atom) Validator() IFn

func (*Atom) Watches

func (a *Atom) Watches() IPersistentMap

type BigDecimal

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

BigDec is an arbitrary-precision decimal number. It wraps and has the same semantics as big.Float. big.Float is not used directly because it is mutable, and the core BigDecimal should not be.

func AsBigDecimal

func AsBigDecimal(x any) *BigDecimal

func NewBigDecimal

func NewBigDecimal(s string) (*BigDecimal, error)

NewBigDecimal creates a new BigDecimal from a string.

func NewBigDecimalFromBigFloat

func NewBigDecimalFromBigFloat(x *big.Float) *BigDecimal

NewBigDecimalFromBigFloat

func NewBigDecimalFromFloat64

func NewBigDecimalFromFloat64(x float64) *BigDecimal

NewBigDecimalFromFloat64 creates a new BigDecimal from a float64.

func NewBigDecimalFromInt64

func NewBigDecimalFromInt64(x int64) *BigDecimal

func (*BigDecimal) Abs

func (n *BigDecimal) Abs() *BigDecimal

func (*BigDecimal) Add

func (n *BigDecimal) Add(other *BigDecimal) *BigDecimal

func (*BigDecimal) AddInt

func (n *BigDecimal) AddInt(x int) *BigDecimal

func (*BigDecimal) AddP

func (n *BigDecimal) AddP(other *BigDecimal) *BigDecimal

func (*BigDecimal) Cmp

func (n *BigDecimal) Cmp(other *BigDecimal) int

func (*BigDecimal) Divide

func (n *BigDecimal) Divide(other *BigDecimal) *BigDecimal

func (*BigDecimal) Equals

func (n *BigDecimal) Equals(v interface{}) bool

func (*BigDecimal) GT

func (n *BigDecimal) GT(other *BigDecimal) bool

func (*BigDecimal) GTE

func (n *BigDecimal) GTE(other *BigDecimal) bool

func (*BigDecimal) Hash

func (n *BigDecimal) Hash() uint32

func (*BigDecimal) LT

func (n *BigDecimal) LT(other *BigDecimal) bool

func (*BigDecimal) LTE

func (n *BigDecimal) LTE(other *BigDecimal) bool

func (*BigDecimal) Multiply

func (n *BigDecimal) Multiply(other *BigDecimal) *BigDecimal

func (*BigDecimal) Negate

func (n *BigDecimal) Negate() *BigDecimal

func (*BigDecimal) Quotient

func (n *BigDecimal) Quotient(other *BigDecimal) *BigDecimal

func (*BigDecimal) Remainder

func (n *BigDecimal) Remainder(other *BigDecimal) *BigDecimal

func (*BigDecimal) String

func (n *BigDecimal) String() string

func (*BigDecimal) Sub

func (n *BigDecimal) Sub(other *BigDecimal) *BigDecimal

func (*BigDecimal) SubP

func (n *BigDecimal) SubP(other *BigDecimal) *BigDecimal

func (*BigDecimal) ToBigInteger

func (n *BigDecimal) ToBigInteger() *big.Int

type BigInt

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

BigInt is an arbitrary-precision integer. It wraps and has the same semantics as big.Int. big.Int is not used directly because it is mutable, and the core BigInt should not be.

func AsBigInt

func AsBigInt(x any) *BigInt

func NewBigInt

func NewBigInt(s string) (*BigInt, error)

NewBigInt creates a new BigInt from a string.

func NewBigIntFromGoBigInt

func NewBigIntFromGoBigInt(x *big.Int) *BigInt

func NewBigIntFromInt64

func NewBigIntFromInt64(x int64) *BigInt

NewBigIntFromInt64 creates a new BigInt from an int64.

func NewBigIntWithBase

func NewBigIntWithBase(s string, base int) (*BigInt, error)

NewBigIntWithBase creates a new BigInt from a string.

func (*BigInt) Abs

func (n *BigInt) Abs() *BigInt

func (*BigInt) Add

func (n *BigInt) Add(other *BigInt) *BigInt

func (*BigInt) AddInt

func (n *BigInt) AddInt(x int) *BigInt

func (*BigInt) Cmp

func (n *BigInt) Cmp(other *BigInt) int

func (*BigInt) Divide

func (n *BigInt) Divide(other *BigInt) any

func (*BigInt) Equals

func (n *BigInt) Equals(v interface{}) bool

func (*BigInt) GT

func (n *BigInt) GT(other *BigInt) bool

func (*BigInt) GTE

func (n *BigInt) GTE(other *BigInt) bool

func (*BigInt) Hash

func (n *BigInt) Hash() uint32

func (*BigInt) Int64

func (n *BigInt) Int64() int64

func (*BigInt) IsInt64

func (n *BigInt) IsInt64() bool

func (*BigInt) LT

func (n *BigInt) LT(other *BigInt) bool

func (*BigInt) LTE

func (n *BigInt) LTE(other *BigInt) bool

func (*BigInt) Multiply

func (n *BigInt) Multiply(other *BigInt) *BigInt

func (*BigInt) Quotient

func (n *BigInt) Quotient(other *BigInt) *BigInt

func (*BigInt) Remainder

func (n *BigInt) Remainder(other *BigInt) *BigInt

func (*BigInt) String

func (n *BigInt) String() string

func (*BigInt) Sub

func (n *BigInt) Sub(other *BigInt) *BigInt

func (*BigInt) ToBigDecimal

func (n *BigInt) ToBigDecimal() *BigDecimal

func (*BigInt) ToBigInteger

func (n *BigInt) ToBigInteger() *big.Int

type BitmapIndexedNode

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

type Box

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

Box is a wrapper around a value that can be used to store values of different types in atomic.Value, which requires all stored values to have the same concrete type.

func NewBox

func NewBox(val interface{}) *Box

NewBox returns a new Box that wraps the given value.

type Category

type Category int

type Char

type Char rune

Char is a character value.

func CharAt

func CharAt(s string, idx int) Char

func CharCast

func CharCast(x any) Char

func NewChar

func NewChar(value rune) Char

NewChar creates a new character value.

func UncheckedCharCast

func UncheckedCharCast(x any) Char

func (Char) Equals

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

func (Char) Hash

func (c Char) Hash() uint32

type ChunkBuffer

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

func NewChunkBuffer

func NewChunkBuffer(capacity int) *ChunkBuffer

func (*ChunkBuffer) Add

func (cb *ChunkBuffer) Add(item interface{})

func (*ChunkBuffer) Chunk

func (cb *ChunkBuffer) Chunk() IChunk

func (*ChunkBuffer) Count

func (cb *ChunkBuffer) Count() int

type ChunkedCons

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

func NewChunkedCons

func NewChunkedCons(chunk IChunk, more ISeq) *ChunkedCons

func (*ChunkedCons) ChunkedFirst

func (c *ChunkedCons) ChunkedFirst() IChunk

func (*ChunkedCons) ChunkedMore

func (c *ChunkedCons) ChunkedMore() ISeq

func (*ChunkedCons) ChunkedNext

func (c *ChunkedCons) ChunkedNext() ISeq

func (*ChunkedCons) Cons

func (c *ChunkedCons) Cons(o any) Conser

func (*ChunkedCons) Count

func (c *ChunkedCons) Count() int

func (*ChunkedCons) Empty

func (*ChunkedCons) Equals

func (c *ChunkedCons) Equals(o any) bool

func (*ChunkedCons) Equiv

func (c *ChunkedCons) Equiv(o any) bool

func (*ChunkedCons) First

func (c *ChunkedCons) First() any

func (*ChunkedCons) Hash

func (c *ChunkedCons) Hash() uint32

func (*ChunkedCons) HashEq

func (c *ChunkedCons) HashEq() uint32

func (*ChunkedCons) Meta

func (c *ChunkedCons) Meta() IPersistentMap

func (*ChunkedCons) More

func (c *ChunkedCons) More() ISeq

func (*ChunkedCons) Next

func (c *ChunkedCons) Next() ISeq

func (*ChunkedCons) Seq

func (c *ChunkedCons) Seq() ISeq

func (*ChunkedCons) String

func (c *ChunkedCons) String() string

func (*ChunkedCons) WithMeta

func (c *ChunkedCons) WithMeta(meta IPersistentMap) any

type Comparer

type Comparer interface {
	Compare(other any) int
}

type Conjer

type Conjer interface {
	Conj(any) Conjer
}

Conjer is an interface for values that can be conjed onto.

type Cons

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

func (*Cons) Cons

func (c *Cons) Cons(o any) Conser

func (*Cons) Count

func (c *Cons) Count() int

func (*Cons) Empty

func (c *Cons) Empty() IPersistentCollection

func (*Cons) Equals

func (c *Cons) Equals(o any) bool

func (*Cons) Equiv

func (c *Cons) Equiv(o any) bool

func (*Cons) First

func (c *Cons) First() any

func (*Cons) Hash

func (c *Cons) Hash() uint32

func (*Cons) HashEq

func (c *Cons) HashEq() uint32

func (*Cons) Meta

func (c *Cons) Meta() IPersistentMap

func (*Cons) More

func (c *Cons) More() ISeq

func (*Cons) Next

func (c *Cons) Next() ISeq

func (*Cons) Seq

func (c *Cons) Seq() ISeq

func (*Cons) String

func (c *Cons) String() string

func (*Cons) WithMeta

func (c *Cons) WithMeta(meta IPersistentMap) any

type Conser

type Conser interface {
	Cons(any) Conser
}

Conser is an interface for values that can be consed onto.

func Conj

func Conj(coll Conser, x any) Conser

type Counted

type Counted interface {
	Count() int
}

Counted is an interface for compound values whose elements can be counted.

type Cycle

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

func (*Cycle) Cons

func (c *Cycle) Cons(o any) Conser

func (*Cycle) Count

func (c *Cycle) Count() int

func (*Cycle) Empty

func (c *Cycle) Empty() IPersistentCollection

func (*Cycle) Equals

func (c *Cycle) Equals(o any) bool

func (*Cycle) Equiv

func (c *Cycle) Equiv(o any) bool

func (*Cycle) First

func (c *Cycle) First() interface{}

func (*Cycle) Hash

func (c *Cycle) Hash() uint32

func (*Cycle) HashEq

func (c *Cycle) HashEq() uint32

func (*Cycle) IsRealized

func (c *Cycle) IsRealized() bool

func (*Cycle) Meta

func (c *Cycle) Meta() IPersistentMap

func (*Cycle) More

func (c *Cycle) More() ISeq

func (*Cycle) Next

func (c *Cycle) Next() ISeq

func (*Cycle) Reduce

func (c *Cycle) Reduce(f IFn) interface{}

func (*Cycle) ReduceInit

func (c *Cycle) ReduceInit(f IFn, init interface{}) interface{}

func (*Cycle) Seq

func (c *Cycle) Seq() ISeq

func (*Cycle) String

func (c *Cycle) String() string

func (*Cycle) WithMeta

func (c *Cycle) WithMeta(meta IPersistentMap) interface{}

type EmptyList

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

func (*EmptyList) Cons

func (e *EmptyList) Cons(x any) Conser

func (*EmptyList) Count

func (e *EmptyList) Count() int

func (*EmptyList) Empty

func (e *EmptyList) Empty() IPersistentCollection

func (*EmptyList) Equals

func (e *EmptyList) Equals(other any) bool

func (*EmptyList) Equiv

func (e *EmptyList) Equiv(other any) bool

func (*EmptyList) First

func (e *EmptyList) First() any

func (*EmptyList) Hash

func (e *EmptyList) Hash() uint32

func (*EmptyList) HashEq

func (e *EmptyList) HashEq() uint32

func (*EmptyList) IsEmpty

func (e *EmptyList) IsEmpty() bool

func (*EmptyList) Meta

func (e *EmptyList) Meta() IPersistentMap

func (*EmptyList) More

func (e *EmptyList) More() ISeq

func (*EmptyList) Next

func (e *EmptyList) Next() ISeq

func (*EmptyList) Peek

func (e *EmptyList) Peek() any

func (*EmptyList) Pop

func (e *EmptyList) Pop() IPersistentStack

func (*EmptyList) Reduce

func (e *EmptyList) Reduce(f IFn) any

func (*EmptyList) ReduceInit

func (e *EmptyList) ReduceInit(f IFn, init any) any

func (*EmptyList) Seq

func (e *EmptyList) Seq() ISeq

func (*EmptyList) String

func (e *EmptyList) String() string

func (*EmptyList) WithMeta

func (e *EmptyList) WithMeta(meta IPersistentMap) any

type EmptyMapIterator

type EmptyMapIterator struct {
}

type Environment

type Environment interface {
	// PushScope returns a new Environment with a scope nested inside
	// this environment's scope.
	//
	// TODO: make this work properly for lexical scoping.
	PushScope() Environment

	// WithRecurTarget returns a new Environment with the given recur
	// target. A recur form will return a RecurError with the given
	// target.
	WithRecurTarget(target interface{}) Environment

	// BindLocal binds the given name to the given value in the local
	// scope.
	BindLocal(sym *Symbol, v interface{})

	// DefVar defines a new var in the current namespace.
	DefVar(sym *Symbol, v interface{}) *Var

	// Eval evaluates a value representing an expression in this
	// environment.
	Eval(expr interface{}) (interface{}, error)

	EvalAST(n interface{}) (interface{}, error)

	// ResolveFile looks up a file in the environment. It should expand
	// relative paths to absolute paths. Relative paths are searched for
	// in the environments load paths.
	//
	// Deprecated
	ResolveFile(path string) (string, bool)

	// PushLoadPaths adds paths to the environment's list of load
	// paths. The provided paths will be searched for relative paths
	// first in the returned environment.
	//
	// Deprecated
	PushLoadPaths(paths []string) Environment

	SetCurrentNamespace(ns *Namespace)

	CurrentNamespace() *Namespace

	// Stdout returns the standard output stream for this environment.
	Stdout() io.Writer

	// Stderr returns the error output stream for this environment.
	Stderr() io.Writer

	// Context returns the context associated with this environment.
	Context() context.Context

	Errorf(form interface{}, format string, args ...interface{}) error
}

Environment is an interface for execution environments.

var (
	GlobalEnv Environment
)

type Equalser

type Equalser interface {
	Equals(any) bool
}

Not a Clojure interface, but useful for Go

type Equiver

type Equiver interface {
	Equiv(any) bool
}

Not a Clojure interface, but useful for Go

type Error

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

Error is a value that represents an error.

func NewError

func NewError(frame StackFrame, err error) *Error

NewError creates a new error value.

func (*Error) AddStack

func (e *Error) AddStack(frame StackFrame) error

AddStack adds a new stack trace entry.

func (*Error) Error

func (e *Error) Error() string

Error returns the error message.

func (*Error) Stack

func (e *Error) Stack() []StackFrame

Stack returns the stack trace.

func (*Error) Unwrap

func (e *Error) Unwrap() error

Unwrap returns the underlying error.

type Future

type Future interface {
	Get() any
	GetWithTimeout(timeout int64, timeUnit time.Duration) any
}

Java Future interface

type GoMapSeq

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

func NewGoMapSeq

func NewGoMapSeq(gm any) *GoMapSeq

func (*GoMapSeq) Cons

func (s *GoMapSeq) Cons(o any) Conser

func (*GoMapSeq) Count

func (s *GoMapSeq) Count() int

func (*GoMapSeq) Empty

func (s *GoMapSeq) Empty() IPersistentCollection

func (*GoMapSeq) Equals

func (s *GoMapSeq) Equals(o any) bool

func (*GoMapSeq) Equiv

func (s *GoMapSeq) Equiv(o any) bool

func (*GoMapSeq) First

func (s *GoMapSeq) First() any

func (*GoMapSeq) Hash

func (s *GoMapSeq) Hash() uint32

func (*GoMapSeq) HashEq

func (s *GoMapSeq) HashEq() uint32

func (*GoMapSeq) KVReduce

func (s *GoMapSeq) KVReduce(f IFn, init any) any

func (*GoMapSeq) Meta

func (s *GoMapSeq) Meta() IPersistentMap

func (*GoMapSeq) More

func (s *GoMapSeq) More() ISeq

func (*GoMapSeq) Next

func (s *GoMapSeq) Next() ISeq

func (*GoMapSeq) Reduce

func (s *GoMapSeq) Reduce(f IFn) any

func (*GoMapSeq) ReduceInit

func (s *GoMapSeq) ReduceInit(f IFn, init any) any

func (*GoMapSeq) Seq

func (s *GoMapSeq) Seq() ISeq

func (*GoMapSeq) String

func (s *GoMapSeq) String() string

func (*GoMapSeq) WithMeta

func (s *GoMapSeq) WithMeta(meta IPersistentMap) any

type HashCollisionNode

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

type Hasher

type Hasher interface {
	Hash() uint32
}

Hasher is an interface for types that can be hashed. It's not in Clojure, but it's useful for Go where values don't come with a default hash method.

type IAtom

type IAtom interface {
	Swap(f IFn, args ISeq) any
	CompareAndSet(oldv, newv any) bool
	Reset(newVal any) any
}

type IAtom2

type IAtom2 interface {
	IAtom
}

type IBlockingDeref

type IBlockingDeref interface {
	DerefWithTimeout(timeoutMS int64, timeoutVal any) any
}

func AgentSubmit

func AgentSubmit(fn IFn) IBlockingDeref

type IChunk

type IChunk interface {
	Indexed

	DropFirst() IChunk
	ReduceInit(fn IFn, init any) any
}

type IChunkedSeq

type IChunkedSeq interface {
	ISeq
	Sequential

	ChunkedFirst() IChunk
	ChunkedNext() ISeq
	ChunkedMore() ISeq
}

type IDeref

type IDeref interface {
	Deref() any
}

type IDrop

type IDrop interface {
	Drop(n int) Sequential
}

type IEditableCollection

type IEditableCollection interface {
	AsTransient() ITransientCollection
}

type IFn

type IFn interface {
	Invoke(args ...any) any
	ApplyTo(args ISeq) any
}

type IFnFunc

type IFnFunc func(args ...interface{}) interface{}

IFnFunc is a function that can be applied to a list of arguments.

func (IFnFunc) ApplyTo

func (f IFnFunc) ApplyTo(args ISeq) interface{}

func (IFnFunc) Invoke

func (f IFnFunc) Invoke(args ...interface{}) interface{}

type IHashEq

type IHashEq interface {
	HashEq() uint32
}

TODO: use this interface

type IKVReduce

type IKVReduce interface {
	KVReduce(f IFn, init any) any
}

type ILookup

type ILookup interface {
	ValAt(any) any
	ValAtDefault(any, any) any
}

type IMapEntry

type IMapEntry interface {
	Key() any
	Val() any
}

type IMeta

type IMeta interface {
	// Meta returns the metadata associated with this value.
	Meta() IPersistentMap
}

IMeta is an interface for values that can have metadata.

type IObj

type IObj interface {
	IMeta

	// WithMeta returns a new value with the given metadata.
	WithMeta(meta IPersistentMap) any
}

type IPending

type IPending interface {
	IsRealized() bool
}

type IPersistentCollection

type IPersistentCollection interface {
	Seqable
	Counted
	Conser

	Empty() IPersistentCollection

	Equiv(any) bool
}

type IPersistentList

type IPersistentList interface {
	Sequential

	IPersistentCollection
	IPersistentStack
	// Clojure's IPersistentList does not implement this, but it
	// likely should.
	ISeq
}

func NewList

func NewList(values ...any) IPersistentList

type IPersistentMap

type IPersistentMap interface {
	//Iterable do we need this?
	Associative
	Counted

	// AssocEx is like Assoc, but returns an error if the key already
	// exists.
	AssocEx(key, val any) IPersistentMap

	// Without returns a new map with the given key removed.
	Without(key any) IPersistentMap
}

func Merge

func Merge(m1, m2 IPersistentMap) IPersistentMap

func NewMap

func NewMap(keyVals ...any) IPersistentMap

func NewPersistentArrayMapAsIfByAssoc

func NewPersistentArrayMapAsIfByAssoc(init []any) IPersistentMap

func NewPersistentHashMap

func NewPersistentHashMap(keyvals ...any) IPersistentMap

func SafeMerge

func SafeMerge(m1, m2 IPersistentMap) IPersistentMap

type IPersistentSet

type IPersistentSet interface {
	IPersistentCollection
	Counted

	Disjoin(any) IPersistentSet
	Contains(any) bool
	Get(any) any
}

type IPersistentStack

type IPersistentStack interface {
	Peek() any
	Pop() IPersistentStack
}

type IPersistentVector

type IPersistentVector interface {
	Associative
	Sequential
	IPersistentStack
	Reversible
	Indexed
	Counted // Note: not in Clojure's vector interface, oddly

	Length() int

	AssocN(int, any) IPersistentVector

	Cons(any) Conser
}

IPersistentVector is a persistent vector.

func CreateLazilyPersistentVector

func CreateLazilyPersistentVector(obj any) IPersistentVector

func CreateOwningLazilyPersistentVector

func CreateOwningLazilyPersistentVector(items any) IPersistentVector

CreateOwningLazilyPersistentVector creates a persistent vector that owns the items in items. items must be a slice or array.

func Subvec

func Subvec(v IPersistentVector, start, end int) IPersistentVector

type IRecord

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

type IReduce

type IReduce interface {
	Reduce(f IFn) any
}

type IReduceInit

type IReduceInit interface {
	ReduceInit(f IFn, init any) any
}

type IRef

type IRef interface {
	IDeref

	SetValidator(vf IFn)
	Validator() IFn
	Watches() IPersistentMap
	AddWatch(key any, fn IFn)
	RemoveWatch(key any)
}

type ISeq

type ISeq interface {
	IPersistentCollection
	Conser

	// First returns the first element of the sequence.
	First() any

	// Next returns the rest of the sequence, or nil if there are no
	// more.
	Next() ISeq

	// More returns true if there are more elements in the sequence.
	More() ISeq
}

func Keys

func Keys(m Associative) ISeq

func NewCons

func NewCons(x any, xs any) ISeq

func NewCycle

func NewCycle(vals ISeq) ISeq

func NewLazySeq

func NewLazySeq(fn func() interface{}) ISeq

func NewLongRange

func NewLongRange(start, end, step int64) (res ISeq)

NewLongRange returns a lazy sequence of start, start + step, start + 2*step, ...

func NewMapKeySeq

func NewMapKeySeq(s ISeq) ISeq

func NewMapValSeq

func NewMapValSeq(s ISeq) ISeq

func NewRange

func NewRange(start, end, step any) ISeq

NewRange returns a lazy sequence of start, start + step, start + 2*step, ...

func NewRepeatN

func NewRepeatN(count int64, x interface{}) ISeq

func NewSliceSeq

func NewSliceSeq(x any) ISeq

func Next

func Next(x interface{}) ISeq

func Seq

func Seq(x interface{}) ISeq

func Vals

func Vals(m Associative) ISeq

type ITransientAssociative

type ITransientAssociative interface {
	ITransientCollection
	ILookup

	Assoc(any, any) ITransientAssociative
}

type ITransientCollection

type ITransientCollection interface {
	Conjer
	Persistent() IPersistentCollection
}

type ITransientSet

type ITransientSet interface {
	IPersistentCollection
	Counted

	Disjoin(any) ITransientSet
	Contains(any) bool
	Get(any) any
}

type ITransientVector

type ITransientVector interface {
	ITransientAssociative
	Indexed

	AssocN(int, any) ITransientVector
	Pop() ITransientVector
}

type IllegalArgumentError

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

func (*IllegalArgumentError) Error

func (e *IllegalArgumentError) Error() string

func (*IllegalArgumentError) Is

func (e *IllegalArgumentError) Is(other error) bool

type IllegalStateError

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

func (*IllegalStateError) Error

func (e *IllegalStateError) Error() string

func (*IllegalStateError) Is

func (e *IllegalStateError) Is(other error) bool

type IndexOutOfBoundsError

type IndexOutOfBoundsError struct{}

func (*IndexOutOfBoundsError) Error

func (e *IndexOutOfBoundsError) Error() string

func (*IndexOutOfBoundsError) Is

func (e *IndexOutOfBoundsError) Is(other error) bool

type Indexed

type Indexed interface {
	Counted

	Nth(int) any
	NthDefault(int, any) any
}

type IndexedSeq

type IndexedSeq interface {
	ISeq
	Sequential
	Counted

	Index() int
}

type Keyword

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

Keyword represents a keyword. Syntactically, a keyword is a symbol that starts with a colon and evaluates to itself.

func InternKeyword

func InternKeyword(ns, name interface{}) Keyword

func InternKeywordString

func InternKeywordString(s string) Keyword

func InternKeywordSymbol

func InternKeywordSymbol(s *Symbol) Keyword

func NewKeyword

func NewKeyword(s string) Keyword

func (Keyword) ApplyTo

func (k Keyword) ApplyTo(args ISeq) interface{}

func (Keyword) Equals

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

func (Keyword) Hash

func (k Keyword) Hash() uint32

func (Keyword) Invoke

func (k Keyword) Invoke(args ...interface{}) interface{}

func (Keyword) Name

func (k Keyword) Name() string

func (Keyword) Namespace

func (k Keyword) Namespace() string

func (Keyword) String

func (k Keyword) String() string

type LazySeq

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

func (*LazySeq) Cons

func (s *LazySeq) Cons(x interface{}) Conser

func (*LazySeq) Count

func (s *LazySeq) Count() int

func (*LazySeq) Empty

func (s *LazySeq) Empty() IPersistentCollection

func (*LazySeq) Equals

func (s *LazySeq) Equals(o interface{}) bool

func (*LazySeq) Equiv

func (s *LazySeq) Equiv(o interface{}) bool

func (*LazySeq) First

func (s *LazySeq) First() interface{}

func (*LazySeq) Hash

func (s *LazySeq) Hash() uint32

func (*LazySeq) HashEq

func (s *LazySeq) HashEq() uint32

func (*LazySeq) IsRealized

func (s *LazySeq) IsRealized() bool

func (*LazySeq) Meta

func (s *LazySeq) Meta() IPersistentMap

func (*LazySeq) More

func (s *LazySeq) More() ISeq

func (*LazySeq) Next

func (s *LazySeq) Next() ISeq

func (*LazySeq) Seq

func (s *LazySeq) Seq() ISeq

func (*LazySeq) String

func (s *LazySeq) String() string

func (*LazySeq) WithMeta

func (s *LazySeq) WithMeta(meta IPersistentMap) interface{}

type List

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

List is a list of values.

func ConsList

func ConsList(item any, next *List) *List

func (*List) Cons

func (l *List) Cons(x any) Conser

func (*List) Count

func (l *List) Count() int

func (*List) Empty

func (l *List) Empty() IPersistentCollection

func (*List) Equals

func (l *List) Equals(other any) bool

func (*List) Equiv

func (l *List) Equiv(other any) bool

func (*List) First

func (l *List) First() any

func (*List) Hash

func (l *List) Hash() uint32

func (*List) HashEq

func (l *List) HashEq() uint32

func (*List) IsEmpty

func (l *List) IsEmpty() bool

func (*List) Item

func (l *List) Item() any

Item returns the data from this list node. AKA car.

func (*List) Meta

func (l *List) Meta() IPersistentMap

func (*List) More

func (l *List) More() ISeq

func (*List) Next

func (l *List) Next() ISeq

Next returns the next list node. AKA cdr, with the requirement that it must be a list.

func (*List) Peek

func (l *List) Peek() any

func (*List) Pop

func (l *List) Pop() IPersistentStack

func (*List) Reduce

func (l *List) Reduce(f IFn) any

func (*List) ReduceInit

func (l *List) ReduceInit(f IFn, init any) any

func (*List) Seq

func (l *List) Seq() ISeq

func (*List) String

func (l *List) String() string

func (*List) WithMeta

func (l *List) WithMeta(meta IPersistentMap) any

type LockingTransactor

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

func (*LockingTransactor) RunInTransaction

func (lt *LockingTransactor) RunInTransaction(fn IFn) interface{}

type LongChunk

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

func NewLongChunk

func NewLongChunk(start, step int64, count int) *LongChunk

func (*LongChunk) Count

func (c *LongChunk) Count() int

func (*LongChunk) DropFirst

func (c *LongChunk) DropFirst() IChunk

func (*LongChunk) First

func (c *LongChunk) First() any

func (*LongChunk) Nth

func (c *LongChunk) Nth(i int) any

func (*LongChunk) NthDefault

func (c *LongChunk) NthDefault(i int, notFound any) any

func (*LongChunk) ReduceInit

func (c *LongChunk) ReduceInit(f IFn, init any) any

type LongRange

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

func (*LongRange) ChunkedFirst

func (r *LongRange) ChunkedFirst() IChunk

func (*LongRange) ChunkedMore

func (r *LongRange) ChunkedMore() ISeq

func (*LongRange) ChunkedNext

func (r *LongRange) ChunkedNext() ISeq

func (*LongRange) Cons

func (r *LongRange) Cons(o any) Conser

func (*LongRange) Count

func (r *LongRange) Count() int

func (*LongRange) Drop

func (r *LongRange) Drop(n int) Sequential

func (*LongRange) Empty

func (r *LongRange) Empty() IPersistentCollection

func (*LongRange) Equals

func (r *LongRange) Equals(o any) bool

func (*LongRange) Equiv

func (r *LongRange) Equiv(o any) bool

func (*LongRange) First

func (r *LongRange) First() any

func (*LongRange) Hash

func (r *LongRange) Hash() uint32

func (*LongRange) HashEq

func (r *LongRange) HashEq() uint32

func (*LongRange) Meta

func (r *LongRange) Meta() IPersistentMap

func (*LongRange) More

func (r *LongRange) More() ISeq

func (*LongRange) Next

func (r *LongRange) Next() ISeq

func (*LongRange) Reduce

func (r *LongRange) Reduce(f IFn) any

func (*LongRange) ReduceInit

func (r *LongRange) ReduceInit(f IFn, init any) any

func (*LongRange) Seq

func (r *LongRange) Seq() ISeq

func (*LongRange) String

func (r *LongRange) String() string

func (*LongRange) WithMeta

func (r *LongRange) WithMeta(meta IPersistentMap) any

type Map

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

Map represents a map of glojure values.

func (*Map) ApplyTo

func (m *Map) ApplyTo(args ISeq) any

func (*Map) AsTransient

func (m *Map) AsTransient() ITransientCollection

func (*Map) Assoc

func (m *Map) Assoc(k, v any) Associative

func (*Map) AssocEx

func (m *Map) AssocEx(k, v any) IPersistentMap

func (*Map) Cons

func (m *Map) Cons(x any) Conser

func (*Map) ContainsKey

func (m *Map) ContainsKey(k any) bool

func (*Map) Count

func (m *Map) Count() int

func (*Map) Empty

func (m *Map) Empty() IPersistentCollection

func (*Map) EntryAt

func (m *Map) EntryAt(k any) IMapEntry

func (*Map) Equiv

func (m *Map) Equiv(o any) bool

func (*Map) HashEq

func (m *Map) HashEq() uint32

func (*Map) Invoke

func (m *Map) Invoke(args ...any) any

func (*Map) Meta

func (m *Map) Meta() IPersistentMap

func (*Map) Reduce

func (m *Map) Reduce(f IFn) any

func (*Map) ReduceInit

func (m *Map) ReduceInit(f IFn, init any) any

func (*Map) Seq

func (m *Map) Seq() ISeq

func (*Map) String

func (m *Map) String() string

func (*Map) ValAt

func (m *Map) ValAt(key any) any

func (*Map) ValAtDefault

func (m *Map) ValAtDefault(key, def any) any

func (*Map) WithMeta

func (m *Map) WithMeta(meta IPersistentMap) any

func (*Map) Without

func (m *Map) Without(k any) IPersistentMap

type MapEntry

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

MapEntry represents a key-value pair in a map.

func NewMapEntry

func NewMapEntry(key, val any) *MapEntry

func (*MapEntry) ApplyTo

func (me *MapEntry) ApplyTo(args ISeq) any

func (*MapEntry) Assoc

func (me *MapEntry) Assoc(k, v any) Associative

func (*MapEntry) AssocN

func (me *MapEntry) AssocN(i int, o any) IPersistentVector

func (*MapEntry) Cons

func (me *MapEntry) Cons(o any) Conser

func (*MapEntry) ContainsKey

func (me *MapEntry) ContainsKey(k any) bool

func (*MapEntry) Count

func (me *MapEntry) Count() int

func (*MapEntry) Empty

func (me *MapEntry) Empty() IPersistentCollection

func (*MapEntry) EntryAt

func (me *MapEntry) EntryAt(k any) IMapEntry

func (*MapEntry) Equiv

func (me *MapEntry) Equiv(o any) bool

func (*MapEntry) GetKey

func (me *MapEntry) GetKey() any

func (*MapEntry) GetValue

func (me *MapEntry) GetValue() any

func (*MapEntry) HashEq

func (me *MapEntry) HashEq() uint32

func (*MapEntry) Invoke

func (me *MapEntry) Invoke(args ...any) any

func (*MapEntry) Key

func (me *MapEntry) Key() any

func (*MapEntry) Length

func (me *MapEntry) Length() int

func (*MapEntry) Nth

func (me *MapEntry) Nth(i int) any

func (*MapEntry) NthDefault

func (me *MapEntry) NthDefault(i int, d any) any

func (*MapEntry) Peek

func (me *MapEntry) Peek() any

func (*MapEntry) Pop

func (me *MapEntry) Pop() IPersistentStack

func (*MapEntry) RSeq

func (me *MapEntry) RSeq() ISeq

func (*MapEntry) Seq

func (me *MapEntry) Seq() ISeq

func (*MapEntry) String

func (me *MapEntry) String() string

func (*MapEntry) Val

func (me *MapEntry) Val() any

func (*MapEntry) ValAt

func (me *MapEntry) ValAt(key any) any

func (*MapEntry) ValAtDefault

func (me *MapEntry) ValAtDefault(key, notFound any) any

type MapIterator

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

type MapKeySeq

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

func (*MapKeySeq) Cons

func (s *MapKeySeq) Cons(o any) Conser

func (*MapKeySeq) Count

func (s *MapKeySeq) Count() int

func (*MapKeySeq) Empty

func (s *MapKeySeq) Empty() IPersistentCollection

func (*MapKeySeq) Equals

func (s *MapKeySeq) Equals(o any) bool

func (*MapKeySeq) Equiv

func (s *MapKeySeq) Equiv(o any) bool

func (*MapKeySeq) First

func (s *MapKeySeq) First() any

func (*MapKeySeq) Hash

func (s *MapKeySeq) Hash() uint32

func (*MapKeySeq) HashEq

func (s *MapKeySeq) HashEq() uint32

func (*MapKeySeq) Meta

func (s *MapKeySeq) Meta() IPersistentMap

func (*MapKeySeq) More

func (s *MapKeySeq) More() ISeq

func (*MapKeySeq) Next

func (s *MapKeySeq) Next() ISeq

func (*MapKeySeq) Seq

func (s *MapKeySeq) Seq() ISeq

func (*MapKeySeq) String

func (s *MapKeySeq) String() string

func (*MapKeySeq) WithMeta

func (s *MapKeySeq) WithMeta(meta IPersistentMap) any

type MapSeq

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

func NewMapSeq

func NewMapSeq(kvs []any) *MapSeq

func (*MapSeq) Cons

func (s *MapSeq) Cons(o any) Conser

func (*MapSeq) Count

func (s *MapSeq) Count() int

func (*MapSeq) Drop

func (s *MapSeq) Drop(n int) Sequential

func (*MapSeq) Empty

func (s *MapSeq) Empty() IPersistentCollection

func (*MapSeq) Equals

func (s *MapSeq) Equals(o any) bool

func (*MapSeq) Equiv

func (s *MapSeq) Equiv(o any) bool

func (*MapSeq) First

func (s *MapSeq) First() any

func (*MapSeq) Hash

func (s *MapSeq) Hash() uint32

func (*MapSeq) HashEq

func (s *MapSeq) HashEq() uint32

func (*MapSeq) Meta

func (s *MapSeq) Meta() IPersistentMap

func (*MapSeq) More

func (s *MapSeq) More() ISeq

func (*MapSeq) Next

func (s *MapSeq) Next() ISeq

func (*MapSeq) Reduce

func (s *MapSeq) Reduce(f IFn) any

func (*MapSeq) ReduceInit

func (s *MapSeq) ReduceInit(f IFn, init any) any

func (*MapSeq) Seq

func (s *MapSeq) Seq() ISeq

func (*MapSeq) String

func (s *MapSeq) String() string

func (*MapSeq) WithMeta

func (s *MapSeq) WithMeta(meta IPersistentMap) any

type MapValSeq

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

func (*MapValSeq) Cons

func (s *MapValSeq) Cons(o any) Conser

func (*MapValSeq) Count

func (s *MapValSeq) Count() int

func (*MapValSeq) Empty

func (s *MapValSeq) Empty() IPersistentCollection

func (*MapValSeq) Equals

func (s *MapValSeq) Equals(o any) bool

func (*MapValSeq) Equiv

func (s *MapValSeq) Equiv(o any) bool

func (*MapValSeq) First

func (s *MapValSeq) First() any

func (*MapValSeq) Hash

func (s *MapValSeq) Hash() uint32

func (*MapValSeq) HashEq

func (s *MapValSeq) HashEq() uint32

func (*MapValSeq) Meta

func (s *MapValSeq) Meta() IPersistentMap

func (*MapValSeq) More

func (s *MapValSeq) More() ISeq

func (*MapValSeq) Next

func (s *MapValSeq) Next() ISeq

func (*MapValSeq) Reduce

func (s *MapValSeq) Reduce(f IFn) any

func (*MapValSeq) ReduceInit

func (s *MapValSeq) ReduceInit(f IFn, init any) any

func (*MapValSeq) Seq

func (s *MapValSeq) Seq() ISeq

func (*MapValSeq) String

func (s *MapValSeq) String() string

func (*MapValSeq) WithMeta

func (s *MapValSeq) WithMeta(meta IPersistentMap) any

type MultiFn

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

func NewMultiFn

func NewMultiFn(name string, dispatchFn IFn, defaultDispatchVal interface{}, hierarchy IRef) *MultiFn

func (*MultiFn) AddMethod

func (m *MultiFn) AddMethod(dispatchVal interface{}, method IFn) *MultiFn

func (*MultiFn) ApplyTo

func (m *MultiFn) ApplyTo(args ISeq) interface{}

func (*MultiFn) Invoke

func (m *MultiFn) Invoke(args ...interface{}) interface{}

func (*MultiFn) PreferMethod

func (m *MultiFn) PreferMethod(dispatchValX, dispatchValY interface{}) *MultiFn

func (*MultiFn) PreferTable

func (m *MultiFn) PreferTable() IPersistentMap

type Named

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

type Namespace

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

func FindNamespace

func FindNamespace(sym *Symbol) *Namespace

func FindOrCreateNamespace

func FindOrCreateNamespace(sym *Symbol) *Namespace

func NamespaceFor

func NamespaceFor(inns *Namespace, sym *Symbol) *Namespace

func Namespaces

func Namespaces() []*Namespace

func NewNamespace

func NewNamespace(name *Symbol) *Namespace

func (*Namespace) AddAlias

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

func (*Namespace) Aliases

func (ns *Namespace) Aliases() IPersistentMap

func (*Namespace) AlterMeta

func (ns *Namespace) AlterMeta(alter IFn, args ISeq) IPersistentMap

func (*Namespace) FindInternedVar

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

func (*Namespace) GetMapping

func (ns *Namespace) GetMapping(sym *Symbol) interface{}

func (*Namespace) Import

func (ns *Namespace) Import(export string, v interface{}) interface{}

Import references an export from a Go package.

func (*Namespace) Intern

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

Intern creates a new Var in this namespace with the given name.

func (*Namespace) InternWithValue

func (ns *Namespace) InternWithValue(sym *Symbol, value interface{}, replaceRoot bool) *Var

func (*Namespace) LookupAlias

func (ns *Namespace) LookupAlias(sym *Symbol) *Namespace

func (*Namespace) Mappings

func (ns *Namespace) Mappings() IPersistentMap

func (*Namespace) Meta

func (ns *Namespace) Meta() IPersistentMap

func (*Namespace) Name

func (ns *Namespace) Name() *Symbol

func (*Namespace) Refer

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

Refer adds a reference to an existing Var, possibly in another namespace, to this namespace.

func (*Namespace) ResetMeta

func (ns *Namespace) ResetMeta(meta IPersistentMap) IPersistentMap

func (*Namespace) String

func (ns *Namespace) String() string

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 {
	// contains filtered or unexported fields
}

func (*NodeSeq) Cons

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

func (*NodeSeq) Count

func (s *NodeSeq) Count() int

func (*NodeSeq) Empty

func (s *NodeSeq) Empty() IPersistentCollection

func (*NodeSeq) Equals

func (s *NodeSeq) Equals(obj any) bool

func (*NodeSeq) Equiv

func (s *NodeSeq) Equiv(obj any) bool

func (*NodeSeq) First

func (s *NodeSeq) First() any

func (*NodeSeq) Hash

func (s *NodeSeq) Hash() uint32

func (*NodeSeq) HashEq

func (s *NodeSeq) HashEq() uint32

func (*NodeSeq) Meta

func (n *NodeSeq) Meta() IPersistentMap

func (*NodeSeq) More

func (s *NodeSeq) More() ISeq

func (*NodeSeq) Next

func (s *NodeSeq) Next() ISeq

func (*NodeSeq) Seq

func (s *NodeSeq) Seq() ISeq

func (*NodeSeq) String

func (s *NodeSeq) String() string

func (*NodeSeq) WithMeta

func (s *NodeSeq) WithMeta(meta IPersistentMap) any

type Nther

type Nther interface {
	Nth(int) (v interface{}, ok bool)
}

Nther is an interface for compound values whose elements can be accessed by index.

type NumberMethods

type NumberMethods struct{}

NumberMethods is a struct with methods that map to Clojure's Number class' static methods.

func (*NumberMethods) Add

func (nm *NumberMethods) Add(x, y any) any

func (*NumberMethods) AddP

func (nm *NumberMethods) AddP(x, y any) any

func (*NumberMethods) And

func (nm *NumberMethods) And(x, y any) any

func (*NumberMethods) BooleanArray

func (nm *NumberMethods) BooleanArray(sizeOrSeq any) []bool

func (*NumberMethods) BooleanArrayInit

func (nm *NumberMethods) BooleanArrayInit(size int, init any) []bool

func (*NumberMethods) Booleans

func (nm *NumberMethods) Booleans(x any) []bool

func (*NumberMethods) ByteArray

func (nm *NumberMethods) ByteArray(sizeOrSeq any) []byte

func (*NumberMethods) ByteArrayInit

func (nm *NumberMethods) ByteArrayInit(size int, init any) []byte

func (*NumberMethods) Bytes

func (nm *NumberMethods) Bytes(x any) []byte

func (*NumberMethods) CharArray

func (nm *NumberMethods) CharArray(sizeOrSeq any) []Char

func (*NumberMethods) CharArrayInit

func (nm *NumberMethods) CharArrayInit(size int, init any) []Char

func (*NumberMethods) Chars

func (nm *NumberMethods) Chars(x any) []Char

func (*NumberMethods) ClearBit

func (nm *NumberMethods) ClearBit(x, y any) int64

func (*NumberMethods) Dec

func (nm *NumberMethods) Dec(x any) any

func (*NumberMethods) Divide

func (nm *NumberMethods) Divide(x, y any) any

func (*NumberMethods) DoubleArray

func (nm *NumberMethods) DoubleArray(sizeOrSeq any) []float64

func (*NumberMethods) DoubleArrayInit

func (nm *NumberMethods) DoubleArrayInit(size int, init any) []float64

func (*NumberMethods) Doubles

func (nm *NumberMethods) Doubles(x any) []float64

func (*NumberMethods) Equiv

func (nm *NumberMethods) Equiv(x, y any) bool

func (*NumberMethods) FlipBit

func (nm *NumberMethods) FlipBit(x, y any) int64

func (*NumberMethods) FloatArray

func (nm *NumberMethods) FloatArray(sizeOrSeq any) []float32

func (*NumberMethods) FloatArrayInit

func (nm *NumberMethods) FloatArrayInit(size int, init any) []float32

func (*NumberMethods) Floats

func (nm *NumberMethods) Floats(x any) []float32

func (*NumberMethods) Gt

func (nm *NumberMethods) Gt(x, y any) bool

func (*NumberMethods) Gte

func (nm *NumberMethods) Gte(x, y any) bool

func (*NumberMethods) Inc

func (nm *NumberMethods) Inc(v any) any

func (*NumberMethods) IntArray

func (nm *NumberMethods) IntArray(sizeOrSeq any) []int

func (*NumberMethods) IntArrayInit

func (nm *NumberMethods) IntArrayInit(size int, init any) []int

func (*NumberMethods) Ints

func (nm *NumberMethods) Ints(x any) []int

func (*NumberMethods) IsNeg

func (nm *NumberMethods) IsNeg(x any) bool

func (*NumberMethods) IsPos

func (nm *NumberMethods) IsPos(x any) bool

func (*NumberMethods) IsZero

func (nm *NumberMethods) IsZero(x any) bool

func (*NumberMethods) LongArray

func (nm *NumberMethods) LongArray(sizeOrSeq any) []int64

func (*NumberMethods) LongArrayInit

func (nm *NumberMethods) LongArrayInit(size int, init any) []int64

func (*NumberMethods) Longs

func (nm *NumberMethods) Longs(x any) []int64

func (*NumberMethods) Lt

func (nm *NumberMethods) Lt(x, y any) bool

func (*NumberMethods) Lte

func (nm *NumberMethods) Lte(x, y any) bool

func (*NumberMethods) Max

func (nm *NumberMethods) Max(x, y any) any

func (*NumberMethods) Min

func (nm *NumberMethods) Min(x, y any) any

func (*NumberMethods) Minus

func (nm *NumberMethods) Minus(x, y any) any

func (*NumberMethods) MinusP

func (nm *NumberMethods) MinusP(x, y any) any

func (*NumberMethods) Multiply

func (nm *NumberMethods) Multiply(x, y any) any

func (*NumberMethods) MultiplyP

func (nm *NumberMethods) MultiplyP(x, y any) any

func (*NumberMethods) Quotient

func (nm *NumberMethods) Quotient(x, y any) any

func (*NumberMethods) Remainder

func (nm *NumberMethods) Remainder(x, y any) any

func (*NumberMethods) SetBit

func (nm *NumberMethods) SetBit(x, y any) int64

func (*NumberMethods) ShiftLeft

func (nm *NumberMethods) ShiftLeft(x, y any) int64

func (*NumberMethods) ShiftRight

func (nm *NumberMethods) ShiftRight(x, y any) int64

func (*NumberMethods) ShortArray

func (nm *NumberMethods) ShortArray(sizeOrSeq any) []int16

func (*NumberMethods) ShortArrayInit

func (nm *NumberMethods) ShortArrayInit(size int, init any) []int16

func (*NumberMethods) Shorts

func (nm *NumberMethods) Shorts(x any) []int16

func (*NumberMethods) TestBit

func (nm *NumberMethods) TestBit(x, y any) bool

func (*NumberMethods) UncheckedAdd

func (nm *NumberMethods) UncheckedAdd(x, y any) any

func (*NumberMethods) UncheckedDec

func (nm *NumberMethods) UncheckedDec(x any) any

func (*NumberMethods) UncheckedIntDivide

func (nm *NumberMethods) UncheckedIntDivide(x, y int) any

func (*NumberMethods) Unchecked_inc

func (nm *NumberMethods) Unchecked_inc(v any) any

func (*NumberMethods) Unchecked_minus

func (nm *NumberMethods) Unchecked_minus(x, y any) any

func (*NumberMethods) Unchecked_multiply

func (nm *NumberMethods) Unchecked_multiply(x, y any) any

func (*NumberMethods) Unchecked_negate

func (nm *NumberMethods) Unchecked_negate(x any) any

func (*NumberMethods) UnsignedShiftRight

func (nm *NumberMethods) UnsignedShiftRight(x, y any) int64

type Object

type Object any

type Pair

type Pair struct {
	Key   any
	Value any
}

type PersistentHashMap

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

func (*PersistentHashMap) ApplyTo

func (m *PersistentHashMap) ApplyTo(args ISeq) any

func (*PersistentHashMap) Assoc

func (m *PersistentHashMap) Assoc(key, val any) Associative

func (*PersistentHashMap) AssocEx

func (m *PersistentHashMap) AssocEx(key, val any) IPersistentMap

func (*PersistentHashMap) Cons

func (m *PersistentHashMap) Cons(o any) Conser

func (*PersistentHashMap) ContainsKey

func (m *PersistentHashMap) ContainsKey(k any) bool

func (*PersistentHashMap) Count

func (m *PersistentHashMap) Count() int

func (*PersistentHashMap) Empty

func (*PersistentHashMap) EntryAt

func (m *PersistentHashMap) EntryAt(key any) IMapEntry

func (*PersistentHashMap) Equiv

func (m *PersistentHashMap) Equiv(o any) bool

func (*PersistentHashMap) HashEq

func (m *PersistentHashMap) HashEq() uint32

func (*PersistentHashMap) Invoke

func (m *PersistentHashMap) Invoke(args ...any) any

func (*PersistentHashMap) Meta

func (*PersistentHashMap) Reduce

func (m *PersistentHashMap) Reduce(f IFn) any

func (*PersistentHashMap) ReduceInit

func (m *PersistentHashMap) ReduceInit(f IFn, init any) any

func (*PersistentHashMap) Seq

func (m *PersistentHashMap) Seq() ISeq

func (*PersistentHashMap) String

func (m *PersistentHashMap) String() string

func (*PersistentHashMap) ValAt

func (m *PersistentHashMap) ValAt(key any) any

func (*PersistentHashMap) ValAtDefault

func (m *PersistentHashMap) ValAtDefault(key, notFound any) any

func (*PersistentHashMap) WithMeta

func (m *PersistentHashMap) WithMeta(meta IPersistentMap) any

func (*PersistentHashMap) Without

func (m *PersistentHashMap) Without(key any) IPersistentMap

type PersistentHashSet

type PersistentHashSet = Set // hack until we have a proper persistent hash set

type PersistentStructMap

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

func ConstructPersistentStructMap

func ConstructPersistentStructMap(def *PersistentStructMapDef, valseq ISeq) *PersistentStructMap

func (*PersistentStructMap) ApplyTo

func (m *PersistentStructMap) ApplyTo(args ISeq) any

func (*PersistentStructMap) Assoc

func (m *PersistentStructMap) Assoc(k any, v any) Associative

func (*PersistentStructMap) AssocEx

func (m *PersistentStructMap) AssocEx(k, v any) IPersistentMap

func (*PersistentStructMap) Cons

func (m *PersistentStructMap) Cons(x any) Conser

func (*PersistentStructMap) ContainsKey

func (m *PersistentStructMap) ContainsKey(k any) bool

func (*PersistentStructMap) Count

func (m *PersistentStructMap) Count() int

func (*PersistentStructMap) Empty

func (*PersistentStructMap) EntryAt

func (m *PersistentStructMap) EntryAt(k any) IMapEntry

func (*PersistentStructMap) Equiv

func (m *PersistentStructMap) Equiv(o any) bool

func (*PersistentStructMap) HashEq

func (m *PersistentStructMap) HashEq() uint32

func (*PersistentStructMap) Invoke

func (m *PersistentStructMap) Invoke(args ...any) any

func (*PersistentStructMap) Meta

func (*PersistentStructMap) Seq

func (m *PersistentStructMap) Seq() ISeq

func (*PersistentStructMap) ValAt

func (m *PersistentStructMap) ValAt(key any) any

func (*PersistentStructMap) ValAtDefault

func (m *PersistentStructMap) ValAtDefault(key, def any) any

func (*PersistentStructMap) WithMeta

func (m *PersistentStructMap) WithMeta(meta IPersistentMap) any

func (*PersistentStructMap) Without

func (m *PersistentStructMap) Without(k any) IPersistentMap

type PersistentStructMapDef

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

func CreatePersistentStructMapSlotMap

func CreatePersistentStructMapSlotMap(keys ISeq) *PersistentStructMapDef

type PersistentVector

type PersistentVector = Vector

Vector is a vector of values.

type Range

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

func (*Range) ChunkedFirst

func (r *Range) ChunkedFirst() IChunk

func (*Range) ChunkedMore

func (r *Range) ChunkedMore() ISeq

func (*Range) ChunkedNext

func (r *Range) ChunkedNext() ISeq

func (*Range) Cons

func (r *Range) Cons(val any) Conser

func (*Range) Count

func (r *Range) Count() int

func (*Range) Empty

func (r *Range) Empty() IPersistentCollection

func (*Range) Equals

func (r *Range) Equals(o any) bool

func (*Range) Equiv

func (r *Range) Equiv(o any) bool

func (*Range) First

func (r *Range) First() any

func (*Range) ForceChunk

func (r *Range) ForceChunk()

func (*Range) Hash

func (r *Range) Hash() uint32

func (*Range) HashEq

func (r *Range) HashEq() uint32

func (*Range) Meta

func (r *Range) Meta() IPersistentMap

func (*Range) More

func (r *Range) More() ISeq

func (*Range) Next

func (r *Range) Next() ISeq

func (*Range) Reduce

func (r *Range) Reduce(f IFn) any

func (*Range) ReduceInit

func (r *Range) ReduceInit(f IFn, init any) any

func (*Range) Seq

func (r *Range) Seq() ISeq

func (*Range) String

func (r *Range) String() string

func (*Range) WithMeta

func (r *Range) WithMeta(meta IPersistentMap) any

type Ratio

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

Ratio is a value that represents a ratio.

func AsRatio

func AsRatio(x any) *Ratio

func NewRatio

func NewRatio(numerator, denominator int64) *Ratio

NewRatio creates a new ratio value.

func NewRatioBigInt

func NewRatioBigInt(num, den *BigInt) *Ratio

func NewRatioGoBigInt

func NewRatioGoBigInt(num, den *big.Int) *Ratio

func (*Ratio) Abs

func (r *Ratio) Abs() *Ratio

func (*Ratio) Add

func (r *Ratio) Add(other *Ratio) any

func (*Ratio) BigIntegerValue

func (r *Ratio) BigIntegerValue() *big.Int

func (*Ratio) Cmp

func (r *Ratio) Cmp(other *Ratio) int

func (*Ratio) Denominator

func (r *Ratio) Denominator() *big.Int

func (*Ratio) Divide

func (r *Ratio) Divide(other *Ratio) any

func (*Ratio) Equals

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

func (*Ratio) GT

func (r *Ratio) GT(other *Ratio) bool

func (*Ratio) GTE

func (r *Ratio) GTE(other *Ratio) bool

func (*Ratio) LT

func (r *Ratio) LT(other *Ratio) bool

func (*Ratio) LTE

func (r *Ratio) LTE(other *Ratio) bool

func (*Ratio) Multiply

func (r *Ratio) Multiply(other *Ratio) any

func (*Ratio) Negate

func (r *Ratio) Negate() *Ratio

func (*Ratio) Numerator

func (r *Ratio) Numerator() *big.Int

func (*Ratio) Quotient

func (r *Ratio) Quotient(other *Ratio) any

func (*Ratio) String

func (r *Ratio) String() string

func (*Ratio) Sub

func (r *Ratio) Sub(other *Ratio) any

type RecurError

type RecurError struct {
	Target interface{}
	Args   []interface{}
}

RecurError is an error returned by a recur form.

func (*RecurError) Error

func (e *RecurError) Error() string

func (*RecurError) Is

func (e *RecurError) Is(err error) bool

Is returns true if the given error is a RecurError with the same target.

type RecurTarget

type RecurTarget struct {
}

func NewRecurTarget

func NewRecurTarget() *RecurTarget

type Reduced

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

func NewReduced

func NewReduced(v interface{}) *Reduced

func (*Reduced) Deref

func (r *Reduced) Deref() interface{}

type Ref

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

Ref is a reference to a value that can be updated transactionally.

func NewRef

func NewRef(val interface{}) *Ref

func (*Ref) Commute

func (r *Ref) Commute(fn IFn, args ISeq) interface{}

func (*Ref) Deref

func (r *Ref) Deref() interface{}

type RegexpMatcher

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

RegexpMatcher is a matcher that matches a string against a regular expression. It's a wrapper around standard library functions. We implement this to simplify a translation of clojure regexp core functions to go.

func NewRegexpMatcher

func NewRegexpMatcher(re *regexp.Regexp, s string) *RegexpMatcher

NewRegexpMatcher creates a new RegexpMatcher.

func (*RegexpMatcher) AppendReplacement

func (m *RegexpMatcher) AppendReplacement(sb io.Writer, replacement string) *RegexpMatcher

AppendReplacement implements a non-terminal append-and-replace step.

func (*RegexpMatcher) AppendTail

func (m *RegexpMatcher) AppendTail(sb io.Writer)

AppendTail implements a terminal append-and-replace step.

func (*RegexpMatcher) Find

func (m *RegexpMatcher) Find() bool

Find attempts to find the next subsequence of the input sequence that matches the pattern.

func (*RegexpMatcher) Group

func (m *RegexpMatcher) Group() string

Group returns the input subsequence matched by the previous match.

func (*RegexpMatcher) GroupCount

func (m *RegexpMatcher) GroupCount() int

GroupCount returns the number of capturing groups in this matcher's pattern.

func (*RegexpMatcher) GroupInt

func (m *RegexpMatcher) GroupInt(group int) any

GroupInt returns the input subsequence captured by the given group during the previous match operation.

func (*RegexpMatcher) Matches

func (m *RegexpMatcher) Matches() bool

Matches attempts to match the entire region against the pattern.

type Repeat

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

func NewRepeat

func NewRepeat(x interface{}) *Repeat

func (*Repeat) Cons

func (r *Repeat) Cons(val any) Conser

func (*Repeat) Count

func (r *Repeat) Count() int

func (*Repeat) Empty

func (r *Repeat) Empty() IPersistentCollection

func (*Repeat) Equals

func (r *Repeat) Equals(o any) bool

func (*Repeat) Equiv

func (r *Repeat) Equiv(o any) bool

func (*Repeat) First

func (r *Repeat) First() interface{}

func (*Repeat) Hash

func (r *Repeat) Hash() uint32

func (*Repeat) HashEq

func (r *Repeat) HashEq() uint32

func (*Repeat) Meta

func (r *Repeat) Meta() IPersistentMap

func (*Repeat) More

func (r *Repeat) More() ISeq

func (*Repeat) Next

func (r *Repeat) Next() ISeq

func (*Repeat) Reduce

func (r *Repeat) Reduce(f IFn) interface{}

func (*Repeat) ReduceInit

func (r *Repeat) ReduceInit(f IFn, start interface{}) interface{}

func (*Repeat) Seq

func (r *Repeat) Seq() ISeq

func (*Repeat) String

func (r *Repeat) String() string

func (*Repeat) WithMeta

func (r *Repeat) WithMeta(meta IPersistentMap) any

type Reversible

type Reversible interface {
	RSeq() ISeq
}

type Seqable

type Seqable interface {
	Seq() ISeq
}

type Sequential

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

type Set

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

Set represents a map of glojure values.

func NewSet

func NewSet(vals ...interface{}) *Set

func (*Set) ApplyTo

func (s *Set) ApplyTo(args ISeq) interface{}

func (*Set) AsTransient

func (s *Set) AsTransient() ITransientCollection

func (*Set) Cons

func (s *Set) Cons(v interface{}) Conser

func (*Set) Contains

func (s *Set) Contains(v interface{}) bool

func (*Set) Count

func (s *Set) Count() int

func (*Set) Disjoin

func (s *Set) Disjoin(v interface{}) IPersistentSet

func (*Set) Empty

func (s *Set) Empty() IPersistentCollection

func (*Set) Equals

func (s *Set) Equals(v2 interface{}) bool

func (*Set) Equiv

func (s *Set) Equiv(o any) bool

func (*Set) Get

func (s *Set) Get(key interface{}) interface{}

func (*Set) HashEq

func (s *Set) HashEq() uint32

func (*Set) Invoke

func (s *Set) Invoke(args ...interface{}) interface{}

func (*Set) IsEmpty

func (s *Set) IsEmpty() bool

func (*Set) Meta

func (s *Set) Meta() IPersistentMap

func (*Set) Seq

func (s *Set) Seq() ISeq

func (*Set) String

func (s *Set) String() string

func (*Set) WithMeta

func (s *Set) WithMeta(meta IPersistentMap) interface{}

type SliceChunk

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

func NewSliceChunk

func NewSliceChunk(slc []interface{}) *SliceChunk

func (*SliceChunk) Count

func (sc *SliceChunk) Count() int

func (*SliceChunk) DropFirst

func (sc *SliceChunk) DropFirst() IChunk

func (*SliceChunk) Nth

func (sc *SliceChunk) Nth(i int) interface{}

func (*SliceChunk) NthDefault

func (sc *SliceChunk) NthDefault(i int, def interface{}) interface{}

func (*SliceChunk) ReduceInit

func (sc *SliceChunk) ReduceInit(fn IFn, init interface{}) interface{}

type SliceSeq

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

SliceSeq is an implementation of ISeq for slices.

func (*SliceSeq) Cons

func (s *SliceSeq) Cons(o any) Conser

func (*SliceSeq) Count

func (s *SliceSeq) Count() int

func (*SliceSeq) Empty

func (s *SliceSeq) Empty() IPersistentCollection

func (*SliceSeq) Equals

func (s *SliceSeq) Equals(o any) bool

func (*SliceSeq) Equiv

func (s *SliceSeq) Equiv(o any) bool

func (*SliceSeq) First

func (s *SliceSeq) First() any

func (*SliceSeq) Hash

func (s *SliceSeq) Hash() uint32

func (*SliceSeq) HashEq

func (s *SliceSeq) HashEq() uint32

func (*SliceSeq) Meta

func (s *SliceSeq) Meta() IPersistentMap

func (*SliceSeq) More

func (s *SliceSeq) More() ISeq

func (*SliceSeq) Next

func (s *SliceSeq) Next() ISeq

func (*SliceSeq) Reduce

func (s *SliceSeq) Reduce(f IFn) any

func (*SliceSeq) ReduceInit

func (s *SliceSeq) ReduceInit(f IFn, start any) any

func (*SliceSeq) Seq

func (s *SliceSeq) Seq() ISeq

func (*SliceSeq) String

func (s *SliceSeq) String() string

func (*SliceSeq) WithMeta

func (s *SliceSeq) WithMeta(meta IPersistentMap) any

type StackFrame

type StackFrame struct {
	FunctionName string
	Filename     string
	Line         int
	Column       int
}

type Stacker

type Stacker interface {
	Stack() []StackFrame
}

Stacker is an interface for retrieving stack traces.

type StringSeq

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

func NewStringSeq

func NewStringSeq(s string, i int) *StringSeq

func (*StringSeq) Cons

func (s *StringSeq) Cons(o any) Conser

func (*StringSeq) Count

func (s *StringSeq) Count() int

func (*StringSeq) Drop

func (s *StringSeq) Drop(n int) Sequential

func (*StringSeq) Empty

func (s *StringSeq) Empty() IPersistentCollection

func (*StringSeq) Equals

func (s *StringSeq) Equals(o any) bool

func (*StringSeq) Equiv

func (s *StringSeq) Equiv(o any) bool

func (*StringSeq) First

func (s *StringSeq) First() any

func (*StringSeq) Hash

func (s *StringSeq) Hash() uint32

func (*StringSeq) HashEq

func (s *StringSeq) HashEq() uint32

func (*StringSeq) Index

func (s *StringSeq) Index() int

func (*StringSeq) Meta

func (s *StringSeq) Meta() IPersistentMap

func (*StringSeq) More

func (s *StringSeq) More() ISeq

func (*StringSeq) Next

func (s *StringSeq) Next() ISeq

func (*StringSeq) ReduceInit

func (s *StringSeq) ReduceInit(f IFn, init any) any

func (*StringSeq) Seq

func (s *StringSeq) Seq() ISeq

func (*StringSeq) String

func (s *StringSeq) String() string

func (*StringSeq) WithMeta

func (s *StringSeq) WithMeta(meta IPersistentMap) any

type SubVector

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

func NewSubVector

func NewSubVector(meta IPersistentMap, v IPersistentVector, start, end int) *SubVector

func (*SubVector) ApplyTo

func (v *SubVector) ApplyTo(args ISeq) any

func (*SubVector) Assoc

func (v *SubVector) Assoc(key, val interface{}) Associative

func (*SubVector) AssocN

func (v *SubVector) AssocN(i int, val interface{}) IPersistentVector

func (*SubVector) Cons

func (v *SubVector) Cons(val interface{}) Conser

func (*SubVector) ContainsKey

func (v *SubVector) ContainsKey(key interface{}) bool

func (*SubVector) Count

func (v *SubVector) Count() int

func (*SubVector) Empty

func (v *SubVector) Empty() IPersistentCollection

func (*SubVector) EntryAt

func (v *SubVector) EntryAt(key interface{}) IMapEntry

func (*SubVector) Equals

func (v *SubVector) Equals(v2 interface{}) bool

func (*SubVector) Equiv

func (v *SubVector) Equiv(v2 interface{}) bool

func (*SubVector) HashEq

func (v *SubVector) HashEq() uint32

func (*SubVector) Invoke

func (v *SubVector) Invoke(args ...any) any

func (*SubVector) IsEmpty

func (v *SubVector) IsEmpty() bool

func (*SubVector) Length

func (v *SubVector) Length() int

func (*SubVector) Meta

func (v *SubVector) Meta() IPersistentMap

func (*SubVector) Nth

func (v *SubVector) Nth(i int) interface{}

func (*SubVector) NthDefault

func (v *SubVector) NthDefault(i int, def interface{}) interface{}

func (*SubVector) Peek

func (v *SubVector) Peek() interface{}

func (*SubVector) Pop

func (v *SubVector) Pop() IPersistentStack

func (*SubVector) RSeq

func (v *SubVector) RSeq() ISeq

func (*SubVector) Seq

func (v *SubVector) Seq() ISeq

func (*SubVector) ValAt

func (v *SubVector) ValAt(i interface{}) interface{}

func (*SubVector) ValAtDefault

func (v *SubVector) ValAtDefault(k, def interface{}) interface{}

func (*SubVector) WithMeta

func (v *SubVector) WithMeta(meta IPersistentMap) interface{}

type Symbol

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

func InternSymbol

func InternSymbol(ns, name interface{}) *Symbol

func NewSymbol

func NewSymbol(s string) *Symbol

NewSymbol creates a new symbol.

func (*Symbol) Equals

func (s *Symbol) Equals(v interface{}) bool

func (*Symbol) FullName

func (s *Symbol) FullName() string

func (*Symbol) Hash

func (s *Symbol) Hash() uint32

func (*Symbol) Meta

func (s *Symbol) Meta() IPersistentMap

func (*Symbol) Name

func (s *Symbol) Name() string

func (*Symbol)