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:
11
pkg/expr/expr.go
Normal file
11
pkg/expr/expr.go
Normal file
@@ -0,0 +1,11 @@
|
||||
// Package expr provides the abstract Expression interface for all evaluatable
|
||||
// expression types in the lambda interpreter.
|
||||
package expr
|
||||
|
||||
// Expression is the base interface for all evaluatable expression types.
|
||||
// Different evaluation modes (lambda calculus, SKI combinators, typed lambda
|
||||
// calculus, etc.) implement this interface with their own concrete types.
|
||||
type Expression interface {
|
||||
// String returns a human-readable representation of the expression.
|
||||
String() string
|
||||
}
|
||||
Reference in New Issue
Block a user