Esempio n. 1
0
func (m Memory) Grow(valve tree.Name, age int, value tree.Meaning) Memory {
	return Memory(
		tree.Tree(m).Grow(
			valve,
			MemoryFunctional{
				"Valve": tree.Branch{valve},
				"Value": tree.Branch{value},
				"Age":   tree.Branch{age},
			},
		).Collapse(),
	)
}
Esempio n. 2
0
func (s Sentence) Grow(time int, valve tree.Name, value tree.Meaning) Sentence {
	return Sentence(
		tree.Tree(s).Grow(
			time,
			SentenceFunctional{
				"Valve": tree.Branch{valve},
				"Value": tree.Branch{value},
				"Time":  tree.Branch{time},
			},
		).Collapse(),
	)
}
Esempio n. 3
0
func materializeBuiltin(d see.Design) Reflex {
	switch t := d.(type) {
	case see.StringDesign:
		return NewNounReflex(string(t))
	case see.IntDesign:
		return NewNounReflex(int(t))
	case see.FloatDesign:
		return NewNounReflex(float64(t))
	case see.ComplexDesign:
		return NewNounReflex(complex128(t))
	case see.TreeDesign:
		return NewNounReflex(tree.Tree(t))
	}
	panic("unknown builting design")
}
Esempio n. 4
0
func (mf MemoryFunctional) Age() int {
	return tree.Tree(mf).AtInt("Age")
}
Esempio n. 5
0
func (mf MemoryFunctional) Value() tree.Meaning {
	return tree.Tree(mf).At("Value")
}
Esempio n. 6
0
func (mf MemoryFunctional) Valve() tree.Name {
	return tree.Tree(mf).AtName("Valve")
}
Esempio n. 7
0
func (m Memory) At(valve tree.Name) MemoryFunctional {
	return tree.Tree(m).At(valve).(MemoryFunctional)
}
Esempio n. 8
0
func (sf SentenceFunctional) Time() int {
	return tree.Tree(sf).AtInt("Time")
}
Esempio n. 9
0
func (sf SentenceFunctional) Value() tree.Meaning {
	return tree.Tree(sf).At("Value")
}
Esempio n. 10
0
func (sf SentenceFunctional) Valve() tree.Name {
	return tree.Tree(sf).AtName("Valve")
}
Esempio n. 11
0
func (s Sentence) At(time int) SentenceFunctional {
	return tree.Tree(s).At(time).(SentenceFunctional)
}
Esempio n. 12
0
func (s Sentence) At(valve tree.Name) SentenceFunctional {
	return tree.Tree(s).At(valve).(SentenceFunctional)
}