Feeling cranky today, lockdown and everything. This is an elementary interpreter, clumsily implemented because of all the object oriented cruft.
Don't you mean the Interpreter pattern /s
Indeed... in Haskell this can be implemented with a GADT and an evaluator which is really easy to express.
Still useful to know the "pattern" regardless of OOP cruft, Javascript prototypes, or Haskell data types.
Yeah, Evans' book really changed the way I do a bunch of design. That software is infinitely flexible is generally great, but it can allow complexity to metastasize. Anchoring design to the domain, which tends to be pretty stable, can provide a lot of clarity. It does require taking an anthropological approach to one's users, but I think that pays off in all sorts of ways.