On Lisp: Chapter4, Utility Functions

Chapter 4 of On Lisp covers utility functions. Little functions you are probably going to use your programs. They are small enough that that don’t deserve to be libraries of their own but are general enough that they you tend to take them with you from application to application.

From a learning point of view it would be great if this chapter had taken the form of hey try to write a function that does this… Then be given how Paul Graham would do it. But it is just not that sort of book. There are no exercises at the end of and of the chapters. Rather this is a book for more experienced Lisp programmers that had a sizeable body of code to try out the ideas talked about here. Well at least that is what I am starting to think.

These early chapters serve to make sure there are not gaps in knowledge for this type of programmer that may make the later chapters hard(er?) to understand. So in this case Paul Graham does not expect many of the utility functions to be new to you.

This chapter has a small bit of discussion about why you should create you own utility functions rather than sticking to pure lisp. I won’t reiterate them here as I feel that these views are now fairly mainstream.

My approach to this chapter was to type out each lisp function, and then spend some time understanding it before reading the description. Typing out the functions was good practice as there is always a certain amount of muscle memory when it comes to typing code. For me it is constantly typing const when attempting to type cons.

So I found the chapter interesting and it got me reading a lot more Lisp code but it was not the strongest chapter.


307 Words

2020-08-29 20:07 +0000