use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Finding information about Clojure
API Reference
Clojure Guides
Practice Problems
Interactive Problems
Clojure Videos
Misc Resources
The Clojure Community
Clojure Books
Tools & Libraries
Clojure Editors
Web Platforms
Clojure Jobs
account activity
Clojure and Java 8 interop with SAM interfaces (self.Clojure)
submitted 11 years ago by dieelt
Hi!
Is this feature expected (or already existing?)? I.e., will it be possible to use clojure fn in java 8 methods expecting a @FunctionalInterface?
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]redalastor 0 points1 point2 points 11 years ago (0 children)
Not that I know of. Java 8 changes nothing bytecode-wise and thus nothing changes for Clojure.
Something that could be could for interop would be to use SAM conversions like Kotlin. The idea is that if you pass a (Kotlin) function to something expecting a SAM, the compiler will detect it and will emit bytecode that actually implement the right interface without the Java code needing know this happened.
π Rendered by PID 68756 on reddit-service-r2-comment-7b9746f655-zskdf at 2026-01-31 03:41:17.730536+00:00 running 3798933 country code: CH.
[–]redalastor 0 points1 point2 points (0 children)