-
-
Notifications
You must be signed in to change notification settings - Fork 311
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
db.cljc doesn't compile on clojure-1.9.0-alpha12 ecause of __hash #176
Comments
There is also a deftype that does this (bitset), but that shouldn't matter for now; @puredanger has suggested on Clojure Slack shouldn't do that either, though. I have filed an issue with Clojure as well, since I'm not entirely sure who eventually resolves this and how: http://dev.clojure.org/jira/browse/CLJ-2020 |
__meta and __extmap have always been off limits and marked in the docstring - I would take the __ prefix there to imply that this is a naming convention for internal stuff and suggest that datascript's use of __hash and __hasheq was treading on the obvious future field names for a record caching its hash values. I would certainly prefer datascript to switch to a different convention (or maybe remove it entirely if the new behavior satisfies the same need). |
Removing it entirely would be a performance regression on <1.9.0, right? What would be the impact of just renaming it? |
I have declined the Clojure ticket - I do not believe it should have been considered valid to modify a record's hash semantics - those are controlled by the language (and should match those of a map). If you want control over hashing, you should use a deftype, where it's perfectly ok to extend IHashEq. I would say even there that using a __-prefixed field name is inadvisable, but is ok. I cannot answer the question of performance if this code is modified. It may be necessary to use a deftype for those records prior to 1.9. |
This issue is a blocker for my work on Arachne; I am using spec heavily and will have to temporarily disable DataScript support until it works with Clojure 1.9. |
Whoa, awesome! thanks @tonsky! |
Badass, thanks! |
…sky/datascript#176 Suspected incompatibility of Datascript with newer version of Clojure. Boot compiles everything against current version.
This is used in
datascript/src/datascript/db.cljc
Line 369 in 0684c41
It's not entirely clear what the best resolution here is; if I understand correctly; the Clojure change just makes all records behave how this record already behaved anyway.
The text was updated successfully, but these errors were encountered: