sexp

package
v0.0.0-...-e8da0a6 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CheckArgsValueType = CheckValueType(argsValue)
View Source
var ErrorBablyFormattedArguments = fmt.Errorf("badly formatted arguments")
View Source
var ErrorEmptyArgument = fmt.Errorf("empty argument")
View Source
var ErrorUnsupportedType = fmt.Errorf("unsupported type")
View Source
var False = Value{symbolValue, "false"}
View Source
var Nil = Value{nilValue, nil}
View Source
var True = Value{symbolValue, "true"}

Functions

func CheckValueType

func CheckValueType(a valueType) func(b valueType) bool

func ErrorArgumentFormat

func ErrorArgumentFormat(v interface{}) string

Types

type Builtin

type Builtin struct{}

func (Builtin) And

func (Builtin) And(vars ...Value) (Value, error)

func (Builtin) Between

func (Builtin) Between(vars ...Value) (Value, error)

func (Builtin) Equal

func (Builtin) Equal(vars ...Value) (Value, error)

func (Builtin) GreaterThan

func (Builtin) GreaterThan(vars ...Value) (Value, error)

func (Builtin) GreaterThanOrEqual

func (Builtin) GreaterThanOrEqual(vars ...Value) (Value, error)

func (Builtin) In

func (Builtin) In(vars ...Value) (Value, error)

func (Builtin) IsNull

func (Builtin) IsNull(vars ...Value) (Value, error)

func (Builtin) LessThan

func (Builtin) LessThan(vars ...Value) (Value, error)

func (Builtin) LessThanOrEqual

func (Builtin) LessThanOrEqual(vars ...Value) (Value, error)

func (Builtin) Like

func (Builtin) Like(vars ...Value) (Value, error)

func (Builtin) Not

func (Builtin) Not(vars ...Value) (Value, error)

func (Builtin) Or

func (Builtin) Or(vars ...Value) (Value, error)

type Cons

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

func (Cons) Eval

func (c Cons) Eval() (val Value, err error)

func (Cons) Execute

func (cons Cons) Execute() (Value, error)

func (Cons) Len

func (c Cons) Len() int

func (Cons) List

func (c Cons) List() bool

func (Cons) Map

func (c Cons) Map(f func(v Value) (Value, error)) ([]Value, error)

func (Cons) String

func (c Cons) String() string

func (Cons) Stringify

func (c Cons) Stringify() []string

func (Cons) Vector

func (c Cons) Vector() Vector

type Env

type Env map[string]Value

type Pattern

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

type Proc

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

func (Proc) Call

func (p Proc) Call(params Vector) (val Value, err error)

func (Proc) String

func (p Proc) String() string

type Scope

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

func NewScope

func NewScope() *Scope

func (*Scope) AddEnv

func (s *Scope) AddEnv() *Env

func (*Scope) Create

func (s *Scope) Create(key string, value Value) Value

func (*Scope) DropEnv

func (s *Scope) DropEnv() *Env

func (*Scope) Dup

func (s *Scope) Dup() *Scope

func (*Scope) Env

func (s *Scope) Env() *Env

func (*Scope) Get

func (s *Scope) Get(key string) (val Value, ok bool)

func (*Scope) Set

func (s *Scope) Set(key string, value Value) Value

type Token

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

func (Token) String

func (t Token) String() string

type Tokens

type Tokens []*Token

func NewTokens

func NewTokens(program string) (tokens Tokens)

func (Tokens) Expand

func (tokens Tokens) Expand() (result Tokens, err error)

Expand until there are no more expansions to do

func (Tokens) Parse

func (tokens Tokens) Parse() (cons Cons, err error)

type TypeMap

type TypeMap = map[string]interface{}

func Map

func Map(a string, b interface{}) TypeMap

Map

type TypeSlice

type TypeSlice = []interface{}

func Slice

func Slice(e interface{}, es ...interface{}) TypeSlice

Slice

type Value

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

func EvalString

func EvalString(line string) (Value, error)

func NewArgsValue

func NewArgsValue(v interface{}) Value

NewArgsValue

func (Value) Cons

func (v Value) Cons() Cons

func (Value) Eval

func (v Value) Eval() (Value, error)

func (Value) Inspect

func (v Value) Inspect() string

func (Value) Number

func (v Value) Number() float64

func (Value) String

func (v Value) String() string

func (Value) Val

func (v Value) Val() interface{}

type Vector

type Vector []Value

func (Vector) Inspect

func (s Vector) Inspect() string

func (Vector) String

func (s Vector) String() string

Jump to

Keyboard shortcuts

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