Created
August 22, 2014 05:09
-
-
Save immoh/d67eb0d2ff347de43c97 to your computer and use it in GitHub Desktop.
Clojure ampersand weirdness
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ; REPL-y 0.3.2, nREPL 0.2.3 | |
| ; Clojure 1.6.0 | |
| ; Java HotSpot(TM) 64-Bit Server VM 1.7.0_21-b12 | |
| (let [& 1] &) | |
| ;=> 1 | |
| (let [[&] [1]] &) | |
| ;Exception Unsupported binding form: clojure.core/destructure/pb--4583 (core.clj:4103) | |
| (defn f [&] &) | |
| ;CompilerException java.lang.RuntimeException: Unable to resolve symbol: & in this context, compiling:(/private/var/folders/xz/d8ctt91s5n51kbwcb01z1m740000gn/T/form-init1123058310639178637.clj:1:1) | |
| (defn g [&] 1) | |
| ;=> #'user/g | |
| (g 1) | |
| ;ArityException Wrong number of args (1) passed to: user/g clojure.lang.AFn.throwArity (AFn.java:429) | |
| (g) | |
| ;=> 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment