Monday, March 1, 2010

Revenge of the reader

Yesterday, I was compiling a function in SLIME, and I consistently got error: illegal function call messages from SBCL. The function was a pretty complicated one, and I couldn't figure out the error. I even resorted to commenting out sections, until I had an empty shell, with only the docstring. Then realization dawned — here is a simplified example of how the function looked like:

(defun foo (bar)
  "Docstring, followed by accidental dot".
  (let ((baz (1+ bar)))

Did you notice the dot? I didn't, for a while (guess I should take breaks every hour or so and rest my eyes, especially in the evening). But the reader did.