Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( BasicBoolean = MakeBasic("boolean") BasicKeyword = MakeBasic("keyword") BasicProcedure = MakeBasic("procedure") BasicNull = MakeBasic("null") BasicNumber = MakeBasic("number") BasicString = MakeBasic("string") BasicSymbol = MakeBasic("symbol") BasicList = MakeBasic("list") BasicObject = MakeBasic("object") BasicCons = MakeBasic("cons") BasicVector = MakeBasic("vector") BasicUnion = MakeBasic("union") )
var BasicAny = &Any{ Basic: MakeBasic("any"), }
Functions ¶
Types ¶
type AcceptsWith ¶
type Applicable ¶
type Applicable struct {
// contains filtered or unexported fields
}
Applicable describes a Type that can be the target of a function application. Such application may expose multiple Signatures to describe the various ways that the type can be applied
func MakeApplicable ¶
func MakeApplicable(first Signature, rest ...Signature) *Applicable
MakeApplicable declares an ApplicableType that will only allow an applicable value capable of the provided signature set
func (*Applicable) Equal ¶
func (a *Applicable) Equal(other Type) bool
func (*Applicable) Name ¶
func (a *Applicable) Name() string
func (*Applicable) Signatures ¶
func (a *Applicable) Signatures() []Signature
type Checker ¶
type Checker struct {
// contains filtered or unexported fields
}
func (*Checker) AcceptsChild ¶
func (*Checker) AcceptsChildWith ¶
func (c *Checker) AcceptsChildWith(left, right Type, with AcceptsWith) bool
func (*Checker) AcceptsWith ¶
func (c *Checker) AcceptsWith(right Type, with AcceptsWith) bool
type Object ¶
type Object struct {
// contains filtered or unexported fields
}
Object describes a typed set of Key/Value Pairs
func MakeObject ¶
MakeObject declares a new ObjectType that will only allow keys and values of the provided types
type Pair ¶
type Pair struct {
// contains filtered or unexported fields
}
Pair describes a pair of typed Values
type Record ¶
type Record struct {
// contains filtered or unexported fields
}
Record describes an Object that allows a fixed set of fields, each of which has a keyword
func MakeRecord ¶
MakeRecord declares a new RecordType that only allows a fixed set of Field entries, each being identified by a BasicKeyword and having a specified Type
type Type ¶
type Type interface { // Name identifies this Type Name() string // Accepts determines if this Type will accept the provided Type for // binding. This will generally mean that the provided Type satisfies // the contract of the receiver. A Checker is provided to track the // state of the Type checking Accepts(*Checker, Type) bool // Equal determines if the provided Type is an equivalent definition Equal(Type) bool }
Type describes the type compatibility for a Value
func MakeCons ¶
MakeCons declares a new PairType that will only allow a MakeListOf with elements of the provided elem Type
func MakeListOf ¶
MakeListOf declares a new PairType that will only allow a BasicList with elements of the provided elem Type
func MakeTuple ¶
MakeTuple declares a new TupleType that will only allow a MakeListOf or MakeVectorOf with positional elements of the provided Types
func MakeUnion ¶
MakeUnion declares a *Union based on at least one provided Type. If any of the provided types is a types.Any, then types.Any will be returned
func MakeVectorOf ¶
MakeVectorOf declares a new VectorType that will only allow a BasicVector with elements of the provided elem Type