Doc that __hash is a reserved defrecord field name

Description

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 https://github.com/clojure/clojure/commit/a1c3dafec01ab02fb10d91f98b9ffd3241e860c0)

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.

Environment

None

Activity

Show:
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.

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, 7:19 PM

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

Mike Fikes
September 6, 2020, 12:20 AM

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

Assignee

David Nolen

Reporter

Mike Fikes

Labels

Approval

None

Patch

None

Priority

Minor
Configure