• Clojure
  • 26 lines
  • 76 views
  • 11 forks
  • Pasted by anonymous on January 23, 2012
(ns aliasmacro)
(defmacro my-macro [] '())
(def #^{:macro true} mac-alias #'my-macro)

;; In REPL:
;; => (compile 'aliasmacro)
;; In a new REPL:
;; => (use 'aliasmacro)
;; => (mac-alias)
;; ArityException Wrong number of args (0) passed to:
;; aliasmacro$my-macro  clojure.lang.AFn.throwArity (AFn.java:437)
;;
;; => (mac-alias 1)
;; ArityException Wrong number of args (1) passed to:
;; aliasmacro$my-macro  clojure.lang.AFn.throwArity (AFn.java:437)
;;
;; => (mac-alias 1 1)
;; ()
;;
;; => (mac-alias 1 1 1)
;; ArityException Wrong number of args (3) passed to:
;; aliasmacro$my-macro  clojure.lang.AFn.throwArity (AFn.java:437)
;;
;; => (. (var mac-alias) (setMacro))
;; => (mac-alias)
;; ()

Did you know? CLOSE

  • There are keyboard shortcuts!
    • When Creating A Paste
      • ALT+P Toggle Private
      • CTRL+Enter Create Paste
      • ALT+W Toggle word wrap
    • When Viewing A Paste
      • ALT+G Go to a line
      • ALT+CTRL+E Edit the paste
      • ALT+R Show the raw code
  • There are URL options!
    • When Creating A Paste
      • ?lang=Javascript to default to javascript
    • When Viewing A Paste
      • #L-N Jump to line number N
?