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(), ) }
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(), ) }
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") }
func (mf MemoryFunctional) Age() int { return tree.Tree(mf).AtInt("Age") }
func (mf MemoryFunctional) Value() tree.Meaning { return tree.Tree(mf).At("Value") }
func (mf MemoryFunctional) Valve() tree.Name { return tree.Tree(mf).AtName("Valve") }
func (m Memory) At(valve tree.Name) MemoryFunctional { return tree.Tree(m).At(valve).(MemoryFunctional) }
func (sf SentenceFunctional) Time() int { return tree.Tree(sf).AtInt("Time") }
func (sf SentenceFunctional) Value() tree.Meaning { return tree.Tree(sf).At("Value") }
func (sf SentenceFunctional) Valve() tree.Name { return tree.Tree(sf).AtName("Valve") }
func (s Sentence) At(time int) SentenceFunctional { return tree.Tree(s).At(time).(SentenceFunctional) }
func (s Sentence) At(valve tree.Name) SentenceFunctional { return tree.Tree(s).At(valve).(SentenceFunctional) }