be

package
v0.0.0-...-7782d42 Latest Latest
Warning

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

Go to latest
Published: May 7, 2019 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SpiritVerb = NewVerbAddress("*", "Spirit")

*Spirit gates emit the residue of the enclosing circuit itself

Functions

func CleanUp

func CleanUp(u Circuit) Circuit

CleanUp removes nil-valued gates and their incident edges. CleanUp never returns nil.

func DontCognize

func DontCognize(interface{})

Nop cognizer for the synapse interface

func IsIndex

func IsIndex(v Value) bool
func Link(x, y *Synapse)

Link attaches two synapse endpoints together in one direction.

func Materialize

func Materialize(given Reflex, matter circuit.Circuit, v Material, aux ...interface{}) interface{}

Materialize materializes the native implementation v. It returns the resulting reflex and residue, but not the Go-facing instance.

func MaterializeInstance

func MaterializeInstance(given Reflex, matter circuit.Circuit, v Material, aux ...interface{}) (residue, obj interface{})

MaterializeInstance materializes the native implementation v. It returns the resulting reflex and residue, as well as the Go-facing instance.

func MaterializeSource

func MaterializeSource(given Reflex, matter Circuit, v interface{}) Value

func MaterializeSystem

func MaterializeSystem(system interface{}, index, barrier Circuit) (residue interface{})

func Panicf

func Panicf(f string, a ...interface{})

func PrintMatter

func PrintMatter(w io.Writer, matter Circuit)

func PrintView

func PrintView(u Circuit) string

func PrintableMatter

func PrintableMatter(u Circuit) string

func SinkValue

func SinkValue(v interface{})

func SummarizeIndex

func SummarizeIndex(matter Circuit) string

Types

type Cognize

type Cognize func(value interface{})

Cognize routines are called when a change in value is to be delivered to a reflex.

type Entanglement

type Entanglement struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func NewEntanglement

func NewEntanglement() (p, n *Entanglement)

NewEntanglement returns two materializers that each materialize once, to a gate with a default valve which is connected to the other.

func (*Entanglement) Materialize

func (em *Entanglement) Materialize(given Reflex, _ Circuit) Value

func (*Entanglement) Synapse

func (em *Entanglement) Synapse() *Synapse

type Eye

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

Eye is a runtime facility that delivers messages by invoking gate methods and provides methods that the gate can use to send messages out.

Eye is an implementation of Leslie Valiant's “Mind's Eye”, described in

http://www.probablyapproximatelycorrect.com/

The mind's eye is a synchronization device which sees changes as ordered and thus introduces the illusory perception of time (and, eventually, of the higher-level concepts of cause and effect).

func NewEye

func NewEye(given Reflex) (eye *Eye)

func (*Eye) Connect

func (eye *Eye) Connect(given Reflex, cog EyeCognizer)

func (*Eye) Show

func (eye *Eye) Show(valve Name, v interface{})

type EyeCognizer

type EyeCognizer func(eye *Eye, valve Name, value interface{})

type Future

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

Future

func (*Future) Charge

func (f *Future) Charge(v Value)

func (*Future) OverCognize

func (f *Future) OverCognize(*Eye, Name, interface{})

func (*Future) Spark

func (f *Future) Spark(eye *Eye, matter Circuit, _ ...interface{}) Value

type Index

type Index Circuit

Index is a hierarchy of names with associated meanings. Alternatively, it is a key-value store wherein keys are sequences of names.

func AsIndex

func AsIndex(v Value) Index

func NewIndex

func NewIndex() Index

func (Index) Memorize

func (x Index) Memorize(value Value, walk ...Name)

func (Index) Merge

func (x Index) Merge(with Index)

func (Index) Recall

func (x Index) Recall(walk ...Name) Value

type Material

type Material interface {
	Spark(eye *Eye, matter Circuit, aux ...interface{}) Value // Initializer
}

Material represents a materializable object implemented as a Go type.

type Materializer

type Materializer func(Reflex, Circuit) interface{}

func NewMaterializer

func NewMaterializer(sample Material, aux ...interface{}) Materializer

NewMaterializer returns a materializer that generates copies of sample and sparks them with the aux data.

func NewSink

func NewSink() Materializer

func NewSource

func NewSource(v interface{}) Materializer

type Panic

type Panic struct {
	Matter Circuit
	Msg    string
}

type ReCognizer

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

The two endpoints of a Synapse are ReCognizer objects.

func (*ReCognizer) ReCognize

func (s *ReCognizer) ReCognize(value interface{})

ReCognize sends value to the reciprocal side of this synapse.

type Reflex

type Reflex map[Name]*Synapse

Reflex is a bundle of not yet attached sense endpoints (synapses).

type Sparkless

type Sparkless struct{}

func (Sparkless) Spark

func (Sparkless) Spark(eye *Eye, matter Circuit, aux ...interface{}) Value

type Synapse

type Synapse struct {
	sync.Mutex
	// contains filtered or unexported fields
}

Synapse is the “wire” connecting two reflexes. It remembers the last value transmitted in order to stop propagation of same-value messages.

func NewSynapse

func NewSynapse() (x, y *Synapse)

func (*Synapse) Connect

func (m *Synapse) Connect(cognize Cognize) *ReCognizer

func (*Synapse) String

func (m *Synapse) String() string

type Union

type Union struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func (*Union) Cognize

func (u *Union) Cognize(eye *Eye, value interface{})

func (*Union) OverCognize

func (u *Union) OverCognize(eye *Eye, valve Name, value interface{})

func (*Union) Spark

func (u *Union) Spark(eye *Eye, matter Circuit, aux ...interface{}) Value

Jump to

Keyboard shortcuts

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