previous | top | next

Example #3: Mutation-based interpreter


mutation_interpreter.cpp (2K)

There's a general rule "mutability: bad / immutable: good". However, it's sometimes valuable to bend that rule, to allow a category of "mutable during construction" objects.


SIGPLAN / interpreter design pattern