Thanks for investigating this in-depth, Alex! Very much appreciated :) Sorry about filing the issue in several places; I genuinely wasn’t sure where the problem was :)
> On Sep 8, 2016, at 8:20 PM, Alex Miller <a...@puredanger.com> wrote: > > I've commented on this in multiple other places but for the sake of > completeness... > > Datascript is extending some defrecords to the IHashEq protocol to add custom > hash caching. In particular, this extension is adding custom fields __hash > and __hasheq, which happen to be the (obvious) names of the new fields added > in alpha12 via CLJ-1224 to support built-in hashcode caching (like maps). > > Records are designed to hash like maps and to have hashing provided by the > language, not customized by the user. Due to this, and to the use of fields > with __-prefix, I consider the existing Datascript code to be invalid. I have > examined all uses of __hash fields and IHashEq on Github (many many pages of > results) and have found no other examples of this in tandem with defrecord. > > Note that deftype does NOT provide a hashing mechanism - deftypes are not > given map capabilities, hashing, or many of the things provided automatically > by defrecord. It is thus common, acceptable, and encouraged for deftype users > to provide a hashing strategy appropriate to the deftype. My comments above > apply only to defrecord, not to deftype. > > Datascript should either remove these extensions or switch to using deftype > for these use cases. > > On Wednesday, September 7, 2016 at 8:18:13 PM UTC-5, lvh wrote: > CLJ-1224 appears to have broken Datascript, which now doesn’t compile: > > Exception in thread "main" java.lang.AssertionError: The names in #{__hash > __meta __hasheq __extmap} cannot be used as field names for types or > records., compiling:(datascript/db.cljc:369:1) > > The ticket mentions CLJS compat; it looks like it only adds __hash in CLJ: > > https://github.com/tonsky/datascript/blob/0684c4102706bf4ee8b2496ad35c32ced08640fc/src/datascript/db.cljc > > <https://github.com/tonsky/datascript/blob/0684c4102706bf4ee8b2496ad35c32ced08640fc/src/datascript/db.cljc> > > Not sure what the ideal way to solve this is… > > > lvh > > -- > 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 > <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 > <mailto:clojure+unsubscr...@googlegroups.com>. > For more options, visit https://groups.google.com/d/optout > <https://groups.google.com/d/optout>. -- 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/d/optout.