I’m wondering if/how there is a better way to write Clojure, where in the equivalent java code you’d have a method reference.
Take java.time.DatetimeFormatter’s parse method for example. In java you could write:
The second arg is declared to be a TemporalQuery, a SAM in the java jargon, so you can just pass a method reference of a java method that has the same signature as the one method in TemporalQuery.
The following, equivalent code works in Clojure, but is there a neater way to write it?
(.parse formatter text (reify TemporalQuery (queryFrom [_ x] (LocalDate/from x))))