Skip to content

Instantly share code, notes, and snippets.

@hessammehr
Created December 16, 2015 06:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hessammehr/3adae2764ba3bc2cab18 to your computer and use it in GitHub Desktop.
Save hessammehr/3adae2764ba3bc2cab18 to your computer and use it in GitHub Desktop.
Cyclic dependency with quoted vars
(ns myapp.actions
:require [myapp.core :refer app-state])
(defn action1 []
(swap! app-state inc)
(ns myapp.core
(:require [myapp.settings :as settings])
(defonce app-state (atom {:a 2}))
(def on-key-press [k] ; for the sake of argument
((settings/keymap k))
(ns myapp.settings
(:require [myapp.actions :as actions])
(def keymap {\i #'actions/action1})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment