6
Method Values (clj.social)
submitted 9 months ago by planet@clj.social to c/clojure@lemmy.ml

Method Values

http://insideclojure.org/2024/02/12/method-values/

Clojure 1.12.0-alpha6 introduced method values to Clojure and this post will explore them in a bit more depth. The olden days Clojure functions are first-class values and can easily be passed around, but a common question seen in Clojure forums...

#clojure #clj #cljs !clojure@lemmy.ml @clojure

top 1 comments
sorted by: hot top controversial new old
[-] fancyl@lemmy.world 1 points 9 months ago

This is exciting! I'll keep this in my back pocket next time I need to map a static Java method over a collection.

Does this addition also make it possible to keep a Java instance method in a map to call later? That's not a good way to explain it. But I'm thinking of how Malli schemas can have a map of options like {:encode/json name}.

With this addition, could I do {:encode/json .toString} where previously I'd need to wrap it with an anonymous function?

this post was submitted on 13 Feb 2024
6 points (100.0% liked)

Clojure programming language discussion

451 readers
1 users here now

Clojure is a Lisp that targets JVM and JS runtimes

Finding information about Clojure

API Reference

Clojure Guides

Practice Problems

Interactive Problems

Clojure Videos

The Clojure Community

Clojure Books

Tools & Libraries

Clojure Editors

Web Platforms

founded 4 years ago
MODERATORS