import "ds/any"
Package ds/any is for interfacing with Droscheme objects.
Bla Bluu
This type is used for Scheme environments.
This type represents Scheme procedures.
type Any interface{}
Any
type Env struct {
// contains filtered or unexported fields
}
func NewEnv() *Env
Make a new empty environment.
func (env *Env) Add(value Named)
Set value.Name()=value in current environment frame.
This is primarily intended for initialization purposes.
func (env *Env) AddProc(value Any, name string)
Set name=NewProc(value, name) in current environment frame.
This is primarily intended for initialization purposes.
func (env *Env) AddValue(value Any, name string)
Set name=value in current environment frame.
This is primarily intended for initialization purposes.
func (env *Env) Define(symbol, value Any)
Set symbol=value in the current environment frame.
The symbol parameter must be a string.
func (env *Env) Extend() *Env
Make a new environment whose parent is this environment.
func (env *Env) Ref(symbol Any) Any
Get the symbol from this or any parent environment.
The symbol parameter must be a string.
func (env *Env) Refer(symbol, value Any) Any
Get the symbol from this or any parent environment, with a devault value if not found.
The symbol parameter must be a string.
func (env *Env) Set(symbol, value Any)
Set symbol=value in the environment frame in which it is bound. If the symbol is not bound, then we throw an exception.
The symbol parameter must be a string.
func (env *Env) Update(child *Env) *Env
Make a new environment whose parent is this environment, where the environment frame is populated with bindings from the most recent environment frame associated with the child parameter.
type Evaler interface { Eval(env *Env) Any }
Evaler
type Named interface {
Name() string
Value() Any // of the type func(???)Any
}
This interface represents maplets in environments.
In order to lubricate the import and export between packages, this allows us to pass a single object to the environment which it can then query to find its name. After that, it may call Define() on the value.
type PrimProc struct {
// contains filtered or unexported fields
}
primitive procedure structure type
func NewProc(it Any, name string) *PrimProc
func (pc *PrimProc) Apply(as []Any) Any
func (pc *PrimProc) Name() string
func (pc *PrimProc) String() string
func (pc *PrimProc) Value() Any
type PrimSyntax struct {
// contains filtered or unexported fields
}
primitive syntax structure type
func NewSyntax(it Any, name string) *PrimSyntax
func (kw *PrimSyntax) IsSyntax() bool
func (kw *PrimSyntax) Name() string
func (kw *PrimSyntax) String() string
func (kw *PrimSyntax) Value() Any
type Proc interface { Apply(args []Any) Any }
Proc
type Syntax interface { Transform(env *Env, exp Any) Any }
Syntax
This interface represents macro transformers.
Name | Synopsis | |
---|---|---|
.. | ||
char | Package ds/any/char represents the Scheme library (ds any char). | |
env | ||
scheme-report-7 | ||
runtime | Package ds/any/runtime represents the Scheme library (ds any runtime). | |
syntax | Package ds/any/syntax represents the Scheme library (ds any syntax). |