feat: stuff

This commit is contained in:
2025-12-26 03:37:05 -05:00
parent f26e7fbdc9
commit e3629acb45
5 changed files with 59 additions and 16 deletions

View File

@@ -1,7 +1,7 @@
package saccharine
type Node interface {
IsNode()
Accept(Visitor)
}
/** ------------------------------------------------------------------------- */
@@ -36,6 +36,14 @@ func NewVariable(name string) *Variable {
/** ------------------------------------------------------------------------- */
func (_ Abstraction) IsNode() {}
func (_ Application) IsNode() {}
func (_ Variable) IsNode() {}
func (a *Abstraction) Accept(x Visitor) { x.VisitAbstraction(a) }
func (a *Application) Accept(x Visitor) { x.VisitApplication(a) }
func (v *Variable) Accept(x Visitor) { x.VisitVariable(v) }
/** ------------------------------------------------------------------------- */
type Visitor interface {
VisitAbstraction(*Abstraction)
VisitApplication(*Application)
VisitVariable(*Variable)
}