[ANN] Clojure 1.9.0-alpha12

1226 views
Skip to first unread message

Alex Miller

unread,
Sep 7, 2016, 5:15:25 PM9/7/16
to Clojure
Clojure 1.9.0-alpha12 is now available.

Try it via

- Leiningen: [org.clojure/clojure "1.9.0-alpha12"]

1.9.0-alpha12 includes the following changes since 1.9.0-alpha11:

- spec performance has been improved for many use cases
- spec explain printer is now pluggable via the dynamic var clojure.spec/*explain-out*
  which should be a function that takes an explain-data and prints to *out*
- when a macro spec fails during macroexpand, throw ex-info with explain-data payload
  rather than IllegalArgumentException
- pprint prints maps with namespace literal syntax when *print-namespace-maps* is true
- CLJ-1988 - coll-of, every extended to conform sequences properly
- CLJ-2004 - multi-spec form was missing retag
- CLJ-2006 - fix old function name in docstring
- CLJ-2008 - omit macros from checkable-syms
- CLJ-2012 - fix ns spec on gen-class signatures to allow class names
- CLJ-1224 - record instances now cache hasheq and hashCode like maps
- CLJ-1673 - clojure.repl/dir-fn now works on namespace aliases

lvh

unread,
Sep 7, 2016, 9:18:13 PM9/7/16
to clo...@googlegroups.com
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:


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 clo...@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+u...@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+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Alex Miller

unread,
Sep 8, 2016, 9:20:48 PM9/8/16
to Clojure
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.

lvh

unread,
Sep 8, 2016, 10:04:38 PM9/8/16
to clo...@googlegroups.com
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 :)

Alex Miller

unread,
Sep 9, 2016, 9:02:40 AM9/9/16
to Clojure
Regarding performance, the validation benchmark project has been updated with alpha12:

http://muhuk.github.io/validation-benchmark

Rangel Spasov

unread,
Sep 9, 2016, 8:52:27 PM9/9/16
to Clojure
Hey guys, 

I'm getting this compilation error with Alpha 12 (use the gist link)


Rangel

Alex Miller

unread,
Sep 9, 2016, 9:22:15 PM9/9/16
to clo...@googlegroups.com
The keys of an :or destructuring map should be symbols, not keywords.
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clo...@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+u...@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 a topic in the Google Groups "Clojure" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/clojure/lQ5beZB6QYE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to clojure+u...@googlegroups.com.

Rangel Spasov

unread,
Sep 9, 2016, 11:11:03 PM9/9/16
to Clojure

Alex Miller

unread,
Sep 9, 2016, 11:54:36 PM9/9/16
to clo...@googlegroups.com
Oh yeah, I fixed that one a while back. :)  I think there is a newer release of aleph with the change.

Rangel Spasov

unread,
Sep 10, 2016, 3:35:28 AM9/10/16
to Clojure
Yup- upgraded to [aleph "0.4.2-alpha8"] and it's fixed - thanks again! 
Reply all
Reply to author
Forward
0 new messages