Apparently, you cannot call a request using the record constructor:
(defrecord Foo. [id field]) (apply Foo. my-list)
does not work while reading because it does not expect Foo. in this place.
The only obvious workaround I thought of was to add a factory function:
(make-foo [id field] (Foo. id field))
which can be applied, of course.
Did I miss something? I would expect this from C # / Java, but just thought it was a little disappointing in Clojure ...
Kurt schelfthout
source share