Documentation ¶
Index ¶
- Constants
- Variables
- func AddEllDirectory(dirname string)
- func AsByteValue(obj Value) (byte, error)
- func AsFloat64Value(obj Value) (float64, error)
- func AsInt64Value(obj Value) (int64, error)
- func AsIntValue(obj Value) (int, error)
- func AsList(obj Value) *List
- func AsStringValue(obj Value) (string, error)
- func Caar(lst Value) Value
- func Cadar(lst Value) Value
- func Cadddr(lst Value) Value
- func Caddr(lst Value) Value
- func Cadr(lst Value) Value
- func Car(v Value) Value
- func Cdar(lst Value) *List
- func Cddddr(lst Value) *List
- func Cdddr(lst Value) *List
- func Cddr(lst Value) *List
- func Cdr(v Value) *List
- func ChannelValue(obj Value) chan Value
- func Cleanup()
- func CloseChannel(obj Value)
- func CompileFile(name string) (Value, error)
- func Concat(seq1 *List, seq2 *List) (*List, error)
- func CurrentTimestamp(t time.Time) Value
- func DefineFunction(name string, fun PrimitiveFunction, result Value, args ...Value)
- func DefineFunctionKeyArgs(name string, fun PrimitiveFunction, result Value, args []Value, ...)
- func DefineFunctionOptionalArgs(name string, fun PrimitiveFunction, result Value, args []Value, ...)
- func DefineFunctionRestArgs(name string, fun PrimitiveFunction, result Value, rest Value, args ...Value)
- func DefineGlobal(name string, obj Value)
- func DefineMacro(name string, fun PrimitiveFunction)
- func Eval(expr Value) (Value, error)
- func ExpandFilePath(path string) string
- func Fatal(args ...interface{})
- func FindModuleByName(moduleName string) (string, error)
- func FindModuleFile(name string) (string, error)
- func Flatten(lst *List) *List
- func Float64Value(obj Value) float64
- func Get(obj Value, key Value) (Value, error)
- func GetGlobal(sym Value) Value
- func GetKeywords() []Value
- func GetMacro(sym Value) *macro
- func Globals() []*Symbol
- func Has(obj Value, key Value) (bool, error)
- func Identical(o1 Value, o2 Value) bool
- func Init(extns ...Extension)
- func InitPrimitives()
- func Int(n int64) *Number
- func Int64Value(obj Value) int64
- func IntValue(obj Value) int
- func IsDefined(sym *Symbol) bool
- func IsDirectoryReadable(path string) bool
- func IsFileReadable(path string) bool
- func IsFloat(obj Value) bool
- func IsFunction(v Value) bool
- func IsInt(obj Value) bool
- func IsList(obj Value) bool
- func IsNumber(val Value) bool
- func IsStruct(obj Value) bool
- func IsSymbol(obj Value) bool
- func IsVector(obj Value) bool
- func Json(val Value, indent string) (string, error)
- func ListEqual(l1 Value, l2 Value) bool
- func ListLength(o Value) int
- func Load(name string) error
- func LoadFile(file string) error
- func Macroexpand(expr Value) (Value, error)
- func Macros() []Value
- func Main(extns ...Extension)
- func MakeList(count int, val Value) *List
- func NamedChar(name string) (rune, error)
- func NewConnection(con net.Conn, endpoint string) Value
- func NewMacro(name Value, expander *Function) *macro
- func NewSymbol(names []Value) (Value, error)
- func Now() float64
- func Pretty(val Value) string
- func Print(args ...interface{})
- func Println(args ...interface{})
- func Put(obj Value, key Value, val Value) error
- func Random(min float64, max float64) *Number
- func RandomList(size int, min float64, max float64) *List
- func RandomSeed(n int64)
- func ReadAllFromString(s string) (*List, error)
- func ReadEvalPrintLoop()
- func ReadFromString(s string) (Value, error)
- func Reverse(lst *List) *List
- func Round(f float64) float64
- func Run(args ...string)
- func RuneValue(obj Value) rune
- func SetFlags(o bool, v bool, d bool, t bool, i bool)
- func Sleep(delayInSeconds float64)
- func SlurpFile(path string) (string, error)
- func SpitFile(path string, data string) error
- func StringCharacters(s *String) []Value
- func StringJoin(seq Value, delims Value) (*String, error)
- func StringRef(s *String, idx int) Value
- func StringSplit(obj Value, delims Value) (*List, error)
- func StringToList(s *String) *List
- func StringToVector(s *String) *Vector
- func StringValue(obj Value) string
- func StructEqual(s1 *Struct, s2 *Struct) bool
- func StructKeys(s Value) Value
- func StructLength(strct *Struct) int
- func StructToList(s *Struct) (*List, error)
- func StructToVector(s *Struct) *Vector
- func StructValues(s Value) Value
- func SymbolName(obj Value) string
- func ToCharacter(c Value) (*Character, error)
- func ToInt(o Value) (*Number, error)
- func ToList(obj Value) (*List, error)
- func ToNumber(o Value) (*Number, error)
- func ToString(a Value) (*String, error)
- func ToStruct(obj Value) (Value, error)
- func ToVector(obj Value) (*Vector, error)
- func TypeNameString(tval Value) string
- func Unkeyworded(symOrKeyword Value) (Value, error)
- func Unput(obj Value, key Value) error
- func Use(sym *Symbol) error
- func VM(stackSize int) *vm
- func Write(val Value) string
- func WriteAll(lst *List) string
- func WriteAllIndent(lst *List, indent string) string
- func WriteIndent(val Value, indent string) string
- type Blob
- type Channel
- type Code
- type Connection
- type Continuation
- type EllReaderExtension
- type EllWriterExtension
- type Extension
- type Frame
- type Function
- type Primitive
- type PrimitiveFunction
Constants ¶
const MaxFrameSize = 1000000
MaxFrameSize is an arbitrary limit to the tcp server framesize, to avoid trouble
Variables ¶
var Apply = &Function{}
Apply is a primitive instruction to apply a function to a list of arguments
var BlobType Value = Intern("<blob>")
var CallCC = &Function{}
CallCC is a primitive instruction to executable (restore) a continuation
var CallSymbol = Intern("call")
var ChannelType Value = Intern("<channel>")
ChannelType - the type of Ell's channel object
var ClosureSymbol = Intern("closure")
var CodeType Value = Intern("<code>")
var ConnectionType = Intern("<connection>")
var DefglobalSymbol = Intern("defglobal")
var DefmacroSymbol = Intern("defmacro")
var EmptyBlob = MakeBlob(0)
EmptyBlob - a blob with no bytes
var FuncSymbol = Intern("func")
var FunctionType Value = Intern("<function>")
var GenfnsSymbol = Intern("*genfns*")
var GlobalSymbol = Intern("global")
var HTTPErrorKey = Intern("http-error:")
var InterruptKey = Intern("interrupt:")
var JumpSymbol = Intern("jump")
var JumpfalseSymbol = Intern("jumpfalse")
var LiteralSymbol = Intern("literal")
var LocalSymbol = Intern("local")
var MacroErrorKey = Intern("macro-error:")
var MethodsKeyword = Intern("methods:")
var MinusOne = Integer(-1)
MinusOne is the Ell -1 value
var One = Integer(1)
One is the Ell 1 value
var PopSymbol = Intern("pop")
var QuasiquoteSymbol = Intern("quasiquote")
var QuoteSymbol = Intern("quote")
var ReturnSymbol = Intern("return")
var SetlocalSymbol = Intern("setlocal")
var Spawn = &Function{}
Apply is a primitive instruction to apply a function to a list of arguments
var StructSymbol = Intern("struct")
var TailcallSymbol = Intern("tailcall")
var UndefineSymbol = Intern("undefine")
var UnquoteSymbol = Intern("unquote")
var UnquoteSymbolSplicing = Intern("unquote-splicing")
var UseSymbol = Intern("use")
var VectorSymbol = Intern("vector")
var Version = "(development version)"
Version - this version of ell
var Zero = Integer(0)
Zero is the Ell 0 value
Functions ¶
func AddEllDirectory ¶
func AddEllDirectory(dirname string)
func AsByteValue ¶
func AsFloat64Value ¶
func AsInt64Value ¶
func AsIntValue ¶
func AsStringValue ¶
AsStringValue - return the native string representation of the object, if possible
func Cadddr ¶
func Cadddr(lst Value) Value
Cadddr - return the Car of the Cdr of the Cdr of the Cdr of the list
func Cddddr ¶
func Cddddr(lst Value) *List
Cddddr - return the Cdr of the Cdr of the Cdr of the Cdr of the list
func ChannelValue ¶
func ChannelValue(obj Value) chan Value
ChannelValue - return the Go channel object for the Ell channel
func CompileFile ¶
caveats: when you compile a file, you actually run it. This is so we can handle imports and macros correctly.
func CurrentTimestamp ¶ added in v1.0.5
func DefineFunction ¶
func DefineFunction(name string, fun PrimitiveFunction, result Value, args ...Value)
Register a primitive function to the specified global name
func DefineFunctionKeyArgs ¶
func DefineFunctionKeyArgs(name string, fun PrimitiveFunction, result Value, args []Value, defaults []Value, keys []Value)
Register a primitive function with keyword arguments to the specified global name
func DefineFunctionOptionalArgs ¶
func DefineFunctionOptionalArgs(name string, fun PrimitiveFunction, result Value, args []Value, defaults ...Value)
Register a primitive function with optional arguments to the specified global name
func DefineFunctionRestArgs ¶
func DefineFunctionRestArgs(name string, fun PrimitiveFunction, result Value, rest Value, args ...Value)
Register a primitive function with Rest arguments to the specified global name
func DefineMacro ¶
func DefineMacro(name string, fun PrimitiveFunction)
Register a primitive macro with the specified name.
func ExpandFilePath ¶
func FindModuleByName ¶
func FindModuleFile ¶
func Float64Value ¶
func Float64Value(obj Value) float64
Float64Value - return native float64 value of the object
func Get ¶
func Get(obj Value, key Value) (Value, error)
Get - return the value for the key of the object. The Value() function is first called to handle typed instances of <struct>. This is called by the VM, when a keyword is used as a function.
func GetGlobal ¶
func GetGlobal(sym Value) Value
GetGlobal - return the global value for the specified symbol, or nil if the symbol is not defined.
func GetKeywords ¶
func GetKeywords() []Value
GetKeywords - return a slice of Ell primitive reserved words
func GetMacro ¶
func GetMacro(sym Value) *macro
GetMacro - return the macro for the symbol, or nil if not defined
func Identical ¶
func Identical(o1 Value, o2 Value) bool
Identical - return if two objects are identical
func InitPrimitives ¶
func InitPrimitives()
InitEnvironment - defines the global functions/variables/macros for the top level environment
func Int64Value ¶
func Int64Value(obj Value) int64
Int64Value - return native int64 value of the object
func IsDefined ¶
func IsDefined(sym *Symbol) bool
IsDefined - return true if the there is a global value defined for the symbol
func IsDirectoryReadable ¶
IsDirectoryReadable - return true of the directory is readable
func IsFileReadable ¶
IsFileReadable - return true of the file is readable
func IsFunction ¶
func IsFunction(v Value) bool
func ListEqual ¶
func ListEqual(l1 Value, l2 Value) bool
ListEqual returns true if the object is equal to the argument
func ListLength ¶
func ListLength(o Value) int
func Macroexpand ¶
func Macroexpand(expr Value) (Value, error)
Macroexpand - return the expansion of all macros in the object and return the result
func NewConnection ¶ added in v1.0.4
func NewMacro ¶ added in v1.0.4
func NewMacro(name Value, expander *Function) *macro
Macro - create a new Macro
func RandomList ¶
func RandomSeed ¶
func RandomSeed(n int64)
func ReadAllFromString ¶ added in v1.0.4
func ReadEvalPrintLoop ¶
func ReadEvalPrintLoop()
func ReadFromString ¶ added in v1.0.4
func StringCharacters ¶
func StringCharacters(s *String) []Value
StringCharacters - return a slice of <character> objects that represent the string
func StringJoin ¶
func StringJoin(seq Value, delims Value) (*String, error)
func StringRef ¶
func StringRef(s *String, idx int) Value
StringRef - return the <character> object at the specified string index
func StringSplit ¶
func StringSplit(obj Value, delims Value) (*List, error)
func StringToList ¶ added in v1.0.4
func StringToList(s *String) *List
func StringToVector ¶ added in v1.0.4
func StringToVector(s *String) *Vector
func StringValue ¶
func StringValue(obj Value) string
StringValue - return native string value of the object
func StructEqual ¶
func StructEqual(s1 *Struct, s2 *Struct) bool
Equal returns true if the object is equal to the argument
func StructKeys ¶
func StructKeys(s Value) Value
func StructLength ¶
func StructLength(strct *Struct) int
StructLength - return the length (field count) of the <struct> object
func StructToList ¶ added in v1.0.4
func StructToList(s *Struct) (*List, error)
func StructToVector ¶ added in v1.0.4
func StructToVector(s *Struct) *Vector
func StructValues ¶
func StructValues(s Value) Value
func SymbolName ¶ added in v1.0.4
func SymbolName(obj Value) string
func ToCharacter ¶
func ToCharacter(c Value) (*Character, error)
ToCharacter - convert object to a <character> object, if possible
func ToInt ¶
func ToInt(o Value) (*Number, error)
ToInt - convert the object to an integer number, if possible
func ToList ¶
func ToList(obj Value) (*List, error)
ToList - convert the argument to a List, if possible
func ToNumber ¶
func ToNumber(o Value) (*Number, error)
ToNumber - convert object to a number, if possible
func ToString ¶
func ToString(a Value) (*String, error)
ToString - convert the object to a string, if possible
func ToVector ¶
func ToVector(obj Value) (*Vector, error)
ToVector - convert the object to a <vector>, if possible
func TypeNameString ¶ added in v1.0.4
func TypeNameString(tval Value) string
func Unkeyworded ¶ added in v1.0.4
func Unkeyworded(symOrKeyword Value) (Value, error)
func WriteAllIndent ¶ added in v1.0.4
func WriteIndent ¶ added in v1.0.4
Types ¶
type Blob ¶
type Blob struct {
Value []byte
}
func MakeBlob ¶
MakeBlob - create a new blob of the given size. It will be initialized to all zeroes
func NewBlob ¶ added in v1.0.4
Blob - create a new blob, using the specified byte slice as the data. The data is not copied.
type Channel ¶
type Channel struct {
// contains filtered or unexported fields
}
func NewChannel ¶ added in v1.0.4
Channel - create a new channel with the given buffer size and name
type Code ¶
type Code struct {
// contains filtered or unexported fields
}
Code - compiled Ell bytecode
type Connection ¶
func (*Connection) Equals ¶ added in v1.0.4
func (c *Connection) Equals(another Value) bool
func (*Connection) String ¶ added in v1.0.4
func (c *Connection) String() string
func (*Connection) Type ¶ added in v1.0.4
func (c *Connection) Type() Value
type Continuation ¶
type Continuation struct {
// contains filtered or unexported fields
}
Continuation -
type EllReaderExtension ¶ added in v1.0.4
type EllReaderExtension struct {
// contains filtered or unexported fields
}
func (*EllReaderExtension) HandleChar ¶ added in v1.0.4
func (ext *EllReaderExtension) HandleChar(c byte) (Value, error, bool)
func (*EllReaderExtension) HandleReaderMacro ¶ added in v1.0.4
func (ext *EllReaderExtension) HandleReaderMacro(c byte) (Value, error, bool)
type EllWriterExtension ¶ added in v1.0.4
type EllWriterExtension struct {
// contains filtered or unexported fields
}
func (*EllWriterExtension) HandleValue ¶ added in v1.0.4
func (ext *EllWriterExtension) HandleValue(val Value) (string, error, bool)
type Function ¶ added in v1.0.4
type Function struct {
// contains filtered or unexported fields
}
func NewContinuation ¶ added in v1.0.4
func NewPrimitive ¶ added in v1.0.4
func NewPrimitive(name string, fun PrimitiveFunction, result Value, args []Value, rest Value, defaults []Value, keys []Value) *Function
type Primitive ¶
type Primitive struct {
// contains filtered or unexported fields
}
Primitive - a primitive function, written in Go, callable by VM
type PrimitiveFunction ¶
type PrimitiveFunction func(argv []Value) (Value, error)
PrimitiveFunction is the native go function signature for all Ell primitive functions