Created
October 13, 2010 18:53
-
-
Save fogus/624638 to your computer and use it in GitHub Desktop.
This file contains 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
(defprotocol Foo | |
(bar [this])) | |
(extend-type (Class/forName "[Ljava.lang.String;") | |
Foo | |
(bar [this] (seq this))) | |
(bar (into-array ["a" "b"])) | |
(extend-type (Class/forName "[[Ljava.lang.Object;") | |
Foo | |
(bar [this] (seq (map seq this)))) | |
(bar (to-array-2d [["a" "b"]["c" "d"]])) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The (defprotocol ...) invocation stalls Clojure 1.2.0 on me, on Fedora Linux 14, x86_64. Tried it with Sun's 64-bit JDK 1.6.0u22 and Fedora's open-source OpenJDK. If I type it in the REPL I get nil back but never get back to the prompt
(EDIT) looks like a REPL bug; entering a number after that causes that number to be echoed and control returning to the prompt