Alan <a...@malloys.org> writes:

Hi Alan,

> That error message is coming from some use of (case), usually in your
> code but conceivably from somewhere in Clojure.  It tries to do some
> clever bit-fiddling to generate a constant-time-dispatch on the
> hashcodes of its clauses, and if that fails it throws a compiler error
> (arguably it could degrade into to a cond, but it doesn't).
>
> Given that you don't use case at all, and the backtrace suggests the
> case call is in dispatching for the protocol, it sounds to me like a
> bug in the protocol dispatcher.

I would have preferred a bug in my code...

> Caused by: java.lang.IllegalArgumentException: No distinct mapping
> found
>  at clojure.core$min_hash.invoke (core.clj:5270)
>     clojure.core$expand_method_impl_cache.invoke (core_deftype.clj:
> 403)
>     clojure.core$_cache_protocol_fn.invoke (core_deftype.clj:472)
> funql.core$eval293$fn__294$G__284__309.invoke (core.clj:408)
> funql.core$eval324$fn__325$fn__328.invoke (core.clj:432)
>     clojure.lang.LazySeq.sval (LazySeq.java:42)
>     clojure.lang.LazySeq.seq (LazySeq.java:63)
>     clojure.lang.RT.seq (RT.java:450)
>     clojure.core$seq.invoke (core.clj:122)
>
> So line 432 calls iseq, and the macroexpansion of your code at line
> 408 calls into some kind of internal protocol-dispatch-cache, which
> tries to do a minhash in order to figure out how to switch through a
> case block, which barfs.

If it helps, I checked out the current clojure git sources and added the
keys argument of `min-hash' to the exception message.  keys is a seq of
java.lang.Class objects (~300):

  
(de.uni_koblenz.jgralab.grabaja.java5schema.impl.std.ReversedIsCalledByMethodImpl
  de.uni_koblenz.java.impl.std.arrays.ArraySelectorImpl [..............]
  
de.uni_koblenz.jgralabtest.schemas.greqltestschema.impl.std.junctions.CrossroadImpl
  de.uni_koblenz.java.impl.std.statements.ExpressionStatementImpl)

This seq contains the implementation classes of all my loaded graph's
metamodels.  Beside these Impl-classes, those all have a defining
interface, and those line up to a top-level inheritance hierarchy

                       AttributedElement
                        /             \
              GraphElement           Graph
              /          \
          Vertex        Edge

which are the types my protocols dispatch on.

I'm happy to help with any debugging, patch-testing, whatsoever.

Bye,
Tassilo

-- 
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

Reply via email to