refactor: extract abstract Expression interface
Introduce pkg/expr.Expression as a base interface for all evaluatable expression types, enabling future support for multiple evaluation modes (SKI combinators, typed lambda calculus, etc.). - Add pkg/expr/expr.go with Expression interface requiring String() method. - Update lambda.Expression to embed expr.Expression. - Add String() method to Abstraction, Application, and Variable types. - Update plugins to use String() instead of lambda.Stringify().
This commit is contained in:
@@ -4,7 +4,6 @@ import (
|
||||
"log/slog"
|
||||
|
||||
"git.maximhutz.com/max/lambda/internal/engine"
|
||||
"git.maximhutz.com/max/lambda/pkg/lambda"
|
||||
)
|
||||
|
||||
type Logs struct {
|
||||
@@ -20,6 +19,5 @@ func NewLogs(logger *slog.Logger, process *engine.Engine) *Logs {
|
||||
}
|
||||
|
||||
func (t *Logs) Step() {
|
||||
stringified := lambda.Stringify(*t.process.Expression)
|
||||
t.logger.Info("reduction", "tree", stringified)
|
||||
t.logger.Info("reduction", "tree", (*t.process.Expression).String())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user