Package ds_any

import "ds/any"
Overview
Index
Subdirectories

Overview

Package ds/any is for interfacing with Droscheme objects.

Bla Bluu

Environments

This type is used for Scheme environments.

Procedures

This type represents Scheme procedures.

Index

type Any
type Env
    func NewEnv() *Env
    func (env *Env) Add(value Named)
    func (env *Env) AddProc(value Any, name string)
    func (env *Env) AddValue(value Any, name string)
    func (env *Env) Define(symbol, value Any)
    func (env *Env) Extend() *Env
    func (env *Env) Ref(symbol Any) Any
    func (env *Env) Refer(symbol, value Any) Any
    func (env *Env) Set(symbol, value Any)
    func (env *Env) Update(child *Env) *Env
type Evaler
type Named
type PrimProc
    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
    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
type Syntax

Package files

any.go doc.go env.go prim.go

type Any

type Any interface{}

Any

type Env

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

func NewEnv

func NewEnv() *Env

Make a new empty environment.

func (*Env) Add

func (env *Env) Add(value Named)

Set value.Name()=value in current environment frame.

This is primarily intended for initialization purposes.

func (*Env) AddProc

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) AddValue

func (env *Env) AddValue(value Any, name string)

Set name=value in current environment frame.

This is primarily intended for initialization purposes.

func (*Env) Define

func (env *Env) Define(symbol, value Any)

Set symbol=value in the current environment frame.

The symbol parameter must be a string.

func (*Env) Extend

func (env *Env) Extend() *Env

Make a new environment whose parent is this environment.

func (*Env) Ref

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) Refer

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) Set

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) Update

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

type Evaler interface {
    Eval(env *Env) Any
}

Evaler

type Named

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

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

primitive procedure structure type

func NewProc

func NewProc(it Any, name string) *PrimProc

func (*PrimProc) Apply

func (pc *PrimProc) Apply(as []Any) Any

func (*PrimProc) Name

func (pc *PrimProc) Name() string

func (*PrimProc) String

func (pc *PrimProc) String() string

func (*PrimProc) Value

func (pc *PrimProc) Value() Any

type PrimSyntax

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

primitive syntax structure type

func NewSyntax

func NewSyntax(it Any, name string) *PrimSyntax

func (*PrimSyntax) IsSyntax

func (kw *PrimSyntax) IsSyntax() bool

func (*PrimSyntax) Name

func (kw *PrimSyntax) Name() string

func (*PrimSyntax) String

func (kw *PrimSyntax) String() string

func (*PrimSyntax) Value

func (kw *PrimSyntax) Value() Any

type Proc

type Proc interface {
    Apply(args []Any) Any
}

Proc

type Syntax

type Syntax interface {
    Transform(env *Env, exp Any) Any
}

Syntax

This interface represents macro transformers.

Subdirectories

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).