The Expression Problem is a new name for an old problem. The goal is to define a datatype by cases, where one can add new cases to the datatype and new functions over the datatype, without recompiling existing code, and while retaining static type safety (e.g., no casts). For the concrete example, we take expressions as the data type, begin with one case (constants) and one function (evaluators), then add one more construct (plus) and one more function (conversion to a string). http://homepages.inf.ed.ac.uk/wadler/papers/expression/expression.txt
C. d. S. Oliveira1 and William R. Cook2 1National University of Singapore [email protected] 2 University of Texas, Austin [email protected] Abstract. This paper presents a new solution to the expression problem (EP) that works in OO languages with simple generics (including Java
n perate over one or more abstract types, call f some primitive built-in sorts for integers a signature E lit: Int ⇥ E add: E E ⇥ E A general algebraic signature can contain he abstract set, as well as observations tha his paper we restrict signatures to only conta iven above. We call such signatures construc An -algebra is a set together with a co pecified in the signature . A given signat abstract class ExpAlg<E> { E lit(int n); E add(E lhs, E rhs); } Guttag, J. V., Horning, J.J.: The algebraic specification of abstract datatypes. Acta Informatica (1978) Generic factory interfaces are algebraic signatures!