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().
12 lines
484 B
Go
12 lines
484 B
Go
// 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
|
|
}
|