Concluding thoughts on the “less familiar parts of Lisp” series

I’ve now finished my brief walk-through of the functions, macros, and special forms described in the Common Lisp Hyper Spec.  Note that these posts only scratch the surface of the CLHS, there is a lot more useful and informative material there, such as standard class hierarchies (including error type hierarchies), definitions, examples, and collected discussions related to clarification of the standard.

This project was primarily for my own benefit, to better understand those features of the language that I hadn’t run into in my use of Common Lisp.  The language definition is, with a few exceptions for convenience, quite orthogonal.  That is, the standard tends not to define so many functions that you can do a particular thing several different ways.  Given this, knowing that I only recognized perhaps half of the commands in the language indicated that I was missing out on a lot of things that Lisp could do, and this series of posts was intended to allow me to familiarize myself with the other parts of the language.  To that end, I made sure not to skip any entry merely because I wasn’t clear on its definition.  Some experimentation, searching the web, and checking through source code of packages and Lisp implementations allowed me to grasp those functions.

So, for me, this was a useful project, and I’d recommend doing something like it to a newcomer who is trying to get a better grasp of Common Lisp.  As with any language, understanding your tools is immensely important, not just to avoid reinventing features with your own special bugs, but also to help in the layout and planning of your code before you start writing.

There’s one more thing a newcomer to Lisp should do, and that is really get a firm grasp of macros.  We know that C and C++ discourage C-preprocessor macros, for valid reasons, but Lisp macros are a very different species, and once you understand their power, it opens up entire new realms of possibilities.  There are those who claim that a good understanding of Lisp macros even helps when programming in other languages, and perhaps that’s true, at least for some.  I think an understanding of Lisp macros helps the programmer to think of the algorithms themselves in an abstract way, just as algorithms help the programmer think of data in an abstract way, and that that abstraction leads to a more complete understanding of the problem.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

*

反垃圾邮件 / Anti-spam question * Time limit is exhausted. Please reload CAPTCHA.