Try...
(.isArray (type (.toCharArray "Clojure"))) => true
On Sunday, July 1, 2012 9:35:38 AM UTC-6, Warren Lynn wrote:
>
> Somebody asks me to add handling of Java array in clj-cc/last. But I am
> confused what will be the type of Java array in Clojure. Fox example:
>
> (type (.toCharArray "Cloj
The idea of dynamic protocol extension on types is very cool. I use that in
adding support of Java arrays in 'last'. Thank you.
On Sunday, July 1, 2012 1:20:24 PM UTC-4, David Nolen wrote:
>
> The set of Java array types is open. You can however extend array
> classes as you encounter them at ru
The set of Java array types is open. You can however extend array
classes as you encounter them at runtime.
http://dosync.posterous.com/51626638
David
On Sun, Jul 1, 2012 at 1:17 PM, Warren Lynn wrote:
>
> So if I want to extend a protocol to all Java arrays, is there a single type
> I can use?
So if I want to extend a protocol to all Java arrays, is there a single
type I can use? Sounds like not. So I need to extend the protocols to char
arrays, int arrays and etc?
On Sunday, July 1, 2012 12:20:19 PM UTC-4, dennis wrote:
>
> (type (.toCharArray "Clojure")) is a class, [C means an a
If you want to check if something is an array:
(.. x getClass isArray)
David
On Sun, Jul 1, 2012 at 11:35 AM, Warren Lynn wrote:
> Somebody asks me to add handling of Java array in clj-cc/last. But I am
> confused what will be the type of Java array in Clojure. Fox example:
>
> (type (.toCharAr
Somebody asks me to add handling of Java array in clj-cc/last. But I am
confused what will be the type of Java array in Clojure. Fox example:
(type (.toCharArray "Clojure")) => [C ;; Note: it looks like
garbage. but that is what I actually got
(isa? (type (.toCharArray "Clojure")) j