task

package
v0.0.0-...-0325e1a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 20, 2016 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SaveCarCode = 1 << iota
	SaveCdrCode
	SaveDump
	SaveFrame
	SaveLexical
	SaveMax
)
View Source
const (
	SaveCode = SaveCarCode | SaveCdrCode
)

Variables

This section is empty.

Functions

func Call

func Call(t *Task, c Cell, problem string) string

func Deref

func Deref(name string, address uintptr) Cell

func IsBuiltin

func IsBuiltin(c Cell) bool

func IsChannel

func IsChannel(c Cell) bool

func IsContext

func IsContext(c Cell) bool

func IsContinuation

func IsContinuation(c Cell) bool

func IsMethod

func IsMethod(c Cell) bool

func IsPipe

func IsPipe(c Cell) bool

func IsSyntax

func IsSyntax(c Cell) bool

func IsText

func IsText(c Cell) bool

func LaunchForegroundTask

func LaunchForegroundTask()

func PrintError

func PrintError(file string, line int, msg string)

func Resolve

func Resolve(s Cell, f Cell, k *Symbol) (Reference, Cell)

func Start

func Start(p parser, cli ui)

Types

type Binding

type Binding interface {
	Cell

	Bind(c Cell) Binding
	Ref() Closure
	Self() Cell
}

type Bound

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

func NewBound

func NewBound(ref Closure, context Cell) *Bound

func (*Bound) Bind

func (b *Bound) Bind(c Cell) Binding

func (*Bound) Bool

func (b *Bound) Bool() bool

func (*Bound) Equal

func (b *Bound) Equal(c Cell) bool

func (*Bound) Ref

func (b *Bound) Ref() Closure

func (*Bound) Self

func (b *Bound) Self() Cell

func (*Bound) String

func (b *Bound) String() string

type Builtin

type Builtin struct {
	Command
}

func (*Builtin) Equal

func (b *Builtin) Equal(c Cell) bool

func (*Builtin) String

func (b *Builtin) String() string

type Channel

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

func NewChannel

func NewChannel(cap int) *Channel

func (*Channel) Bool

func (ch *Channel) Bool() bool

func (*Channel) Close

func (ch *Channel) Close()

func (*Channel) Equal

func (ch *Channel) Equal(c Cell) bool

func (*Channel) Read

func (ch *Channel) Read(t *Task) Cell

func (*Channel) ReadLine

func (ch *Channel) ReadLine(t *Task) Cell

func (*Channel) ReaderClose

func (ch *Channel) ReaderClose()

func (*Channel) String

func (ch *Channel) String() string

func (*Channel) Write

func (ch *Channel) Write(c Cell)

func (*Channel) WriterClose

func (ch *Channel) WriterClose()

type Closure

type Closure interface {
	Cell

	Applier() Function
	Body() Cell
	CallerLabel() Cell
	Params() Cell
	Scope() Context
	SelfLabel() Cell
}

func NewBuiltin

func NewBuiltin(a Function, b, c, l, p Cell, s Context) Closure

func NewMethod

func NewMethod(a Function, b, c, l, p Cell, s Context) Closure

func NewSyntax

func NewSyntax(a Function, b, c, l, p Cell, s Context) Closure

type ClosureGenerator

type ClosureGenerator func(a Function, b, c, l, p Cell, s Context) Closure

type Command

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

func (*Command) Applier

func (c *Command) Applier() Function

func (*Command) Body

func (c *Command) Body() Cell

func (*Command) Bool

func (c *Command) Bool() bool

func (*Command) CallerLabel

func (c *Command) CallerLabel() Cell

func (*Command) Params

func (c *Command) Params() Cell

func (*Command) Scope

func (c *Command) Scope() Context

func (*Command) SelfLabel

func (c *Command) SelfLabel() Cell

type Conduit

type Conduit interface {
	Close()
	ReaderClose()
	ReadLine(*Task) Cell
	Read(*Task) Cell
	WriterClose()
	Write(c Cell)
}

type Context

type Context interface {
	Cell

	Access(key Cell) Reference
	Copy() Context
	Complete(word string) []string
	Define(key, value Cell)
	Exported() map[string]Cell
	Expose() Context
	Faces() *Env
	Prev() Context
	Public(key, value Cell)
	Visibility() *Env

	DefineBuiltin(k string, f Function)
	DefineMethod(k string, f Function)
	DefineSyntax(k string, f Function)
	PublicMethod(k string, f Function)
	PublicSyntax(k string, f Function)
}

type Continuation

type Continuation struct {
	Dump  Cell
	Frame Cell
	Stack Cell
	File  string
	Line  int
}

func NewContinuation

func NewContinuation(dump, frame, stack Cell, f string, l int) *Continuation

func (*Continuation) Bool

func (ct *Continuation) Bool() bool

func (*Continuation) Equal

func (ct *Continuation) Equal(c Cell) bool

func (*Continuation) String

func (ct *Continuation) String() string

type Env

type Env struct {
	*sync.RWMutex
	// contains filtered or unexported fields
}

func NewEnv

func NewEnv(prev *Env) *Env

func (*Env) Access

func (e *Env) Access(key Cell) Reference

func (*Env) Add

func (e *Env) Add(key Cell, value Cell)

func (*Env) Complete

func (e *Env) Complete(word string) []string

func (*Env) Copy

func (e *Env) Copy() *Env

func (*Env) Prefixed

func (e *Env) Prefixed(prefix string) map[string]Cell

func (*Env) Prev

func (e *Env) Prev() *Env

func (*Env) Remove

func (e *Env) Remove(key Cell) bool

type Function

type Function func(t *Task, args Cell) bool

type Job

type Job struct {
	*sync.Mutex
	Command string
	Group   int
	// contains filtered or unexported fields
}

func NewJob

func NewJob() *Job

type Message

type Message struct {
	Cmd     Cell
	File    string
	Line    int
	Problem string
}

type Method

type Method struct {
	Command
}

func (*Method) Equal

func (m *Method) Equal(c Cell) bool

func (*Method) String

func (m *Method) String() string

type Object

type Object struct {
	Context
}

func NewObject

func NewObject(v Context) *Object

func (*Object) Access

func (o *Object) Access(key Cell) Reference

func (*Object) Complete

func (o *Object) Complete(word string) []string

func (*Object) Copy

func (o *Object) Copy() Context

func (*Object) Define

func (o *Object) Define(key Cell, value Cell)

func (*Object) Equal

func (o *Object) Equal(c Cell) bool

func (*Object) Expose

func (o *Object) Expose() Context

func (*Object) String

func (o *Object) String() string

type Pipe

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

func NewPipe

func NewPipe(r *os.File, w *os.File) *Pipe

func (*Pipe) Bool

func (p *Pipe) Bool() bool

func (*Pipe) Close

func (p *Pipe) Close()

func (*Pipe) Equal

func (p *Pipe) Equal(c Cell) bool

func (*Pipe) Read

func (p *Pipe) Read(t *Task) Cell

func (*Pipe) ReadFd

func (p *Pipe) ReadFd() *os.File

func (*Pipe) ReadLine

func (p *Pipe) ReadLine(t *Task) Cell

func (*Pipe) ReaderClose

func (p *Pipe) ReaderClose()

func (*Pipe) String

func (p *Pipe) String() string

func (*Pipe) Write

func (p *Pipe) Write(c Cell)

func (*Pipe) WriteFd

func (p *Pipe) WriteFd() *os.File

func (*Pipe) WriterClose

func (p *Pipe) WriterClose()

type Registers

type Registers struct {
	Continuation // Stack and Dump

	Code    Cell // Control
	Lexical Cell
}

func (*Registers) Arguments

func (r *Registers) Arguments() Cell

func (*Registers) Complete

func (r *Registers) Complete(word string) []string

func (*Registers) GetState

func (r *Registers) GetState() int64

func (*Registers) MakeEnv

func (r *Registers) MakeEnv() []string

func (*Registers) NewBlock

func (r *Registers) NewBlock(lexical Context)

func (*Registers) NewFrame

func (r *Registers) NewFrame(lexical Context)

func (*Registers) NewStates

func (r *Registers) NewStates(l ...int64)

func (*Registers) RemoveState

func (r *Registers) RemoveState()

func (*Registers) ReplaceStates

func (r *Registers) ReplaceStates(l ...int64)

func (*Registers) RestoreState

func (r *Registers) RestoreState()

func (*Registers) Return

func (r *Registers) Return(rv Cell) bool

type Scope

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

func NewScope

func NewScope(prev Context, fixed *Env) *Scope

func (*Scope) Access

func (s *Scope) Access(key Cell) Reference

func (*Scope) Bool

func (s *Scope) Bool() bool

func (*Scope) Complete

func (s *Scope) Complete(word string) []string

func (*Scope) Copy

func (s *Scope) Copy() Context

func (*Scope) Define

func (s *Scope) Define(key Cell, value Cell)

func (*Scope) DefineBuiltin

func (s *Scope) DefineBuiltin(k string, a Function)

func (*Scope) DefineMethod

func (s *Scope) DefineMethod(k string, a Function)

func (*Scope) DefineSyntax

func (s *Scope) DefineSyntax(k string, a Function)

func (*Scope) Equal

func (s *Scope) Equal(c Cell) bool

func (*Scope) Exported

func (s *Scope) Exported() map[string]Cell

func (*Scope) Expose

func (s *Scope) Expose() Context

func (*Scope) Faces

func (s *Scope) Faces() *Env

func (*Scope) Prev

func (s *Scope) Prev() Context

func (*Scope) Public

func (s *Scope) Public(key Cell, value Cell)

func (*Scope) PublicMethod

func (s *Scope) PublicMethod(k string, a Function)

func (*Scope) PublicSyntax

func (s *Scope) PublicSyntax(k string, a Function)

func (*Scope) String

func (s *Scope) String() string

func (*Scope) Visibility

func (s *Scope) Visibility() *Env

type Syntax

type Syntax struct {
	Command
}

func (*Syntax) Equal

func (m *Syntax) Equal(c Cell) bool

func (*Syntax) String

func (m *Syntax) String() string

type Task

type Task struct {
	*Job
	Registers
	Done chan Cell
	Eval chan Message
	// contains filtered or unexported fields
}

func ForegroundTask

func ForegroundTask() *Task

func NewTask

func NewTask(c Cell, l Context, p *Task) *Task

func (*Task) Apply

func (t *Task) Apply(args Cell) bool

func (*Task) Bool

func (t *Task) Bool() bool

func (*Task) Chdir

func (t *Task) Chdir(dir string) bool

func (*Task) Closure

func (t *Task) Closure(n ClosureGenerator) bool

func (*Task) Continue

func (t *Task) Continue()

func (*Task) Debug

func (t *Task) Debug(s string)

func (*Task) Equal

func (t *Task) Equal(c Cell) bool

func (*Task) Execute

func (t *Task) Execute(arg0 string, argv []string, attr *os.ProcAttr) (*Status, error)

func (*Task) External

func (t *Task) External(args Cell) bool

func (*Task) Launch

func (t *Task) Launch()

func (*Task) LexicalVar

func (t *Task) LexicalVar(state int64) bool

func (*Task) Listen

func (t *Task) Listen()

func (*Task) Lookup

func (t *Task) Lookup(sym *Symbol, simple bool) (bool, string)

func (*Task) Run

func (t *Task) Run(end Cell, problem string) (status int)

func (*Task) Runnable

func (t *Task) Runnable() bool

func (*Task) Self

func (t *Task) Self() Cell

func (*Task) Stop

func (t *Task) Stop()

func (*Task) Strict

func (t *Task) Strict() (ok bool)

func (*Task) String

func (t *Task) String() string

func (*Task) Suspend

func (t *Task) Suspend()

func (*Task) Throw

func (t *Task) Throw(file string, line int, text string)

func (*Task) Validate

func (t *Task) Validate(
	args Cell, minimum, maximum int64, validators ...Validator,
)

func (*Task) Wait

func (t *Task) Wait()

type Unbound

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

func NewUnbound

func NewUnbound(Ref Closure) *Unbound

func (*Unbound) Bind

func (u *Unbound) Bind(c Cell) Binding

func (*Unbound) Bool

func (u *Unbound) Bool() bool

func (*Unbound) Equal

func (u *Unbound) Equal(c Cell) bool

func (*Unbound) Ref

func (u *Unbound) Ref() Closure

func (*Unbound) Self

func (u *Unbound) Self() Cell

func (*Unbound) String

func (u *Unbound) String() string

type Validator

type Validator func(c Cell) bool

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL