This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-06-30
Channels
- # aleph (33)
- # announcements (2)
- # architecture (1)
- # babashka (4)
- # beginners (26)
- # calva (43)
- # cider (2)
- # clerk (24)
- # clj-kondo (10)
- # clojure (75)
- # clojure-austin (1)
- # clojure-dev (4)
- # clojure-europe (31)
- # clojure-hungary (1)
- # clojure-norway (44)
- # clojurescript (4)
- # cursive (192)
- # datomic (23)
- # dev-tooling (4)
- # emacs (2)
- # fulcro (12)
- # hyperfiddle (3)
- # java (18)
- # jobs (1)
- # kaocha (3)
- # lsp (51)
- # malli (10)
- # off-topic (9)
- # pedestal (3)
- # polylith (14)
- # remote-jobs (1)
- # shadow-cljs (63)
- # vim (6)
If you mean as an argument to a Clojure function, wrap it in a function like #(UUID/randomUUID)
In Java or in Clojure?
In Java, as a Class::method method reference
From Clojure right now, you’ll need to reify a Java functional interface (but this is an area of active work)
This is a pure java question What's the type of that argument? How do I invoke the method I passed as an argument?
it depends on the method
it's being treated as some kind of functional interface, so a method that is Object f(Object) could be typed as a java.util.function.Function for example
what are you passing it to?
BiPredicate is probably the best match there
I have a couple of static methods whose only difference is which static method they're calling, equiv/equals
interface EqualityMethod {
static EqualityMethod EQUIV = clojure.lang.Util::equiv;
static EqualityMethod EQUALS = clojure.lang.Util::equals;
boolean areEquivalent(Object a, Object b);
}
As an argument to a java static method 🙂