Advertisement
Guest User

Untitled

a guest
Jan 5th, 2011
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lisp 0.27 KB | None | 0 0
  1. (defmacro with-source-code [[defsym name & body :as form]]
  2.   `(~defsym ~(with-meta name {:source-code `'~form}) ~@body))
  3.  
  4. (defmacro get-source-code [var-name] `(:source-code (meta (var ~var-name))))
  5.  
  6. (with-source-code (defn foobar [x y] (/ x y)))
  7.  
  8. (get-source-code foobar)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement