refactor: extract Reducer interface and update engine to use abstractions
Introduce reducer.Reducer interface and update the engine to use abstract expr.Expression and reducer.Reducer types, enabling pluggable reduction strategies. - Add pkg/reducer/reducer.go with Reducer interface. - Add pkg/lambda/reducer.go with NormalOrderReducer implementation. - Update engine to accept expr.Expression and reducer.Reducer. - Update plugins to use expr.Expression directly (no pointer dereference). - Update main and tests to pass reducer to engine. Closes #30
This commit is contained in:
@@ -23,9 +23,9 @@ func NewExplanation(process *engine.Engine) *Explanation {
|
||||
}
|
||||
|
||||
func (t *Explanation) Start() {
|
||||
fmt.Println((*t.process.Expression).String())
|
||||
fmt.Println(t.process.Expression.String())
|
||||
}
|
||||
|
||||
func (t *Explanation) Step() {
|
||||
fmt.Println(" =", (*t.process.Expression).String())
|
||||
fmt.Println(" =", t.process.Expression.String())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user