Skip to content

Instantly share code, notes, and snippets.

@fogus fogus/ary.clj
Created Oct 13, 2010

Embed
What would you like to do?
(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

This comment has been minimized.

Copy link

commented Oct 14, 2010

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
You can’t perform that action at this time.