Hacker News new | ask | show | jobs
by kazinator 705 days ago
Also, this:

  (defmacro macro-time (&rest forms)
    `(quote ,(eval `(progn ,@forms))))
forms are evaluated at macro-expansion-time, and their result is quoted, and substituted for the (macro-time ...) invocation.

For instance, if we have a snarf-file function which reads a text file and returns the contents as a string, we can do:

  (macro-time (snarf-file "foo.txt"))
and we now have the contents of foo.txt as a string literal.