On Jun 19, 2015, at 5:08 PM, Joe Corneli <holtzerman...@gmail.com> wrote:
> This is an interaction with Clojure via CIDER.
> 
> repl [1]> (type (into-array String ["Awesome"]))
> [Ljava.lang.String;

This is a java.lang.Class object whose name is "[Ljava.lang.String;" because 
that’s how Java native arrays are encoded.

> CIDER won't let me enter [3] claiming that the input is not complete.  What's 
> going on here, apart from things not working?

You can get the Class object like this:

        (Class/forName "[Ljava.lang.String;")
        ;;=> [Ljava.lang.String; — unhelpful but this is the name of the class, 
as above.

and you can see what it really is like this:

        (.getTypeName (Class/forName "[Ljava.lang.String;"))
        ;;=> "java.lang.String[]" — that is more readable!

Sean Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/

"Perfection is the enemy of the good."
-- Gustave Flaubert, French realist novelist (1821-1880)



-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to