previous | top | next

Example #1: printf-like bytecode interpreter


bytecode_interpreter.c (0K)

Suppose you had several similar functions, each printing out a different-but-similar report. By introducing a printf-like bytecode interpreter, you can factor out (de-reify) those functions. You're also introducing (reifying) a new concept, the "format string".


SIGPLAN / interpreter design pattern