Skip to content

Instantly share code, notes, and snippets.

@hugoduncan
Created March 2, 2010 01:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hugoduncan/319010 to your computer and use it in GitHub Desktop.
Save hugoduncan/319010 to your computer and use it in GitHub Desktop.
(defmacro with-line-number
"Record the source line number"
[& body]
`(do (defvar- ln# nil)
(binding [*script-line* (:line (meta (var ln#)))
*script-file* (:file (meta (var ln#)))]
~@body)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment