core

package
v0.0.0-...-1ec79b4 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2023 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const Any = Symbol("core.Any")

Variables

This section is empty.

Functions

func Contains

func Contains[E Value](collection Value, value E) bool

func Eq

func Eq[E Value](a, b E) bool

Types

type Bool

type Bool bool
const (
	True  Bool = true
	False Bool = false
)

func (Bool) As

func (b Bool) As() bool

func (Bool) Eq

func (b Bool) Eq(other Bool) bool

func (Bool) GoString

func (b Bool) GoString() string

func (Bool) MarshalText

func (b Bool) MarshalText() ([]byte, error)

func (Bool) String

func (b Bool) String() string

func (Bool) Type

func (b Bool) Type() Value

func (*Bool) UnmarshalText

func (b *Bool) UnmarshalText(data []byte) error

type Chan

type Chan[E Value] struct {
	// contains filtered or unexported fields
}

func NewChan

func NewChan[E Value](size int) *Chan[E]

func NewChanOf

func NewChanOf[E Value](values ...E) *Chan[E]

func (*Chan[E]) Close

func (ch *Chan[E]) Close()

func (*Chan[E]) Empty

func (ch *Chan[E]) Empty() bool

func (*Chan[E]) First

func (ch *Chan[E]) First() (E, bool)

func (*Chan[E]) GoString

func (ch *Chan[E]) GoString() string

func (*Chan[E]) Len

func (ch *Chan[E]) Len() int

func (*Chan[E]) Next

func (ch *Chan[E]) Next() Seq[E]

func (*Chan[E]) Push

func (ch *Chan[E]) Push(value E)

func (*Chan[E]) Seq

func (ch *Chan[E]) Seq() Seq[E]

func (*Chan[E]) String

func (ch *Chan[E]) String() string

type Collection

type Collection[E Value] interface {
	Len() int
	Seq() Seq[E]
}

type Float

type Float float64

func (Float) As

func (f Float) As() float64

func (Float) Eq

func (f Float) Eq(other Float) bool

func (Float) GoString

func (f Float) GoString() string

func (Float) MarshalText

func (f Float) MarshalText() ([]byte, error)

func (Float) String

func (f Float) String() string

func (Float) Type

func (Float) Type() Value

func (*Float) UnmarshalText

func (f *Float) UnmarshalText(data []byte) error

type HashMap

type HashMap[K Hashable, V Value] map[K]V

func (HashMap[K, V]) Clear

func (m HashMap[K, V]) Clear()

func (HashMap[K, V]) Contains

func (m HashMap[K, V]) Contains(key K) bool

func (HashMap[K, V]) Eq

func (m HashMap[K, V]) Eq(other HashMap[K, V]) bool

func (HashMap[K, V]) Get

func (m HashMap[K, V]) Get(key K) (V, bool)

func (HashMap[K, V]) Keys

func (m HashMap[K, V]) Keys() *List[K]

func (HashMap[K, V]) Len

func (m HashMap[K, V]) Len() int

func (HashMap[K, V]) MarshalText

func (m HashMap[K, V]) MarshalText() ([]byte, error)

func (HashMap[K, V]) Put

func (m HashMap[K, V]) Put(key K, value V)

func (HashMap[K, V]) Remove

func (m HashMap[K, V]) Remove(key K)

func (HashMap[K, V]) Seq

func (m HashMap[K, V]) Seq() Seq[*List[Value]]

func (HashMap[K, V]) String

func (m HashMap[K, V]) String() string

func (HashMap[K, V]) Type

func (HashMap[K, V]) Type() Value

func (HashMap[K, V]) Values

func (m HashMap[K, V]) Values() *List[V]

type Hashable

type Hashable interface {
	Value
	comparable
}

type Int

type Int int

func (Int) As

func (i Int) As() int

func (Int) Eq

func (i Int) Eq(other Int) bool

func (Int) GoString

func (i Int) GoString() string

func (Int) MarshalText

func (i Int) MarshalText() ([]byte, error)

func (Int) String

func (i Int) String() string

func (Int) Type

func (Int) Type() Value

func (*Int) UnmarshalText

func (i *Int) UnmarshalText(data []byte) error

type Keyword

type Keyword string

Keyword is a string that starts with a colon. Examples:

:foo
:bar?
:baz_123

It resolves to itself, so you can use it as a map key.

func (Keyword) Eq

func (keyword Keyword) Eq(other Keyword) bool

func (Keyword) GoString

func (keyword Keyword) GoString() string

func (Keyword) MarshalText

func (keyword Keyword) MarshalText() ([]byte, error)

func (Keyword) Name

func (keyword Keyword) Name() string

func (Keyword) String

func (keyword Keyword) String() string

func (Keyword) Type

func (keyword Keyword) Type() Value

func (*Keyword) UnmarshalText

func (keyword *Keyword) UnmarshalText(bb []byte) error

type List

type List[E Value] struct {
	// contains filtered or unexported fields
}

func ListNew

func ListNew[E Value](values ...E) *List[E]

func (*List[E]) Conj

func (l *List[E]) Conj(values ...E) *List[E]

func (*List[E]) Contains

func (list *List[E]) Contains(value E) bool

func (*List[E]) Empty

func (l *List[E]) Empty() bool

func (*List[E]) Eq

func (l *List[E]) Eq(other *List[E]) bool

func (*List[E]) First

func (l *List[E]) First() (E, bool)

func (*List[E]) Len

func (l *List[E]) Len() int

func (List[E]) MarshalText

func (list List[E]) MarshalText() ([]byte, error)

func (*List[E]) Next

func (l *List[E]) Next() Seq[E]

func (*List[E]) Seq

func (list *List[E]) Seq() Seq[E]

func (List[E]) String

func (list List[E]) String() string

func (*List[E]) Type

func (*List[E]) Type() Value

type Seq

type Seq[E Value] interface {
	Empty() bool
	First() (E, bool)
	Next() Seq[E]
}

type String

type String string

func (String) As

func (s String) As() string

func (String) Eq

func (s String) Eq(other String) bool

func (String) GoString

func (s String) GoString() string

func (String) MarshalText

func (s String) MarshalText() ([]byte, error)

func (String) String

func (s String) String() string

func (String) Type

func (String) Type() Value

func (*String) UnmarshalText

func (s *String) UnmarshalText(data []byte) error

type Symbol

type Symbol string

Symbol is a string that resolves to a value. It can be used as a map key if quoted.

func Type

func Type(value Value) Symbol

func (Symbol) Eq

func (symbol Symbol) Eq(other Symbol) bool

func (Symbol) GoString

func (symbol Symbol) GoString() string

func (Symbol) MarshalText

func (symbol Symbol) MarshalText() ([]byte, error)

func (Symbol) Name

func (symbol Symbol) Name() string

func (Symbol) String

func (symbol Symbol) String() string

func (Symbol) Type

func (symbol Symbol) Type() Value

func (*Symbol) UnmarshalText

func (symbol *Symbol) UnmarshalText(bb []byte) error

type Value

type Value interface {
	String() string
	Type() Value

	encoding.TextMarshaler
}

type ValueEq

type ValueEq[E Value] interface {
	Value
	Eq(E) bool
}

Jump to

Keyboard shortcuts

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