require clojure libs

51 views
Skip to first unread message

Brian Craft

unread,
May 31, 2013, 8:21:18 PM5/31/13
to clojure...@googlegroups.com
Are there docs somewhere of how the module system is supposed to work? If I try to require clojure.string, or clojure.edn, or clojure.walk, etc., where will it look for them? What libs are packaged with clojurepy? How would I include more?

Antony Lee

unread,
May 31, 2013, 8:34:41 PM5/31/13
to clojure-py-dev
Clojure-py's module system directly relies on Python's import system, so it will just look up sys.path: (require 'sys) (apply list sys/path)
Right now the only packaged libs are clojure.string and clojure.set, I think.
Antony


2013/5/31 Brian Craft <craft...@gmail.com>
Are there docs somewhere of how the module system is supposed to work? If I try to require clojure.string, or clojure.edn, or clojure.walk, etc., where will it look for them? What libs are packaged with clojurepy? How would I include more?

--
You received this message because you are subscribed to the Google Groups "clojure-py-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clojure-py-de...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Brian Craft

unread,
May 31, 2013, 10:14:49 PM5/31/13
to clojure...@googlegroups.com, anton...@berkeley.edu
But what about clojure source, rather than python source?

Consider, I have clj script that requires clojure.edn. I haven't found a way to get clojurepy to resolve clojure.edn. The only thing I could get to work is putting edn.clj in the local directory and modifying the script to require edn. But this isn't a workable solution, since it requires changing all the module names.

Antony Lee

unread,
May 31, 2013, 10:44:01 PM5/31/13
to clojure-py-dev
Putting edn.clj in the clojure folder (next to core.clj, etc.: in the source checkout if you didn't run setup.py install, in .../site-packages/clojure_py-0.2.4-py2.7.egg/clojure/ otherwise), works for me (well, except that EdnReader isn't defined, but at least it finds the file).  You could also add it to the package_data in setup.py so that it gets installed together with everything (actually right now I'm wondering why string.clj isn't included).


2013/5/31 Brian Craft <craft...@gmail.com>
Reply all
Reply to author
Forward
0 new messages