Documentation ¶
Index ¶
- Variables
- func CleanUp(u Circuit) Circuit
- func DontCognize(interface{})
- func IsIndex(v Value) bool
- func Link(x, y *Synapse)
- func Materialize(given Reflex, matter circuit.Circuit, v Material, aux ...interface{}) interface{}
- func MaterializeInstance(given Reflex, matter circuit.Circuit, v Material, aux ...interface{}) (residue, obj interface{})
- func MaterializeSource(given Reflex, matter Circuit, v interface{}) Value
- func MaterializeSystem(system interface{}, index, barrier Circuit) (residue interface{})
- func Panicf(f string, a ...interface{})
- func PrintMatter(w io.Writer, matter Circuit)
- func PrintView(u Circuit) string
- func PrintableMatter(u Circuit) string
- func SinkValue(v interface{})
- func SummarizeIndex(matter Circuit) string
- type Cognize
- type Entanglement
- type Eye
- type EyeCognizer
- type Future
- type Index
- type Material
- type Materializer
- type Panic
- type ReCognizer
- type Reflex
- type Sparkless
- type Synapse
- type Union
Constants ¶
This section is empty.
Variables ¶
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 Materialize ¶
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 PrintMatter ¶
func PrintableMatter ¶
func PrintableMatter(u Circuit) string
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 ¶
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 (*Eye) Connect ¶
func (eye *Eye) Connect(given Reflex, cog EyeCognizer)
type EyeCognizer ¶
type EyeCognizer func(eye *Eye, valve Name, value interface{})
type Future ¶
type Future struct {
// contains filtered or unexported fields
}
Future
func (*Future) OverCognize ¶
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.
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 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 Synapse ¶
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