On Thu, Jun 13, 2013 at 1:52 PM, Jim - FooBar(); <jimpil1...@gmail.com>
 wrote:
>
> or can you perhaps show an example of successfully extending any protocol
> to at least 2 primitive array types?
>

You can call extend-protocol several times:

user=> (defprotocol A (foo [a b]))
A
user=> (extend-protocol A (Class/forName "[D") (foo [a b] [a b]))
nil
user=> (extend-protocol A (Class/forName "[F") (foo [a b] [a b]))
nil
user=> (foo (double-array [1 2 3]) 1)
[#<double[] [D@5a12d46c> 1]
user=> (foo (float-array [1 2 3]) 1)
[#<float[] [F@5e310a07> 1]

-- 
-- 
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/groups/opt_out.


Reply via email to