Skip to content

Instantly share code, notes, and snippets.

@fogus
Created October 13, 2010 18:53
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fogus/624638 to your computer and use it in GitHub Desktop.
Save fogus/624638 to your computer and use it in GitHub Desktop.
(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"]]))
@michel-slm
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment