Creating a DSL: How to load a clojure file in the current context -


i trying create dsl packaging software using clojure. want define macros, functions, etc. , load file, , want of things define in same namespace file itself, if define macro abe, can use in file without using abe's qualified name.

i have far:

(binding [*ns* (find-ns 'my-namespace)]     (load-file "myfile")) 

but feeling i'm doing wrong.

also, nice have locally bound variables accessible within clojure file. this:

(let [a 1]     (binding [*ns* (find-ns 'my-namespace)]         (load-file "myfile"))) 

where a usable within myfile.

the idea allow programmer specify how package in real clojure, language extended in ways transparent programmer.

is there better way this? there better "idiomatic" way of creating dsl in clojure?


Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - Bypass Geo Redirect for specific directories -

php - .htaccess mod_rewrite for dynamic url which has domain names -