this post was submitted on 07 Dec 2024
0 points (50.0% liked)

Clojure programming language discussion

484 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 5 years ago
MODERATORS
 

extend-protocolでClass/forName怒られるワケ

https://blog.valerauko.net/2024/12/07/why-no-class-forname-in-extend-protocol/

Clojureでプロトコルをよく使う。defprotocolで作ってextend-protocolで各種の型に実装すると、いろんな入力値にスムーズに対応できる。例えば暗号化周りで、ハッシュや署名の算出のためにバイト配列が必要な際、プロトコルを活かしていい感じのAPIが提供できる。 (defprotocol Byteish (->bytes ^bytes [input])) (extend-protocol Byteish String (->bytes [input]...

#clojure #clj #cljs [email protected] @clojure

no comments (yet)
sorted by: hot top controversial new old
there doesn't seem to be anything here