Skip to content

Instantly share code, notes, and snippets.

@Raynes
Created September 26, 2010 14:13
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 Raynes/597962 to your computer and use it in GitHub Desktop.
Save Raynes/597962 to your computer and use it in GitHub Desktop.
user=> (defmacro plus [& numbers] (cons + numbers))
#'user/plus
user=> (macroexpand '(plus 1 2 3))
(#<core$_PLUS_ clojure.core$_PLUS_@b4c69> 1 2 3)
user=> (plus 1 2 3)
6
user=> (defmacro plus [& numbers] (apply list + numbers))
#'user/plus
user=> (macroexpand '(plus 1 2 3))
(#<core$_PLUS_ clojure.core$_PLUS_@b4c69> 1 2 3)
user=> (plus 1 2 3)
6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment