interop: fns as functional interfaces#87
Conversation
This knowledge is quite useful and has been missing from the guide.
|
That page already has two sections where Clojure 1.12's functional interface support is mentioned and code examples given (pretty much identical to what's in your new section). |
|
The first, from line 517 in the source: In Clojure 1.12, a Java interface that is declared (seq (.list (java.io.File. ".") #(str/starts-with? %2 ".")))
;;⇒ (".cpcache" ".portal" ".clj-kondo" ".lsp" ".calva")The second, from line 587 in the source: As above, in Clojure 1.12, because (import java.io.File)
;; a file filter implementation that keeps only .edn files
(let [^java.io.FilenameFilter
f (fn [_dir name]
(str/ends-with? name ".edn"))
dir (File. "/home/sean/oss/clojure-doc.github.io/")]
(into [] (.listFiles dir f)))
|
|
Hi, I see 😅 The thing is that I have not read the document in detail, I have scanned the sections for anything that looked relevant, and did not see anything. I on purpose skipped the reify sections, b/c I knew I did not want/need to use reify. Would it still make sense, to add the section as proposed, and instead adjust the two existing place that you pointed out to link to this section? I can update the draft if you think that could work... |
|
Sure, if you want to update the PR to add links / adjust wording in those existing places, as well as adding that new section, I'd appreciate that. Thanks. |
This knowledge is quite useful and has been missing from the guide.