sicp-ex-2.76



<< Previous exercise (2.75) | Index | Next exercise (2.77) >>


Siki

Data-directed style is the most appropriate when new types must often be added.

Message-passing style is the most appropriate when new operations must often be added.


brave one

Actually I don't see the difference: in both cases we have type as a unit, which contains operations. Just dispatch in data-driven variant is external and in message-passing internal. So types are easy to add always, new unit doesn't touch old stuff. And operations touch everything.