On 13/06/13 18:16, Marshall Bockrath-Vandegrift wrote:
> "Jim - FooBar();" <
jimpi...@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