Documentation ¶
Index ¶
- Constants
- func IsLetter(n Name) bool
- func IsNumber(n Name) bool
- func IsSymbol(n Name) bool
- func IsVerb(v Value) bool
- func Linearize(s string) string
- func NameString(n Name) string
- func Print(w io.Writer, f Format, v Value)
- func QuickPrint(prefix, indent string, recurse int, v Value) string
- func Same(x, y Value) bool
- func SortNames(names []Name)
- func String(v Value) string
- type Circuit
- func (u Circuit) Abandon(name Name) Circuit
- func (u Circuit) At(name Name) Value
- func (u Circuit) CircuitAt(name Name) Circuit
- func (u Circuit) CircuitOptionAt(name Name) (Circuit, bool)
- func (u Circuit) ComplexAt(name Name) complex128
- func (u Circuit) Copy() Circuit
- func (u Circuit) DeepCopy() Circuit
- func (u Circuit) Degree(gate Name) int
- func (u Circuit) Exclude(name Name) (forgotten Value)
- func (u Circuit) FloatAt(name Name) float64
- func (u Circuit) FloatOrZeroAt(name Name) float64
- func (u Circuit) Flows() (r [][2]Vector)
- func (u Circuit) Follow(v Vector) Vector
- func (u Circuit) Forget(addr []Name) Value
- func (u Circuit) Gates() map[Name]Value
- func (u Circuit) Goto(gate ...Name) Value
- func (u Circuit) Grow(name Name, value Value) Circuit
- func (u Circuit) Has(name Name) bool
- func (u Circuit) Include(name Name, value Value) (before Value)
- func (u Circuit) IntAt(name Name) int
- func (u Circuit) IntOptionAt(name Name) (int, bool)
- func (u Circuit) IntOrZeroAt(name Name) int
- func (u Circuit) IsEmpty() bool
- func (u Circuit) IsNil() bool
- func (u Circuit) Len() int
- func (u Circuit) Letters() []string
- func (u Circuit) Link(x, y Vector)
- func (u Circuit) Lookup(addr []Name) (v Value)
- func (u Circuit) Merge(v Circuit)
- func (u Circuit) NameAt(name Name) Name
- func (u Circuit) Names() []Name
- func (u Circuit) Numbers() []int
- func (u Circuit) OptionAt(name Name) (Value, bool)
- func (u Circuit) Place(addr []Name, value Value) Value
- func (u Circuit) Print(w io.Writer, f Format)
- func (u Circuit) ReGrow(name Name, value Value) Circuit
- func (u Circuit) RePlace(addr []Name, value Value) Value
- func (u Circuit) Refine(walk ...Name) Circuit
- func (u Circuit) Reflow(s, t Name)
- func (u Circuit) Rename(x, y Name) Circuit
- func (x Circuit) Same(v Value) bool
- func (u Circuit) SortedLetters() []string
- func (u Circuit) SortedNames() []Name
- func (u Circuit) SortedNumbers() []int
- func (u Circuit) String() string
- func (u Circuit) StringAt(name Name) string
- func (u Circuit) StringOptionAt(name Name) (string, bool)
- func (u Circuit) Unify(name string) string
- func (u Circuit) Unlink(x, y Vector)
- func (u Circuit) ValveNames(gate Name) []Name
- func (u Circuit) Valves(gate Name) map[Name]Vector
- func (u Circuit) VectorAt(name Name) Vector
- func (u Circuit) VerbAt(name Name) Verb
- func (u Circuit) View(gate Name) Circuit
- func (u Circuit) Vol() (vol int)
- type Format
- type Name
- type Orient
- type Value
- type Vector
- type Verb
Constants ¶
const DefaultValve = ""
DefaultValve is the name of the default valve
const Super = ""
Super is the super-gates name. The super-gate is the gate-view of the current/top-most circuit.
Variables ¶
This section is empty.
Functions ¶
func NameString ¶
Types ¶
type Circuit ¶
type Circuit struct { Gate map[Name]Value Flow map[Name]map[Name]Vector // gate -> valve -> opposing gate and valve }
Circuit represents an Escher circuit. See the Escher Handbook for a description of circuits.
func (Circuit) ComplexAt ¶
func (u Circuit) ComplexAt(name Name) complex128
func (Circuit) Degree ¶
Degree returns the number of connected valves of the gate with the supplied name
func (Circuit) FloatOrZeroAt ¶
FloatOrZeroAt returns the value of the gate with the supplied name if it is a float value, 0.0 otherwise
func (Circuit) IntOrZeroAt ¶
IntOrZeroAt returns the value of the gate with the supplied name if it is an int value, 0 otherwise
func (Circuit) Link ¶
Link connects two different, yet unconnected valves (by vector), potentially from the same gate
func (Circuit) SortedLetters ¶
SortedLetters returns a sorted list of all gate IDs that are strings
func (Circuit) SortedNames ¶
SortedNames returns a sorted list of all gate IDs (whether they are string or int)
func (Circuit) SortedNumbers ¶
SortedNumbers returns a sorted list of all gate IDs that are ints
func (Circuit) Unify ¶
Unify creates a most simple string to narrowly identify a circuit by its (supplied) name and number of gates
func (Circuit) ValveNames ¶
ValveNames returns the list of connected valve-names of the gate with the supplied name
func (Circuit) Valves ¶
Valves returns the list of connected valve-name of the gate with the supplied name, and their connected vectors
type Orient ¶
Orient is a registry for gates names and their valve names
type Verb ¶
type Verb Circuit
Verb is an interpretation of a circuit. The values of the sorted, number-named gates are treated as a slice of values representing an ‘address’. The value of the empty-string gate, if present, is expected to be a string and is a ‘verb’ word.
func NewAddress ¶
NewAddress returns a verb-view circuit (like an array in other languages) of the supplied names in the supplied order.
func NewVerbAddress ¶
NewVerbAddress returns a verb-view circuit (like an array in other languages) with the given name and the supplied names in the supplied order