On 13/06/13 18:16, Marshall Bockrath-Vandegrift wrote:
"Jim - FooBar();" <jimpil1...@gmail.com> writes:
CompilerException java.lang.UnsupportedOperationException: nth not
supported on this type: Character, compiling:(NO_SOURCE_PATH:1:1)
If you examine the implementation of `extend-protocol` and for how it
distinguishes between additional functions being defined for a type and
new types to which to extend the protocol, I think you’ll see what’s
going on here.
-Marshall
'extend-protocol' simply expands to a bunch of 'extend-type' forms. In
my example I used 'extend-protocol' and then 'extend-type' on a type not
included in the extend-protocol form. I did that only because I get a
compilation error when I try to provide extension points for both
'doubles' and 'floats'. That led me to pull out the code-block for
'floats' and use extend-type specifically for floats. That compiled, but
because it's using amap internally, throws the exception I mentioned
previously. The exception you've responded to is only thrown when I try
to put both extension points in the same 'extend-protocol' form or in
fact, whenever any extension for primitive arrays doesn't come first
before everything else! are the 2 problems related? where should I look
for the one error and where for the other?
thanks,
Jim
--
--
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.