[External] : Re: Synchronous executor interface
Ron Pressler
ron.pressler at oracle.com
Thu Aug 10 21:02:15 UTC 2023
> On 9 Aug 2023, at 12:29, Attila Kelemen <attila.kelemen85 at gmail.com> wrote:
>
>
>
> That is only partially applicable, because then I would have to fix T at the declaration time, and I can't do that, because it can be different for each invocation place. So, technically it should be a function of `<T> (T) -> T` (being very liberal with my notation), but that is not even a functional interface in Java (which actually annoys me more often than I would have expected it).
????
class Wrap {
public static void main(String[] args) {
String x = run(() -> "hi", Wrap::withMessage);
System.out.println(x);
}
static <T> T run(Supplier<T> s, Function<Supplier<T>, Supplier<T>> mapper) {
return mapper.apply(s).get();
}
static <T> Supplier<T> withMessage(Supplier<T> s) {
return () -> {
System.out.println("before");
try {
return s.get();
} finally {
System.out.println("after");
}
};
}
}
> only be truly relevant in the next LTS.
If by “LTS” you're referring to the support service that Oracle’s sales team offer for some releases that they pick to help legacy applications then it is unrelated to OpenJDK and the development of features (even if the number of people who are using them is larger due to widespread misunderstandings). We let sales pick their LTS and try to ignore it in the development process.
— Ron
More information about the loom-dev
mailing list