Documentation ¶
Overview ¶
Package tipe defines data structures representing Neugram types.
Go took the usual spelling of type.
Index ¶
- Variables
- func Equal(x, y Type) bool
- func EqualUnresolved(x, y Type) bool
- func IsNumeric(t Type) bool
- func IsUntypedNil(t Type) bool
- func UsesNum(t Type) bool
- type Alias
- type Array
- type Basic
- type Builtin
- type Chan
- type ChanDirection
- type Ellipsis
- type Func
- type Interface
- type Map
- type Memory
- type Named
- type Package
- type Pointer
- type Slice
- type Specialization
- type Struct
- type StructField
- type StructTag
- type Table
- type Tuple
- type Type
- type Unresolved
Constants ¶
This section is empty.
Variables ¶
Functions ¶
Types ¶
type Basic ¶
type Basic string
const ( Invalid Basic = "invalid" Num Basic = "num" // type parameter Bool Basic = "bool" Integer Basic = "integer" Float Basic = "float" Complex Basic = "cmplx" String Basic = "string" Int Basic = "int" Int8 Basic = "int8" Int16 Basic = "int16" Int32 Basic = "int32" Int64 Basic = "int64" Uint Basic = "uint" Uint8 Basic = "uint8" Uint16 Basic = "uint16" Uint32 Basic = "uint32" Uint64 Basic = "uint64" Uintptr Basic = "uintptr" Float32 Basic = "float32" Float64 Basic = "float64" Complex64 Basic = "complex64" Complex128 Basic = "complex128" UnsafePointer Basic = "unsafe pointer" UntypedNil Basic = "untyped nil" // nil pointer or nil interface UntypedString Basic = "untyped string" UntypedBool Basic = "untyped bool" UntypedInteger Basic = "untyped integer" UntypedFloat Basic = "untyped float" UntypedRune Basic = "untyped rune" UntypedComplex Basic = "untyped complex" )
type Builtin ¶
type Builtin string
const ( Append Builtin = "builtin append" Cap Builtin = "builtin cap" Close Builtin = "builtin close" ComplexFunc Builtin = "builtin complex" Copy Builtin = "builtin copy" Delete Builtin = "builtin delete" Imag Builtin = "builtin imag" Len Builtin = "builtin len" Make Builtin = "builtin make" New Builtin = "builtin new" Panic Builtin = "builtin panic" Real Builtin = "builtin real" Recover Builtin = "builtin recover" )
type Chan ¶
type Chan struct { Direction ChanDirection Elem Type }
type ChanDirection ¶
type ChanDirection int
const ( ChanBoth ChanDirection = iota ChanSend ChanRecv )
type Func ¶
type Interface ¶
type Memory ¶
type Memory struct {
// contains filtered or unexported fields
}
type Named ¶
type Named struct { // TODO: need to track the definition package so the evaluator can // extract the mscope from the right place. Is this the only // instance of needing the source package? What about debug printing? Spec Specialization Type Type PkgName string PkgPath string Name string MethodNames []string Methods []*Func }
Named is a named type. A named type is declared either using a type declaration:
type S struct{}
or the methodik declaration:
methodik S struct{} {}
As in Go, a named type has an underlying type. A named type can also have methods associated with it.
type Package ¶
type Specialization ¶
type Specialization struct { // Num is the specialization of the type parameter num in Num Basic }
Specialization carries any type specialization data particular to this type.
*Func, *Struct, *Named can be parameterized over the name num, which can take any of:
integer, int64, float, float32, float64, complex, complex128
At the defnition of a class or function, the matching Type will have the Num filed set to Invalid if it is not parameterized, or Num if it is.
On a value of a parameterized class or a Call of a parameterized function, Num will either Num or one of the basic numeric types (if specialized).
type Struct ¶
type Struct struct { Spec Specialization Fields []StructField }
type StructField ¶
StructField is a field of a Struct. It is not an ng type.
type Type ¶
type Type interface {
// contains filtered or unexported methods
}