Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;; one.clj
- (ns my.one)
- (my-atom (atom {}))
- (swap! my-atom assoc :id 1)
- (defn shorthand-get-id []
- (:id @my-atom))
- ;; two.clj
- (ns my.two)
- (my-atom (atom {}))
- (swap! my-atom assoc :id 2)
- (defn shorthand-get-id []
- (:id @my-atom))
- ;; core.clj
- (ns my.core
- (:require [my.one :as one]
- [my.two :as two]))
- ;; how to not rewrite "shorthand-get-id" in each of
- ;; one.clj and two.clj???
- (defn main []
- (prn (str "one's id " (one/shorthand-get-id) ", "
- "two's id " (two/shorthand-get-id))))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement