Doc that __hash is a reserved defrecord field name


If you look a the docstring for defrecord in Clojure and compare to ClojureScript, you will see that ClojureScript doesn't mention that __hash is a reserved field name.

This should be mentioned, as it is used internally in the ClojureScript implementation of defrecord.

As an aside, while __hasheq is reserved in Clojure, there doesn't appear to be a reason to indicate it is reserved in ClojureScript. (The relevant Clojure commit is

Also, in both Clojure and ClojureScript, fields documented as reserved for defrecord are also documented as such for deftype. It is not immediately clear to me why this is done, so in my mind it is an open question as to whether __hash should be documented as reserved in the ClojureScript deftype docstring.




Mike Fikes
September 6, 2020, 12:20 AM

With CLJS-3062-2.patch (unchanged portions elided):

Seçkin Kükrer
September 5, 2020, 7:19 PM

Thank you for point out. Solved in the second patch.

Mike Fikes
September 5, 2020, 6:58 PM

One minor thing: It would be nice if the touched lines were wrapped to result in a consistent line lenght. (You can see an example of this wrapping in the original Clojure commit.)

Seçkin Kükrer
September 5, 2020, 6:52 PM

the link about `__hashheq` is not reachable. But, I believe we do not need to set it reserved. I couldn’t find any usage for that symbol.

Your pinned fields
Click on the next to a field label to start pinning.


David Nolen


Mike Fikes