Advertisement
Guest User

Untitled

a guest
Jan 23rd, 2019
228
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. (defmacro to-hash
  2.   "Convert expression into hasmap.
  3.  Example:
  4.  => (to-hash (+ 1 2))
  5.  {(+ 1 2) 3}"
  6.   [arg] `{'~arg ~arg})
  7.  
  8. (defmacro log
  9.   "Log expression to console and execute it.
  10.  Example:
  11.  => (log (+ 1 2))
  12.  [#inst \"2019-01-23T09:02:52.479-00:00\" {:line 1, :column 1} ((+ 1 2))]
  13.  3"
  14.   [& body]
  15.   `(do
  16.       (println [(java.util.Date.) ~(meta &form) '~body])
  17.       (do ~@body)))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement