Welcome! Please see the About page for a little more info on how this works.

+1 vote
in Java Interop by
retagged by

Is there an easy way to work with java.utils.Optional values in Clojure? I'm currently using 1.12 so I can say things like (Optional/.orElse foo nil) to convert the optional value to a "normal" value (X or nil), but that and other Optional methods are still sources of tension or boilerplate compared idiomatic Clojure constructs (some-> for example).

If such a way doesn't currently exist, can it be considered for addition to Clojure? Maybe opening up deref to work on Optionals as well.

1 Answer

+1 vote
by
...