Replies: 2 comments
-
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Beta Was this translation helpful? Give feedback.
0 replies
-
I'm not exactly sure what you are expecting in this issue. It seems to be at odds with #812? I'll convert this to a Github Discussion instead. With enough good information we can then make an actionable issue. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
When inside the definition of a defrecord, one can implement protocol or interface methods and make direct use of the record fields by name, but it can also use interop like
(.name this)
or(.-name this)
, or it can use keyword/get like(:name this)
and(get this :name)
.Alex Miller says it's preferred to use the names directly as such:
While the above and the two interop forms all compile to the same exact byte code, it seems they are bad form. For one, I think they might not be portable to ClojureScript (haven't verified), but they're also just more cumbersome and seems unidiomatic in this case.
And the use of keyword or get for access will compile to a slower ILookup.
I think it would be nice to lint for this, and offer a Warn or some lesser level for it.
Beta Was this translation helpful? Give feedback.
All reactions