clojure-dev

Issues: https://clojure.atlassian.net/browse/CLJ | Guide: https://insideclojure.org/2015/05/01/contributing-clojure/
2019-10-17T16:39:57.001600Z

Since Clojure now mandates Java8 as there been prior discussion around making functions implement the java.util.Function methods to make interop with Java APIs that make heavy use of it a bit more seamless?

2019-10-17T16:41:01.001900Z

If not, is it a discussion worth having 🙂

ghadi 2019-10-17T16:43:56.002400Z

have been thinking about various approaches @pyr

ghadi 2019-10-17T16:44:16.002900Z

there is some discussion in this room if you can find the archives

ghadi 2019-10-17T16:45:13.003800Z

one approach is to make IFn implement some of those things in j.u.f (which ones? why?)

ghadi 2019-10-17T16:45:53.004600Z

another approach is to enhance host interop calls to be smarter and auto-add interfaces

2019-10-17T16:47:34.006300Z

auto-add interfaces, you mean based on function arities?

ghadi 2019-10-17T16:48:17.006500Z

do we want to have nice interop with all functional interfaces, including ones that don't live in java.util.function?

ThreadLocal.withInitial(() -> new Whatever());   // creates a Supplier

Thread.currentThread().setUncaughtExceptionHandler((thread, throwable) -> doSomething());  // a Thread$UncaughtExceptionHandler

ghadi 2019-10-17T16:49:05.007200Z

Java creates lambdas contextually

ghadi 2019-10-17T16:49:45.007900Z

and they don't have to be in java.util.function -- any interface with one abstract method will do

2019-10-17T16:50:30.008200Z

ok

ghadi 2019-10-17T16:50:46.008400Z

"It's complicated"

🤯 1
2019-10-17T16:50:53.008700Z

indeed

ghadi 2019-10-17T16:51:26.009800Z

right now, you can go pretty far with macros to make it nicer

ghadi 2019-10-17T16:51:47.010300Z

😵 1
2019-10-17T16:54:08.010800Z

thanks

alexmiller 2019-10-17T17:59:34.011600Z

although it is already on the list for 1.11 consideration

schmee 2019-10-17T18:22:50.011800Z

there’s also https://github.com/ajoberstar/ike.cljj