My project has a simple structure as following:
|- core.clj
|- dialogs.clj
|- dialogs/
|- name_dialog.clj
name_dialog
has a dependency from core
, and core
should require name_dialog
.
So I have dependencies like this:
core.clj
(ns ddsl.core
(:gen-class)
(:require [clojure.xml :refer :all]
[ddsl.dialogs :refer :all]))
dialogs.clj
(ns ddsl.dialogs
(:require [ddsl.core :refer :all]))
(load "dialogs/name_dialog")
name_dialog.clj
(in-ns 'ddsl.dialogs)
When I try to run the program I'm getting the following error
Cyclic load dependency: [ /ddsl/core ]->/ddsl/dialogs->[ /ddsl/core ]
Please let me know, how to restructure my project (i'm a novice in Clojure).
core
require the other namespaces? – Alticore
produces xml from clojure "template", and has-main
function that receives template name as argument, e.g. "name-dialog" and produces xml from it – Mindycore
which depend on those in other namespaces should be moved into those namespaces.core
namespaces shouldn't need to depend on other modules. – Alticore
I have function that receives name of dialog, e.g.dialog_name
, and produces xml, so that should be loaded as a module anyway? (defn -main [dialog] (emit (eval (symbol dialog)))) – Mindy