task

package
v0.0.0-...-1e9a466 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2016 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SaveCarCode = 1 << iota
	SaveCdrCode
	SaveDynamic
	SaveLexical
	SaveScratch
	SaveMax
)
View Source
const (
	SaveCode = SaveCarCode | SaveCdrCode
)

Variables

View Source
var (
	Platform string = "unix"
)

Functions

func BecomeProcessGroupLeader

func BecomeProcessGroupLeader() int

func ContinueProcess

func ContinueProcess(pid int)

func GetHistoryFilePath

func GetHistoryFilePath() (string, error)

func InitSignalHandling

func InitSignalHandling()

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 IsString

func IsString(c Cell) bool

func IsSyntax

func IsSyntax(c Cell) bool

func JobControlSupported

func JobControlSupported() bool

func JoinProcess

func JoinProcess(proc *os.Process) int

func LaunchForegroundTask

func LaunchForegroundTask()

func Pgid

func Pgid() int

func PrintError

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

func Resolve

func Resolve(s Context, e *Env, k *Symbol) (v Reference)

func SetForegroundGroup

func SetForegroundGroup(group int)

func Start

func Start(parser reader, cli ui)

func SuspendProcess

func SuspendProcess(pid int)

func SysProcAttr

func SysProcAttr(group int) *syscall.SysProcAttr

func TerminateProcess

func TerminateProcess(pid int)

Types

type Binding

type Binding interface {
	Cell

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

type Bound

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

func NewBound

func NewBound(ref Closure, context Context) *Bound

func (*Bound) Bind

func (b *Bound) Bind(c Context) 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() Context

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 {
	*Scope
	// contains filtered or unexported fields
}

func (*Channel) Close

func (ch *Channel) Close()

func (*Channel) Equal

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

func (*Channel) Expose

func (ch *Channel) Expose() Context

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
	Label() Cell
	Params() Cell
	Scope() Context
}

func NewBuiltin

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

func NewMethod

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

func NewSyntax

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

type ClosureGenerator

type ClosureGenerator func(a Function, b, 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) Label

func (c *Command) Label() Cell

func (*Command) Params

func (c *Command) Params() Cell

func (*Command) Scope

func (c *Command) Scope() Context

type Conduit

type Conduit interface {
	Context

	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)
	Expose() Context
	Faces() *Env
	Prev() Context
	Public(key, value Cell)
	Remove(key Cell) bool

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

func NewChannel

func NewChannel(t *Task, cap int) Context

func NewPipe

func NewPipe(l Context, r *os.File, w *os.File) Context

type Continuation

type Continuation struct {
	Scratch Cell
	Stack   Cell
}

func NewContinuation

func NewContinuation(scratch Cell, stack Cell) *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 {
	// 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) Bool

func (e *Env) Bool() bool

func (*Env) Complete

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

func (*Env) Copy

func (e *Env) Copy() *Env

func (*Env) Equal

func (e *Env) Equal(c Cell) bool

func (*Env) Method

func (e *Env) Method(name string, m Function)

func (*Env) Prev

func (e *Env) Prev() *Env

func (*Env) Remove

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

func (*Env) String

func (e *Env) String() string

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 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) 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 {
	*Scope
	// contains filtered or unexported fields
}

func (*Pipe) Close

func (p *Pipe) Close()

func (*Pipe) Equal

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

func (*Pipe) Expose

func (p *Pipe) Expose() Context

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
	Dynamic *Env
	Lexical Context
}

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

func (r *Registers) NewBlock(dynamic *Env, 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) 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) Remove

func (s *Scope) Remove(key Cell) bool

func (*Scope) String

func (s *Scope) String() string

type String

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

func NewString

func NewString(t *Task, v string) *String

func (*String) Bool

func (s *String) Bool() bool

func (*String) Equal

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

func (*String) Expose

func (s *String) Expose() Context

func (*String) Float

func (s *String) Float() (f float64)

func (*String) Int

func (s *String) Int() (i int64)

func (*String) Rat

func (s *String) Rat() *big.Rat

func (*String) Raw

func (s *String) Raw() string

func (*String) Status

func (s *String) Status() (i int64)

func (*String) String

func (s *String) String() string

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 Cell
	File string
	Line int
	// contains filtered or unexported fields
}

func ForegroundTask

func ForegroundTask() *Task

func NewTask

func NewTask(c Cell, d *Env, 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) Call

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

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

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

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) (successful bool)

func (*Task) Runnable

func (t *Task) Runnable() bool

func (*Task) Self

func (t *Task) Self() Context

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) 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 Context) 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() Context

func (*Unbound) String

func (u *Unbound) String() string

Jump to

Keyboard shortcuts

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