In Scheme, I can do something like this:
(define (adder)
(define (one) 1)
(define (two) 2)
(+ (one) (two)))
A call adderleads to 3, and a call oneleads to an error, because it is onedisplayed only in the area adder.
In Clojure , if I do something like this
(defn adder []
(defn one [] 1)
(defn two [] 2)
(+ (one) (two)))
oneand twowill pollute my namespace because it defnuses definternally, which creates bindings in the current namespace.
Is there a function / macro that creates named functions in a local scope?
The reason for my question is that I'm used to how the circuit works. Naming my local functions so often makes my code more readable.