Do lispers use macros often?

Submitted by Greg Buchholz on Fri, 11/11/2005 - 4:36pm.

Do lispers use macros often, or is that a misconception? I don't know, but here's one data point. Since Peter Seibel's book Practical Common Lisp is online, I thought I'd do a little investigation. With a little wget, lynx, and perl magic I analyzed the word frequency of the book. The word "macro" or one of its forms (such as macrophobic and macrophobia) occur 810 times. For reference, here are the words which occur more often...

  • 854 => 1
  • 875 => name
  • 876 => or
  • 914 => an
  • 944 => code
  • 949 => list
  • 951 => are
  • 1033 => by
  • 1114 => t
  • 1126 => if
  • 1261 => lisp
  • 1279 => value
  • 1337 => function
  • 1351 => be
  • 1402 => this
  • 1532 => as
  • 1609 => can
  • 1700 => with
  • 1781 => for
  • 1963 => it
  • 2433 => is
  • 2583 => that
  • 3329 => in
  • 3452 => and
  • 3836 => you
  • 4774 => of
  • 5951 => a
  • 5970 => to
  • 12616 => the

*Note: For the record, I personally love macros. Well, appropriate macros. Reinventing a new language syntax should be a fairly rare event. A nice language will be built from a relatively small set of powerful axioms which will preclude the need to invent new axioms all the time. Certainly "until" isn't a good example of when they should be used.