this post was submitted on 25 Oct 2025
1 points (100.0% liked)

Clojure programming language discussion

612 readers
5 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 6 years ago
MODERATORS
 

Creating code on the fly using Clojure eval

https://clojure-diary.gitlab.io/2025/10/25/creating-code-on-the-fly-using-clojure-eval.html

Code ;; defining_functions_on_the_fly.clj (eval (def x 1)) x (def map-vals {:a 10 :b 20 :c 30}) (doseq [[k v] map-vals] (eval (defn ~(symbol k) [] ~v))) (a) (b) (c) (def planets ["Earth" "Mars" "Venus" "Jupiter"...

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

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