gfoo

package
v0.0.0-...-718af6b Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2020 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Lt = Order(-1)
	Eq = Order(0)
	Gt = Order(1)
)
View Source
const (
	VersionMajor = 0
	VersionMinor = 24
)
View Source
const (
	MIN_LINE   = 1
	MIN_COLUMN = 0
)
View Source
const REGISTER_COUNT = 64

Variables

View Source
var Debug = false
View Source
var MinTime, MaxTime time.Time
View Source
var NilPos = NewPos("n/a")

Functions

func DumpString

func DumpString(in Dumper) string

func DumpVals

func DumpVals(in []Val, out io.Writer) error

func Error

func Error(pos Pos, spec string, args ...interface{}) error

func EvalOps

func EvalOps(ops []Op, thread *Thread, registers []Val, stack *Stack) error

func Init

func Init()

func IsId

func IsId(c rune) bool

func MinInt

func MinInt(x, y int) int

func NewError

func NewError(pos Pos, spec string, args ...interface{}) error

func SkipSpace

func SkipSpace(in *bufio.Reader, pos *Pos) error

func Unique

func Unique(prefix string) string

Types

type AbcModule

type AbcModule struct {
	Module
}

func (*AbcModule) Init

func (self *AbcModule) Init() *Module

type And

type And struct {
	OpBase
	// contains filtered or unexported fields
}

func NewAnd

func NewAnd(form Form, right []Op) *And

func (*And) Eval

func (self *And) Eval(thread *Thread, registers []Val, stack *Stack) error

type Arg

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

func AIndex

func AIndex(name string, index int) Arg

func AType

func AType(name string, valType Type) Arg

func AVal

func AVal(name string, val Val) Arg

func (*Arg) Dump

func (self *Arg) Dump(out io.Writer) error

func (*Arg) Match

func (self *Arg) Match(stack []Val, index int) bool

type Binding

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

func NewBinding

func NewBinding(scope *Scope, val Val) Binding

func (*Binding) Init

func (self *Binding) Init(scope *Scope, val Val)

type BoolType

type BoolType struct {
	ValTypeBase
}
var TBool BoolType

func (*BoolType) Bool

func (_ *BoolType) Bool(val Val) bool

func (*BoolType) Compare

func (_ *BoolType) Compare(x, y Val) Order

func (*BoolType) Dump

func (_ *BoolType) Dump(val Val, out io.Writer) error

func (*BoolType) Negate

func (_ *BoolType) Negate(val *Val)

func (*BoolType) New

func (_ *BoolType) New(name string, parents ...Type) ValType

func (*BoolType) Print

func (_ *BoolType) Print(val Val, out io.Writer) error

func (*BoolType) Unquote

func (self *BoolType) Unquote(val Val, scope *Scope, pos Pos) Form

type Branch

type Branch struct {
	OpBase
	// contains filtered or unexported fields
}

func NewBranch

func NewBranch(form Form, trueBody, falseBody []Op) *Branch

func (*Branch) Eval

func (self *Branch) Eval(thread *Thread, registers []Val, stack *Stack) error

type BreakType

type BreakType struct{}
var Break BreakType

func (*BreakType) Error

func (e *BreakType) Error() string

type Buffer

type Buffer = bytes.Buffer

type BufferType

type BufferType struct {
	ValTypeBase
}
var TBuffer BufferType

func (*BufferType) Bool

func (_ *BufferType) Bool(val Val) bool

func (*BufferType) Clone

func (self *BufferType) Clone(val Val) interface{}

func (*BufferType) Compare

func (_ *BufferType) Compare(x, y Val) Order

func (*BufferType) Dump

func (self *BufferType) Dump(val Val, out io.Writer) error

func (*BufferType) Iter

func (_ *BufferType) Iter(val Val, pos Pos) (Iter, error)

func (*BufferType) New

func (_ *BufferType) New(name string, parents ...Type) ValType

func (*BufferType) Print

func (_ *BufferType) Print(val Val, out io.Writer) error

func (*BufferType) Unquote

func (_ *BufferType) Unquote(val Val, scope *Scope, pos Pos) Form

type Byte

type Byte = uint8

type ByteType

type ByteType struct {
	ValTypeBase
}
var TByte ByteType

func (*ByteType) Bool

func (_ *ByteType) Bool(val Val) bool

func (*ByteType) Compare

func (_ *ByteType) Compare(x, y Val) Order

func (*ByteType) Dump

func (_ *ByteType) Dump(val Val, out io.Writer) error

func (*ByteType) Is

func (self *ByteType) Is(x, y Val) bool

func (*ByteType) Negate

func (self *ByteType) Negate(val *Val)

func (*ByteType) New

func (_ *ByteType) New(name string, parents ...Type) ValType

func (*ByteType) Print

func (self *ByteType) Print(val Val, out io.Writer) error

func (*ByteType) Unquote

func (self *ByteType) Unquote(val Val, scope *Scope, pos Pos) Form

type Call

type Call struct {
	OpBase
	// contains filtered or unexported fields
}

func NewCall

func NewCall(form Form, target *Val, args []Op) *Call

func (*Call) Eval

func (self *Call) Eval(thread *Thread, registers []Val, stack *Stack) error

type CallForm

type CallForm struct {
	FormBase
	// contains filtered or unexported fields
}

func NewCallForm

func NewCallForm(id *Id, args *Group, pos Pos) *CallForm

func (*CallForm) Compile

func (self *CallForm) Compile(in *Forms, out []Op, scope *Scope) ([]Op, error)

func (*CallForm) Do

func (self *CallForm) Do(action func(Form) error) error

func (*CallForm) Dump

func (self *CallForm) Dump(out io.Writer) error

func (*CallForm) Init

func (self *CallForm) Init(id *Id, args *Group, pos Pos) *CallForm

func (*CallForm) Quote

func (self *CallForm) Quote(in *Forms, scope *Scope, thread *Thread, registers []Val, pos Pos) (Val, error)

type CallType

type CallType struct {
	ValTypeBase
}
var TCall CallType

func (*CallType) Compare

func (_ *CallType) Compare(x, y Val) Order

func (*CallType) Dump

func (_ *CallType) Dump(val Val, out io.Writer) error

func (*CallType) New

func (_ *CallType) New(name string, parents ...Type) ValType

func (*CallType) Print

func (self *CallType) Print(val Val, out io.Writer) error

func (*CallType) Unquote

func (self *CallType) Unquote(val Val, scope *Scope, pos Pos) Form

type CharType

type CharType struct {
	ValTypeBase
}
var TChar CharType

func (*CharType) Bool

func (_ *CharType) Bool(val Val) bool

func (*CharType) Compare

func (_ *CharType) Compare(x, y Val) Order

func (*CharType) Dump

func (_ *CharType) Dump(val Val, out io.Writer) error

func (*CharType) Negate

func (self *CharType) Negate(val *Val)

func (*CharType) New

func (_ *CharType) New(name string, parents ...Type) ValType

func (*CharType) Print

func (_ *CharType) Print(val Val, out io.Writer) error

func (*CharType) Unquote

func (_ *CharType) Unquote(val Val, scope *Scope, pos Pos) Form

type Check

type Check struct {
	OpBase
	// contains filtered or unexported fields
}

func NewCheck

func NewCheck(form Form, cond Form, condOps []Op) *Check

func (*Check) Eval

func (self *Check) Eval(thread *Thread, registers []Val, stack *Stack) error

type Core

type Core struct {
	Scope
	Abc    AbcModule
	Data   DataModule
	String StringModule
	Time   TimeModule
	Zip    ZipModule
	Image  ImageModule
	Io     IoModule
	Iter   IterModule
	Math   MathModule
	Png    PngModule
}

func New

func New() *Core

type DataModule

type DataModule struct {
	Module
}

func (*DataModule) Init

func (self *DataModule) Init() *Module

type Drop

type Drop struct {
	OpBase
}

func NewDrop

func NewDrop(form Form) *Drop

func (*Drop) Eval

func (self *Drop) Eval(thread *Thread, registers []Val, stack *Stack) error

type Dumper

type Dumper interface {
	Dump(out io.Writer) error
}

type Dup

type Dup struct {
	OpBase
}

func NewDup

func NewDup(form Form) *Dup

func (*Dup) Eval

func (self *Dup) Eval(thread *Thread, registers []Val, stack *Stack) error

type For

type For struct {
	OpBase
	// contains filtered or unexported fields
}

func NewFor

func NewFor(form Form, id int, body []Op) *For

func (*For) Eval

func (self *For) Eval(thread *Thread, registers []Val, stack *Stack) error

type Form

type Form interface {
	Dumper
	Compile(in *Forms, out []Op, scope *Scope) ([]Op, error)
	Do(action func(Form) error) error
	Pos() Pos
	Quote(in *Forms, scope *Scope, thread *Thread, registers []Val, pos Pos) (Val, error)
}

type FormBase

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

func (*FormBase) Init

func (self *FormBase) Init(pos Pos)

func (*FormBase) Pos

func (self *FormBase) Pos() Pos

type Forms

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

func NewForms

func NewForms(items []Form) *Forms

func (*Forms) Init

func (self *Forms) Init(items []Form) *Forms

func (*Forms) Len

func (self *Forms) Len() int

func (*Forms) Peek

func (self *Forms) Peek() Form

func (*Forms) Pop

func (self *Forms) Pop() Form

func (*Forms) Push

func (self *Forms) Push(forms ...Form)

type Function

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

func NewFunction

func NewFunction(name string) *Function

func (*Function) AddMethod

func (self *Function) AddMethod(methods ...*Method)

func (*Function) Call

func (self *Function) Call(thread *Thread, stack *Stack, pos Pos) error

func (*Function) Init

func (self *Function) Init(name string) *Function

func (*Function) MethodName

func (self *Function) MethodName(args []Arg, rets []Ret) string

func (*Function) NewMethod

func (self *Function) NewMethod(args []Arg, rets []Ret, imp MethodImp) *Method

func (*Function) RemoveMethod

func (self *Function) RemoveMethod(method *Method)

type FunctionType

type FunctionType struct {
	ValTypeBase
}
var TFunction FunctionType

func (*FunctionType) Call

func (_ *FunctionType) Call(target Val, thread *Thread, stack *Stack, pos Pos) error

func (*FunctionType) Compare

func (_ *FunctionType) Compare(x, y Val) Order

func (*FunctionType) Dump

func (_ *FunctionType) Dump(val Val, out io.Writer) error

func (*FunctionType) New

func (_ *FunctionType) New(name string, parents ...Type) ValType

func (*FunctionType) Print

func (self *FunctionType) Print(val Val, out io.Writer) error

func (*FunctionType) Unquote

func (self *FunctionType) Unquote(val Val, scope *Scope, pos Pos) Form

type Get

type Get struct {
	OpBase
	// contains filtered or unexported fields
}

func NewGet

func NewGet(form Form, key string) *Get

func (*Get) Eval

func (self *Get) Eval(thread *Thread, registers []Val, stack *Stack) error

type Group

type Group struct {
	FormBase
	// contains filtered or unexported fields
}

func NewGroup

func NewGroup(body []Form, pos Pos) *Group

func (*Group) Compile

func (self *Group) Compile(in *Forms, out []Op, scope *Scope) ([]Op, error)

func (*Group) Do

func (self *Group) Do(action func(Form) error) error

func (*Group) Dump

func (self *Group) Dump(out io.Writer) error

func (*Group) Init

func (self *Group) Init(body []Form, pos Pos) *Group

func (*Group) Push

func (self *Group) Push(form Form)

func (*Group) Quote

func (self *Group) Quote(in *Forms, scope *Scope, thread *Thread, registers []Val, pos Pos) (Val, error)

type GroupType

type GroupType struct {
	ValTypeBase
}
var TGroup GroupType

func (*GroupType) Compare

func (_ *GroupType) Compare(x, y Val) Order

func (*GroupType) Dump

func (_ *GroupType) Dump(val Val, out io.Writer) error

func (*GroupType) New

func (_ *GroupType) New(name string, parents ...Type) ValType

func (*GroupType) Print

func (self *GroupType) Print(val Val, out io.Writer) error

func (*GroupType) Unquote

func (self *GroupType) Unquote(val Val, scope *Scope, pos Pos) Form

type Id

type Id struct {
	FormBase
	// contains filtered or unexported fields
}

func NewId

func NewId(name string, pos Pos) *Id

func (*Id) Compile

func (self *Id) Compile(in *Forms, out []Op, scope *Scope) ([]Op, error)

func (*Id) Do

func (self *Id) Do(action func(Form) error) error

func (*Id) Dump

func (self *Id) Dump(out io.Writer) error

func (*Id) Quote

func (self *Id) Quote(in *Forms, scope *Scope, thread *Thread, registers []Val, pos Pos) (Val, error)

type IdType

type IdType struct {
	StringType
}
var TId IdType

func (*IdType) Dump

func (_ *IdType) Dump(val Val, out io.Writer) error

func (*IdType) New

func (_ *IdType) New(name string, parents ...Type) ValType

func (*IdType) Unquote

func (_ *IdType) Unquote(val Val, scope *Scope, pos Pos) Form

type ImageModule

type ImageModule struct {
	Module
}

func (*ImageModule) Init

func (self *ImageModule) Init() *Module

type Int

type Int = int64

type IntType

type IntType struct {
	ValTypeBase
}
var TInt IntType

func (*IntType) Bool

func (_ *IntType) Bool(val Val) bool

func (*IntType) Compare

func (_ *IntType) Compare(x, y Val) Order

func (*IntType) Dump

func (_ *IntType) Dump(val Val, out io.Writer) error

func (*IntType) Is

func (self *IntType) Is(x, y Val) bool

func (*IntType) Iter

func (_ *IntType) Iter(val Val, pos Pos) (Iter, error)

func (*IntType) Negate

func (_ *IntType) Negate(val *Val)

func (*IntType) New

func (_ *IntType) New(name string, parents ...Type) ValType

func (*IntType) Print

func (self *IntType) Print(val Val, out io.Writer) error

func (*IntType) Unquote

func (self *IntType) Unquote(val Val, scope *Scope, pos Pos) Form

type IoModule

type IoModule struct {
	Module
	ARGS Stack
	IN   *bufio.Reader
	OUT  *bufio.Writer
}

func (*IoModule) Init

func (self *IoModule) Init() *Module

type Iter

type Iter func(thread *Thread, pos Pos) (Val, error)

func (Iter) For

func (self Iter) For(action func(val Val, thread *Thread, pos Pos) error, thread *Thread, pos Pos) error

type IterModule

type IterModule struct {
	Module
}

func (*IterModule) Init

func (self *IterModule) Init() *Module

type IterType

type IterType struct {
	ValTypeBase
}
var TIter IterType

func (*IterType) Compare

func (_ *IterType) Compare(x, y Val) Order

func (*IterType) Dump

func (self *IterType) Dump(val Val, out io.Writer) error

func (*IterType) Iter

func (_ *IterType) Iter(val Val, pos Pos) (Iter, error)

func (*IterType) New

func (_ *IterType) New(name string, parents ...Type) ValType

func (*IterType) Print

func (self *IterType) Print(val Val, out io.Writer) error

func (*IterType) Unquote

func (self *IterType) Unquote(val Val, scope *Scope, pos Pos) Form

type Lambda

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

func NewLambda

func NewLambda(argCount int, body []Op, registers []Val) *Lambda

func (*Lambda) Call

func (self *Lambda) Call(thread *Thread, stack *Stack, pos Pos) error

func (*Lambda) Init

func (self *Lambda) Init(argCount int, body []Op, registers []Val) *Lambda

type LambdaOp

type LambdaOp struct {
	OpBase
	// contains filtered or unexported fields
}

func NewLambdaOp

func NewLambdaOp(form Form, argCount int, body []Op) *LambdaOp

func (*LambdaOp) Eval

func (self *LambdaOp) Eval(thread *Thread, registers []Val, stack *Stack) error

type LambdaType

type LambdaType struct {
	ValTypeBase
}
var TLambda LambdaType

func (*LambdaType) Call

func (_ *LambdaType) Call(target Val, thread *Thread, stack *Stack, pos Pos) error

func (*LambdaType) Compare

func (_ *LambdaType) Compare(x, y Val) Order

func (*LambdaType) Dump

func (self *LambdaType) Dump(val Val, out io.Writer) error

func (*LambdaType) New

func (_ *LambdaType) New(name string, parents ...Type) ValType

func (*LambdaType) Print

func (self *LambdaType) Print(val Val, out io.Writer) error

func (*LambdaType) Unquote

func (self *LambdaType) Unquote(val Val, scope *Scope, pos Pos) Form

type Let

type Let struct {
	OpBase
	// contains filtered or unexported fields
}

func NewLet

func NewLet(form Form, key string, index int) *Let

func (*Let) Eval

func (self *Let) Eval(thread *Thread, registers []Val, stack *Stack) error

type Literal

type Literal struct {
	FormBase
	// contains filtered or unexported fields
}

func NewLiteral

func NewLiteral(val Val, pos Pos) *Literal

func (*Literal) Compile

func (self *Literal) Compile(in *Forms, out []Op, scope *Scope) ([]Op, error)

func (*Literal) Do

func (self *Literal) Do(action func(Form) error) error

func (*Literal) Dump

func (self *Literal) Dump(out io.Writer) error

func (*Literal) Quote

func (self *Literal) Quote(in *Forms, scope *Scope, thread *Thread, registers []Val, pos Pos) (Val, error)

type Load

type Load struct {
	OpBase
	// contains filtered or unexported fields
}

func NewLoad

func NewLoad(form Form, key string, index int) *Load

func (*Load) Eval

func (self *Load) Eval(thread *Thread, registers []Val, stack *Stack) error

type Macro

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

func NewMacro

func NewMacro(name string, argCount int, imp MacroImp) *Macro

func (*Macro) Expand

func (self *Macro) Expand(form Form, in *Forms, out []Op, scope *Scope) ([]Op, error)

type MacroImp

type MacroImp = func(form Form, in *Forms, out []Op, scope *Scope) ([]Op, error)

type MacroType

type MacroType struct {
	ValTypeBase
}
var TMacro MacroType

func (*MacroType) Compare

func (_ *MacroType) Compare(x, y Val) Order

func (*MacroType) Dump

func (_ *MacroType) Dump(val Val, out io.Writer) error

func (*MacroType) New

func (_ *MacroType) New(name string, parents ...Type) ValType

func (*MacroType) Print

func (self *MacroType) Print(val Val, out io.Writer) error

func (*MacroType) Unquote

func (self *MacroType) Unquote(val Val, scope *Scope, pos Pos) Form

type Map

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

func NewMap

func NewMap(form Form, id int, body []Op) *Map

func (*Map) Eval

func (self *Map) Eval(thread *Thread, registers []Val, stack *Stack) error

type MathModule

type MathModule struct {
	Module
}

func (*MathModule) Init

func (self *MathModule) Init() *Module

type MetaType

type MetaType struct {
	ValTypeBase
}
var TMeta MetaType

func (*MetaType) Compare

func (_ *MetaType) Compare(x, y Val) Order

func (*MetaType) Dump

func (_ *MetaType) Dump(val Val, out io.Writer) error

func (*MetaType) New

func (_ *MetaType) New(name string, parents ...Type) ValType

func (*MetaType) Print

func (self *MetaType) Print(val Val, out io.Writer) error

func (*MetaType) Unquote

func (self *MetaType) Unquote(val Val, scope *Scope, pos Pos) Form

type Method

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

func (*Method) Applicable

func (self *Method) Applicable(stack *Stack) bool

func (*Method) Call

func (self *Method) Call(thread *Thread, stack *Stack, pos Pos) error

func (*Method) Init

func (self *Method) Init(
	name string,
	args []Arg,
	rets []Ret,
	imp MethodImp) *Method

type MethodImp

type MethodImp = func(thread *Thread, registers []Val, stack *Stack, pos Pos) error

type MethodOp

type MethodOp struct {
	OpBase
	// contains filtered or unexported fields
}

func NewMethodOp

func NewMethodOp(form Form, method *Method) *MethodOp

func (*MethodOp) Eval

func (self *MethodOp) Eval(thread *Thread, registers []Val, stack *Stack) error

type MethodType

type MethodType struct {
	ValTypeBase
}
var TMethod MethodType

func (*MethodType) Call

func (_ *MethodType) Call(target Val, thread *Thread, stack *Stack, pos Pos) error

func (*MethodType) Compare

func (_ *MethodType) Compare(x, y Val) Order

func (*MethodType) Dump

func (_ *MethodType) Dump(val Val, out io.Writer) error

func (*MethodType) New

func (_ *MethodType) New(name string, parents ...Type) ValType

func (*MethodType) Print

func (self *MethodType) Print(val Val, out io.Writer) error

func (*MethodType) Unquote

func (self *MethodType) Unquote(val Val, scope *Scope, pos Pos) Form

type Module

type Module struct {
	Scope
}

func (*Module) Init

func (self *Module) Init()

type ModuleType

type ModuleType struct {
	ValTypeBase
}
var TModule ModuleType

func (*ModuleType) Compare

func (_ *ModuleType) Compare(x, y Val) Order

func (*ModuleType) Dump

func (self *ModuleType) Dump(val Val, out io.Writer) error

func (*ModuleType) Get

func (_ *ModuleType) Get(source Val, key string, pos Pos) (Val, error)

func (*ModuleType) Keys

func (_ *ModuleType) Keys(val Val) []string

func (*ModuleType) New

func (_ *ModuleType) New(name string, parents ...Type) ValType

func (*ModuleType) Print

func (self *ModuleType) Print(val Val, out io.Writer) error

func (*ModuleType) Unquote

func (_ *ModuleType) Unquote(val Val, scope *Scope, pos Pos) Form

type Negate

type Negate struct {
	OpBase
}

func NewNegate

func NewNegate(form Form) *Negate

func (*Negate) Eval

func (self *Negate) Eval(thread *Thread, registers []Val, stack *Stack) error

type NegateForm

type NegateForm struct {
	FormBase
	// contains filtered or unexported fields
}

func NewNegateForm

func NewNegateForm(form Form, pos Pos) *NegateForm

func (*NegateForm) Compile

func (self *NegateForm) Compile(in *Forms, out []Op, scope *Scope) ([]Op, error)

func (*NegateForm) Do

func (self *NegateForm) Do(action func(Form) error) error

func (*NegateForm) Dump

func (self *NegateForm) Dump(out io.Writer) error

func (*NegateForm) Init

func (self *NegateForm) Init(form Form, pos Pos) *NegateForm

func (*NegateForm) Quote

func (self *NegateForm) Quote(in *Forms, scope *Scope, thread *Thread, registers []Val, pos Pos) (Val, error)

type NilType

type NilType struct {
	ValTypeBase
}
var TNil NilType

func (*NilType) Bool

func (_ *NilType) Bool(val Val) bool

func (*NilType) Compare

func (_ *NilType) Compare(x, y Val) Order

func (*NilType) Dump

func (_ *NilType) Dump(val Val, out io.Writer) error

func (*NilType) Get

func (_ *NilType) Get(source Val, key string, pos Pos) (Val, error)

func (*NilType) Iter

func (_ *NilType) Iter(val Val, scope *Scope, pos Pos) (Iter, error)

func (*NilType) Negate

func (_ *NilType) Negate(val *Val)

func (*NilType) New

func (_ *NilType) New(name string, parents ...Type) ValType

func (*NilType) Print

func (self *NilType) Print(val Val, out io.Writer) error

func (*NilType) Unquote

func (self *NilType) Unquote(val Val, scope *Scope, pos Pos) Form

type Op

type Op interface {
	Eval(thread *Thread, registers []Val, stack *Stack) error
}

type OpBase

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

func (*OpBase) Init

func (self *OpBase) Init(form Form)

type Or

type Or struct {
	OpBase
	// contains filtered or unexported fields
}

func NewOr

func NewOr(form Form, right []Op) *Or

func (*Or) Eval

func (self *Or) Eval(thread *Thread, registers []Val, stack *Stack) error

type Order

type Order = int

func CompareByte

func CompareByte(x, y uint8) Order

func CompareInt

func CompareInt(x, y int) Order

func CompareInt64

func CompareInt64(x, y Int) Order

func ComparePointer

func ComparePointer(x, y unsafe.Pointer) Order

func CompareRune

func CompareRune(x, y rune) Order

func CompareString

func CompareString(x, y string) Order

func CompareVals

func CompareVals(x, y []Val) Order

type Pair

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

func NewPair

func NewPair(left, right Val) Pair

func (Pair) Compare

func (self Pair) Compare(other Pair) Order

func (Pair) Dump

func (self Pair) Dump(out io.Writer) error

func (Pair) Print

func (self Pair) Print(out io.Writer) error

type PairForm

type PairForm struct {
	FormBase
	// contains filtered or unexported fields
}

func NewPairForm

func NewPairForm(left, right Form, pos Pos) *PairForm

func (*PairForm) Compile

func (self *PairForm) Compile(in *Forms, out []Op, scope *Scope) ([]Op, error)

func (*PairForm) Do

func (self *PairForm) Do(action func(Form) error) error

func (*PairForm) Dump

func (self *PairForm) Dump(out io.Writer) error

func (*PairForm) Init

func (self *PairForm) Init(left, right Form, pos Pos) *PairForm

func (*PairForm) Quote

func (self *PairForm) Quote(in *Forms, scope *Scope, thread *Thread, registers []Val, pos Pos) (Val, error)

type PairOp

type PairOp struct {
	OpBase
	// contains filtered or unexported fields
}

func NewPairOp

func NewPairOp(form Form, left, right []Op) *PairOp

func (*PairOp) Eval

func (self *PairOp) Eval(thread *Thread, registers []Val, stack *Stack) error

type PairType

type PairType struct {
	ValTypeBase
}
var TPair PairType

func (*PairType) Compare

func (_ *PairType) Compare(x, y Val) Order

func (*PairType) Dump

func (_ *PairType) Dump(val Val, out io.Writer) error

func (*PairType) Negate

func (_ *PairType) Negate(val *Val)

func (*PairType) New

func (_ *PairType) New(name string, parents ...Type) ValType

func (*PairType) Print

func (_ *PairType) Print(val Val, out io.Writer) error

func (*PairType) Unquote

func (self *PairType) Unquote(val Val, scope *Scope, pos Pos) Form

type Pause

type Pause struct {
	OpBase
	// contains filtered or unexported fields
}

func NewPause

func NewPause(form Form, resultOps []Op) *Pause

func (*Pause) Eval

func (self *Pause) Eval(thread *Thread, registers []Val, stack *Stack) error

type PngModule

type PngModule struct {
	Module
}

func (*PngModule) Init

func (self *PngModule) Init() *Module

type Pos

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

func NewPos

func NewPos(source string) Pos

type Push

type Push struct {
	OpBase
	// contains filtered or unexported fields
}

func NewPush

func NewPush(form Form, val Val) *Push

func (*Push) Eval

func (self *Push) Eval(thread *Thread, registers []Val, stack *Stack) error

type Quote

type Quote struct {
	FormBase
	// contains filtered or unexported fields
}

func NewQuote

func NewQuote(form Form, pos Pos) *Quote

func (*Quote) Compile

func (self *Quote) Compile(in *Forms, out []Op, scope *Scope) ([]Op, error)

func (*Quote) Do

func (self *Quote) Do(action func(Form) error) error

func (*Quote) Dump

func (self *Quote) Dump(out io.Writer) error

func (*Quote) Init

func (self *Quote) Init(form Form, pos Pos) *Quote

func (*Quote) Quote

func (self *Quote) Quote(in *Forms, scope *Scope, thread *Thread, registers []Val, pos Pos) (Val, error)

type QuoteOp

type QuoteOp struct {
	OpBase
	// contains filtered or unexported fields
}

func NewQuoteOp

func NewQuoteOp(form Form, scope *Scope) *QuoteOp

func (*QuoteOp) Eval

func (self *QuoteOp) Eval(thread *Thread, registers []Val, stack *Stack) error

type QuoteType

type QuoteType struct {
	ValTypeBase
}
var TQuote QuoteType

func (*QuoteType) Bool

func (_ *QuoteType) Bool(val Val) bool

func (*QuoteType) Compare

func (_ *QuoteType) Compare(x, y Val) Order

func (*QuoteType) Dump

func (_ *QuoteType) Dump(val Val, out io.Writer) error

func (*QuoteType) Negate

func (_ *QuoteType) Negate(val *Val)

func (*QuoteType) New

func (_ *QuoteType) New(name string, parents ...Type) ValType

func (*QuoteType) Print

func (self *QuoteType) Print(val Val, out io.Writer) error

func (*QuoteType) Unquote

func (self *QuoteType) Unquote(val Val, scope *Scope, pos Pos) Form

type ReaderType

type ReaderType struct {
	ValTypeBase
}
var TReader ReaderType

func (*ReaderType) Compare

func (_ *ReaderType) Compare(x, y Val) Order

func (*ReaderType) Dump

func (self *ReaderType) Dump(val Val, out io.Writer) error

func (*ReaderType) New

func (_ *ReaderType) New(name string, parents ...Type) ValType

func (*ReaderType) Print

func (self *ReaderType) Print(val Val, out io.Writer) error

func (*ReaderType) Unquote

func (self *ReaderType) Unquote(val Val, scope *Scope, pos Pos) Form

type Record

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

func NewRecord

func NewRecord() *Record

func (*Record) Clone

func (self *Record) Clone() *Record

func (*Record) Compare

func (self *Record) Compare(other *Record) Order

func (*Record) Dump

func (self *Record) Dump(out io.Writer) error

func (*Record) Find

func (self *Record) Find(key string) (int, bool)

func (*Record) Get

func (self *Record) Get(key string, missingVal Val) Val

func (*Record) Insert

func (self *Record) Insert(i int, key string, val Val)

func (*Record) Len

func (self *Record) Len() int

func (*Record) Merge

func (self *Record) Merge(source *Record)

func (*Record) Set

func (self *Record) Set(key string, val Val)

type RecordField

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

type RecordOp

type RecordOp struct {
	OpBase
	// contains filtered or unexported fields
}

func NewRecordOp

func NewRecordOp(form Form, fields []Op) *RecordOp

func (*RecordOp) Eval

func (self *RecordOp) Eval(thread *Thread, registers []Val, stack *Stack) error

type RecordType

type RecordType struct {
	ValTypeBase
}
var TRecord RecordType

func (*RecordType) Clone

func (_ *RecordType) Clone(val Val) interface{}

func (*RecordType) Compare

func (_ *RecordType) Compare(x, y Val) Order

func (*RecordType) Dump

func (self *RecordType) Dump(val Val, out io.Writer) error

func (*RecordType) Get

func (_ *RecordType) Get(source Val, key string, pos Pos) (Val, error)

func (*RecordType) Iter

func (_ *RecordType) Iter(val Val, pos Pos) (Iter, error)

func (*RecordType) Negate

func (_ *RecordType) Negate(val *Val)

func (*RecordType) New

func (_ *RecordType) New(name string, parents ...Type) ValType

func (*RecordType) Print

func (self *RecordType) Print(val Val, out io.Writer) error

func (*RecordType) Unquote

func (_ *RecordType) Unquote(val Val, scope *Scope, pos Pos) Form

type Registers

type Registers = [REGISTER_COUNT]Val

type Ret

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

func RIndex

func RIndex(index int) Ret

func RType

func RType(valType Type) Ret

func RVal

func RVal(val Val) Ret

func (Ret) Dump

func (self Ret) Dump(out io.Writer) error

func (*Ret) Match

func (self *Ret) Match(in, out []Val, index int) bool

type Rgba

type Rgba = image.NRGBA

func NewRgba

func NewRgba(w, h int) *Rgba

type RgbaType

type RgbaType struct {
	ValTypeBase
}
var TRgba RgbaType

func (*RgbaType) Compare

func (_ *RgbaType) Compare(x, y Val) Order

func (*RgbaType) Dump

func (self *RgbaType) Dump(val Val, out io.Writer) error

func (*RgbaType) New

func (_ *RgbaType) New(name string, parents ...Type) ValType

func (*RgbaType) Print

func (self *RgbaType) Print(val Val, out io.Writer) error

func (*RgbaType) Unquote

func (self *RgbaType) Unquote(val Val, scope *Scope, pos Pos) Form

type Scope

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

func NewScope

func NewScope(parent *Scope) *Scope

func (*Scope) AddFunction

func (self *Scope) AddFunction(name string) *Function

func (*Scope) AddMacro

func (self *Scope) AddMacro(name string, argCount int, imp MacroImp)

func (*Scope) AddMethod

func (self *Scope) AddMethod(name string, args []Arg, rets []Ret, imp MethodImp) *Method

func (*Scope) AddModule

func (self *Scope) AddModule(name string, module *Module)

func (*Scope) AddType

func (self *Scope) AddType(val Type)

func (*Scope) AddVal

func (self *Scope) AddVal(name string, dataType ValType, data interface{})

func (*Scope) Compile

func (self *Scope) Compile(in []Form, out []Op) ([]Op, error)

func (*Scope) Eval

func (self *Scope) Eval(source string, thread *Thread, registers []Val, stack *Stack) error

func (*Scope) EvalForm

func (self *Scope) EvalForm(in *Forms, stack *Stack) error

func (*Scope) Extend

func (self *Scope) Extend(source *Scope) *Scope

func (*Scope) Get

func (self *Scope) Get(key string) *Binding

func (*Scope) Include

func (self *Scope) Include(filePath string, action func([]Form) error) error

func (*Scope) Init

func (self *Scope) Init(parent *Scope) *Scope

func (*Scope) Let

func (self *Scope) Let(key string, pos Pos) (int, error)

func (*Scope) Load

func (self *Scope) Load(filePath string, stack *Stack) error

func (*Scope) Parse

func (self *Scope) Parse(in *bufio.Reader, out []Form, pos *Pos) ([]Form, error)

func (*Scope) ParseBody

func (self *Scope) ParseBody(
	in *bufio.Reader,
	end rune,
	create func([]Form, Pos) Form,
	depth int,
	pos *Pos) (Form, error)

func (*Scope) ParseChar

func (self *Scope) ParseChar(in *bufio.Reader, pos *Pos) (Form, error)

func (*Scope) ParseForm

func (self *Scope) ParseForm(in *bufio.Reader, pos *Pos) (Form, error)

func (*Scope) ParseGroup

func (self *Scope) ParseGroup(in *bufio.Reader, pos *Pos) (Form, error)

func (*Scope) ParseId

func (self *Scope) ParseId(in *bufio.Reader, c rune, pos *Pos) (Form, error)

func (*Scope) ParseNegate

func (self *Scope) ParseNegate(in *bufio.Reader, pos *Pos) (Form, error)

func (*Scope) ParseNumber

func (self *Scope) ParseNumber(in *bufio.Reader, c rune, pos *Pos) (Form, error)

func (*Scope) ParsePair

func (self *Scope) ParsePair(in *bufio.Reader, pos *Pos) (Form, error)

func (*Scope) ParseQuote

func (self *Scope) ParseQuote(in *bufio.Reader, pos *Pos) (Form, error)

func (*Scope) ParseScope

func (self *Scope) ParseScope(in *bufio.Reader, pos *Pos) (Form, error)

func (*Scope) ParseStack

func (self *Scope) ParseStack(in *bufio.Reader, pos *Pos) (Form, error)

func (*Scope) ParseString

func (self *Scope) ParseString(in *bufio.Reader, pos *Pos) (Form, error)

func (*Scope) ParseUnquote

func (self *Scope) ParseUnquote(in *bufio.Reader, pos *Pos) (Form, error)

func (*Scope) Set

func (self *Scope) Set(key string, val Val)

func (*Scope) Unique

func (self *Scope) Unique(key string) string

func (*Scope) Use

func (self *Scope) Use(source Val, names []string, pos Pos) error

type ScopeForm

type ScopeForm struct {
	FormBase
	// contains filtered or unexported fields
}

func NewScopeForm

func NewScopeForm(body []Form, pos Pos) *ScopeForm

func (*ScopeForm) Compile

func (self *ScopeForm) Compile(in *Forms, out []Op, scope *Scope) ([]Op, error)

func (*ScopeForm) Do

func (self *ScopeForm) Do(action func(Form) error) error

func (*ScopeForm) Dump

func (self *ScopeForm) Dump(out io.Writer) error

func (*ScopeForm) Init

func (self *ScopeForm) Init(body []Form, pos Pos) *ScopeForm

func (*ScopeForm) Quote

func (self *ScopeForm) Quote(in *Forms, scope *Scope, thread *Thread, registers []Val, pos Pos) (Val, error)

type ScopeOp

type ScopeOp struct {
	OpBase
	// contains filtered or unexported fields
}

func NewScopeOp

func NewScopeOp(form Form, body []Op, scope *Scope) *ScopeOp

func (*ScopeOp) Eval

func (self *ScopeOp) Eval(thread *Thread, registers []Val, stack *Stack) error

type ScopeType

type ScopeType struct {
	ValTypeBase
}
var TScope ScopeType

func (*ScopeType) Compare

func (_ *ScopeType) Compare(x, y Val) Order

func (*ScopeType) Dump

func (_ *ScopeType) Dump(val Val, out io.Writer) error

func (*ScopeType) New

func (_ *ScopeType) New(name string, parents ...Type) ValType

func (*ScopeType) Print

func (self *ScopeType) Print(val Val, out io.Writer) error

func (*ScopeType) Unquote

func (self *ScopeType) Unquote(val Val, scope *Scope, pos Pos) Form

type SequenceType

type SequenceType interface {
	ValType
	Iter(val Val, pos Pos) (Iter, error)
}

type Stack

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

func NewStack

func NewStack(items []Val) *Stack

func (*Stack) Clear

func (self *Stack) Clear()

func (*Stack) Clone

func (self *Stack) Clone() *Stack

func (Stack) Compare

func (self Stack) Compare(other Stack) Order

func (Stack) Dump

func (self Stack) Dump(out io.Writer) error

func (*Stack) Init

func (self *Stack) Init(items []Val) *Stack

func (Stack) Len

func (self Stack) Len() int

func (Stack) Peek

func (self Stack) Peek() *Val

func (*Stack) Pop

func (self *Stack) Pop() *Val

func (*Stack) PopFront

func (self *Stack) PopFront() *Val

func (Stack) Print

func (self Stack) Print(out io.Writer) error

func (*Stack) Push

func (self *Stack) Push(vals ...Val)

func (*Stack) Reset

func (self *Stack) Reset()

func (*Stack) String

func (self *Stack) String() string

func (*Stack) Unquote

func (self *Stack) Unquote(scope *Scope, pos Pos) Form

type StackForm

type StackForm struct {
	FormBase
	// contains filtered or unexported fields
}

func NewStackForm

func NewStackForm(body []Form, pos Pos) *StackForm

func (*StackForm) Compile

func (self *StackForm) Compile(in *Forms, out []Op, scope *Scope) ([]Op, error)

func (*StackForm) Do

func (self *StackForm) Do(action func(Form) error) error

func (*StackForm) Dump

func (self *StackForm) Dump(out io.Writer) error

func (*StackForm) Init

func (self *StackForm) Init(body []Form, pos Pos) *StackForm

func (*StackForm) Quote

func (self *StackForm) Quote(in *Forms, scope *Scope, thread *Thread, registers []Val, pos Pos) (Val, error)

type StackOp

type StackOp struct {
	OpBase
	// contains filtered or unexported fields
}

func NewStackOp

func NewStackOp(form Form, body []Op) *StackOp

func (*StackOp) Eval

func (self *StackOp) Eval(thread *Thread, registers []Val, stack *Stack) error

type StackType

type StackType struct {
	ValTypeBase
}
var TStack StackType

func (*StackType) Bool

func (_ *StackType) Bool(val Val) bool

func (*StackType) Clone

func (self *StackType) Clone(val Val) interface{}

func (*StackType) Compare

func (_ *StackType) Compare(x, y Val) Order

func (*StackType) Dump

func (_ *StackType) Dump(val Val, out io.Writer) error

func (*StackType) Iter

func (_ *StackType) Iter(val Val, pos Pos) (Iter, error)

func (*StackType) Negate

func (_ *StackType) Negate(val *Val)

func (*StackType) New

func (_ *StackType) New(name string, parents ...Type) ValType

func (*StackType) Print

func (_ *StackType) Print(val Val, out io.Writer) error

func (*StackType) Unquote

func (_ *StackType) Unquote(val Val, scope *Scope, pos Pos) Form

type StringModule

type StringModule struct {
	Module
}

func (*StringModule) Init

func (self *StringModule) Init() *Module

type StringType

type StringType struct {
	ValTypeBase
}
var TString StringType

func (*StringType) Bool

func (_ *StringType) Bool(val Val) bool

func (*StringType) Compare

func (_ *StringType) Compare(x, y Val) Order

func (*StringType) Dump

func (_ *StringType) Dump(val Val, out io.Writer) error

func (*StringType) Iter

func (_ *StringType) Iter(val Val, pos Pos) (Iter, error)

func (*StringType) Negate

func (self *StringType) Negate(val *Val)

func (*StringType) New

func (_ *StringType) New(name string, parents ...Type) ValType

func (*StringType) Print

func (_ *StringType) Print(val Val, out io.Writer) error

func (*StringType) Unquote

func (self *StringType) Unquote(val Val, scope *Scope, pos Pos) Form

type TargetType

type TargetType interface {
	ValType
	Call(target Val, thread *Thread, stack *Stack, pos Pos) error
}

type Thread

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

func NewThread

func NewThread(body []Op) *Thread

func (*Thread) Pause

func (self *Thread) Pause(result []Val)

func (*Thread) Start

func (self *Thread) Start()

func (*Thread) Wait

func (self *Thread) Wait(stack *Stack, pos Pos) error

type ThreadOp

type ThreadOp struct {
	OpBase
	// contains filtered or unexported fields
}

func NewThreadOp

func NewThreadOp(form Form, args []Op, body []Op) *ThreadOp

func (*ThreadOp) Eval

func (self *ThreadOp) Eval(thread *Thread, registers []Val, stack *Stack) error

type ThreadType

type ThreadType struct {
	ValTypeBase
}
var TThread ThreadType

func (*ThreadType) Compare

func (_ *ThreadType) Compare(x, y Val) Order

func (*ThreadType) Dump

func (self *ThreadType) Dump(val Val, out io.Writer) error

func (*ThreadType) New

func (_ *ThreadType) New(name string, parents ...Type) ValType

func (*ThreadType) Print

func (self *ThreadType) Print(val Val, out io.Writer) error

func (*ThreadType) Unquote

func (self *ThreadType) Unquote(val Val, scope *Scope, pos Pos) Form

type TimeDelta

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

func Days

func Days(n int) TimeDelta

func (TimeDelta) Compare

func (self TimeDelta) Compare(other TimeDelta) Order

func (TimeDelta) Dump

func (self TimeDelta) Dump(out io.Writer) error

type TimeDeltaType

type TimeDeltaType struct {
	ValTypeBase
}
var TTimeDelta TimeDeltaType

func (*TimeDeltaType) Bool

func (_ *TimeDeltaType) Bool(val Val) bool

func (*TimeDeltaType) Compare

func (_ *TimeDeltaType) Compare(x, y Val) Order

func (*TimeDeltaType) Dump

func (_ *TimeDeltaType) Dump(val Val, out io.Writer) error

func (*TimeDeltaType) Negate

func (self *TimeDeltaType) Negate(val *Val)

func (*TimeDeltaType) New

func (_ *TimeDeltaType) New(name string, parents ...Type) ValType

func (*TimeDeltaType) Print

func (self *TimeDeltaType) Print(val Val, out io.Writer) error

func (*TimeDeltaType) Unquote

func (_ *TimeDeltaType) Unquote(val Val, scope *Scope, pos Pos) Form

type TimeModule

type TimeModule struct {
	Module
}

func (*TimeModule) Init

func (self *TimeModule) Init() *Module

type TimeType

type TimeType struct {
	ValTypeBase
}
var TTime TimeType

func (*TimeType) Bool

func (_ *TimeType) Bool(val Val) bool

func (*TimeType) Compare

func (_ *TimeType) Compare(x, y Val) Order

func (*TimeType) Dump

func (_ *TimeType) Dump(val Val, out io.Writer) error

func (*TimeType) Negate

func (self *TimeType) Negate(val *Val)

func (*TimeType) New

func (_ *TimeType) New(name string, parents ...Type) ValType

func (*TimeType) Print

func (self *TimeType) Print(val Val, out io.Writer) error

func (*TimeType) Unquote

func (self *TimeType) Unquote(val Val, scope *Scope, pos Pos) Form

type Times

type Times struct {
	OpBase
	// contains filtered or unexported fields
}

func NewTimes

func NewTimes(form Form, body []Op) *Times

func (*Times) Eval

func (self *Times) Eval(thread *Thread, registers []Val, stack *Stack) error

type Trait

type Trait struct {
	TypeBase
}
var TAny, TNumber, TOption, TSequence Trait

func NewTrait

func NewTrait(name string, parents ...Type) *Trait

func (*Trait) Bool

func (_ *Trait) Bool(val Val) bool

func (*Trait) Call

func (_ *Trait) Call(target Val, scope *Scope, stack *Stack, pos Pos) error

func (*Trait) Clone

func (self *Trait) Clone(val Val) interface{}

func (*Trait) Compare

func (self *Trait) Compare(x, y Val) Order

func (*Trait) Dump

func (self *Trait) Dump(val Val, out io.Writer) error

func (*Trait) Init

func (self *Trait) Init(name string, parents ...Type) *Trait

func (*Trait) Unquote

func (self *Trait) Unquote(val Val, scope *Scope, pos Pos) Form

type Type

type Type interface {
	DirectParents() []Type
	Isa(other Type) Type
	Name() string
	String() string
}

func NewType

func NewType(name string, parents ...Type) Type

func Option

func Option(in Type) Type

type TypeBase

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

func (*TypeBase) Derive

func (self *TypeBase) Derive(parent Type)

func (*TypeBase) DirectParents

func (self *TypeBase) DirectParents() []Type

func (*TypeBase) Init

func (self *TypeBase) Init(name string, parents []Type) *TypeBase

func (*TypeBase) Isa

func (self *TypeBase) Isa(other Type) Type

func (*TypeBase) Name

func (self *TypeBase) Name() string

func (*TypeBase) String

func (self *TypeBase) String() string

type UnionType

type UnionType struct {
	Trait
	// contains filtered or unexported fields
}

func Union

func Union(name string, types ...Type) *UnionType

func (*UnionType) Init

func (self *UnionType) Init(name string, types ...Type) *UnionType

type Unquote

type Unquote struct {
	FormBase
	// contains filtered or unexported fields
}

func NewUnquote

func NewUnquote(form Form, pos Pos) *Unquote

func (*Unquote) Compile

func (self *Unquote) Compile(in *Forms, out []Op, scope *Scope) ([]Op, error)

func (*Unquote) Do

func (self *Unquote) Do(action func(Form) error) error

func (*Unquote) Dump

func (self *Unquote) Dump(out io.Writer) error

func (*Unquote) Init

func (self *Unquote) Init(form Form, pos Pos) *Unquote

func (*Unquote) Quote

func (self *Unquote) Quote(in *Forms, scope *Scope, thread *Thread, registers []Val, pos Pos) (Val, error)

type Val

type Val struct {
	// contains filtered or unexported fields
}
var Nil, Undefined Val

func NewRegisters

func NewRegisters() []Val

func NewVal

func NewVal(dataType ValType, data interface{}) Val

func (Val) Bool

func (self Val) Bool() bool

func (Val) Call

func (self Val) Call(thread *Thread, stack *Stack, pos Pos) error

func (Val) Clone

func (self Val) Clone() Val

func (Val) Compare

func (self Val) Compare(other Val) Order

func (Val) Dump

func (self Val) Dump(out io.Writer) error

func (Val) Get

func (self Val) Get(key string, pos Pos) (Val, error)

func (*Val) Init

func (self *Val) Init(dataType ValType, data interface{})

func (Val) Is

func (self Val) Is(other Val) bool

func (Val) Iter

func (self Val) Iter(pos Pos) (Iter, error)

func (Val) Keys

func (self Val) Keys() []string

func (Val) Literal

func (self Val) Literal(pos Pos) *Literal

func (*Val) Negate

func (self *Val) Negate()

func (Val) Print

func (self Val) Print(out io.Writer) error

func (Val) Unquote

func (self Val) Unquote(scope *Scope, pos Pos) Form

type ValType

type ValType interface {
	Type
	Bool(val Val) bool
	Clone(val Val) interface{}
	Compare(x, y Val) Order
	Dump(val Val, out io.Writer) error
	Get(source Val, key string, pos Pos) (Val, error)
	Print(val Val, out io.Writer) error
	Is(x, y Val) bool
	Keys(val Val) []string
	Negate(val *Val)
	New(name string, parents ...Type) ValType
	Unquote(val Val, scope *Scope, pos Pos) Form
}

type ValTypeBase

type ValTypeBase struct {
	TypeBase
}

func (*ValTypeBase) Bool

func (_ *ValTypeBase) Bool(val Val) bool

func (*ValTypeBase) Clone

func (_ *ValTypeBase) Clone(val Val) interface{}

func (*ValTypeBase) Get

func (self *ValTypeBase) Get(source Val, key string, pos Pos) (Val, error)

func (*ValTypeBase) Init

func (self *ValTypeBase) Init(name string, parents ...Type)

func (*ValTypeBase) Is

func (_ *ValTypeBase) Is(x, y Val) bool

func (*ValTypeBase) Keys

func (_ *ValTypeBase) Keys(val Val) []string

func (*ValTypeBase) Name

func (self *ValTypeBase) Name() string

func (*ValTypeBase) Negate

func (_ *ValTypeBase) Negate(val *Val)

type WriterType

type WriterType struct {
	ValTypeBase
}
var TWriter WriterType

func (*WriterType) Compare

func (_ *WriterType) Compare(x, y Val) Order

func (*WriterType) Dump

func (self *WriterType) Dump(val Val, out io.Writer) error

func (*WriterType) New

func (_ *WriterType) New(name string, parents ...Type) ValType

func (*WriterType) Print

func (self *WriterType) Print(val Val, out io.Writer) error

func (*WriterType) Unquote

func (self *WriterType) Unquote(val Val, scope *Scope, pos Pos) Form

type ZipModule

type ZipModule struct {
	Module
}

func (*ZipModule) Init

func (self *ZipModule) Init() *Module

type ZipWriterType

type ZipWriterType struct {
	ValTypeBase
}
var TZipWriter ZipWriterType

func (*ZipWriterType) Compare

func (_ *ZipWriterType) Compare(x, y Val) Order

func (*ZipWriterType) Dump

func (self *ZipWriterType) Dump(val Val, out io.Writer) error

func (*ZipWriterType) New

func (_ *ZipWriterType) New(name string, parents ...Type) ValType

func (*ZipWriterType) Print

func (self *ZipWriterType) Print(val Val, out io.Writer) error

func (*ZipWriterType) Unquote

func (self *ZipWriterType) Unquote(val Val, scope *Scope, pos Pos) Form

Jump to

Keyboard shortcuts

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