Re:Data Classes for Java
by emidln on Wednesday November 01, 2017 @10:18PM
(#15607305)
In clojure I'd write this, if I actually needed a class for type dispatch or interface implementation for some reason.
The nice thing is that I could also skip the defrecord if I just want enforcement of the shape of the data by making a similar defschema and then I'd just use plain maps.
[ Parent
| on HN ]
Re:Data Classes for Java
by billrobertson42 on Saturday November 04, 2017 @02:49PM
(#15626346)
I mucked around with records a lot early on while learning Clojure, and I'm not really sure when I stopped and just started using maps. Now it's second nature and I'd only consider using a record if there was some overriding performance concern.