GNU Emacs Lisp Reference Manual
These features permit you to write code to be evaluated during compilation of a program.
You can get a similar result by putting body in a separate file and referring to that file with require. Using require is preferable if there is a substantial amount of code to be executed in this way.
At top level, this is analogous to the Common Lisp idiom (eval-when (compile eval) ...). Elsewhere, the Common Lisp `#.' reader macro (but not when interpreting) is closer to what eval-when-compile does.