An Oldie but Goodie

I stumbled across this list of Lisp idioms on Hacker News yesterday. I’ve seen it before and if you’ve been around for a while, you probably have too. Still, it’s always fun to read it again. I enjoy the terse elegance of the little snippets of code. Who would not be charmed by this one-liner to take the transpose of a matrix (stored as a list of rows)?

(apply #'mapcar (cons #'list matrix))
This entry was posted in Programming and tagged . Bookmark the permalink.