The first version will not work the way you probably want. It is evaluated once during let, and heywill be bound to the value nil. that is, the value heywill not be a function.
The second is wonderful and easy to read. Other approaches:
(let [hey0
(letfn [(hey1 [] (println "hey1"))] (hey1))
There are no real rules for using them that I know of. I use the reader macro #()only for very short functions and letfnif I define a collection of internal functions together.
source
share