SICP. Part 2. Building Abstractions with Data

Andrey Dmitriev · March 10, 2021

Data abstraction is a methodology that enables us to isolate how a compound data object is used from the details of how it is constructed from more primitive data objects. The consequence of this methodology is abstraction barriers. It’s a splitting a program into layers, where each layer uses the layer on the level below.

Author tells a lot of interface in this chapter and gives cool examples. (I like it). But more interesting thing for me, it’s a list as interface. I didn’t think about it earlier. Really, if I don’t write a specific algorithm, often I only transform lists using map, filter and reduce.

In last part of this chapter, author builds system of arithmetic operation using data-directed-programing. He creates common operations with numbers and then, develops packages with various numbers (complex, rational and etc.) and operations with them. All structure of program in image: The author shows the development of not only a program, but also a simple type system based on tags (data = (tag, content)).

You can see some examples and solutions of exercise in this repo

Twitter, Facebook