Common Lisp format Summary

The Common Lisp format function is a bit controversial among some Lispers1. The problem is that the language used by format to specify output strings is un-Lisp like. I’m not one of those people. I like format and feel comfortable with the language2, probably because of my years cranking out C.

One of the problems with format is that its input language is very comprehensive. You can, for example, specify that a number be output in Roman numerals. Happily, Jean-Philippe Paradis has us covered with his format directive summary. It’s part of his on-going series of articles on the Common Lisp HyperSpec. It’s a nice summary and worth bookmarking for future reference.

Footnotes:

1

For those not familiar with format, it’s much like printf from C, although the formatting language is richer.

2

I’m not a complete libertine, though. I do dislike the loop macro for the same reason given by those who don’t like format: it’s input language is not Lisp.

This entry was posted in Programming and tagged , . Bookmark the permalink.