When lein sets up a project, a core.clj file is created along with other directories and files. I want to know if I can split core.clj’s content off to another source file under
../myproj/src/myproj/
and if so, how to access that data from core.clj.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
IIRC (I don’t have a project handy to check), everything in your
src/myproj/directory is in the'myprojnamespace. So yourcore.cljfile will be in the namespace'myproj.core. Other files will be in their own namespaces within the'myprojnamespace (e.g.'myproj.other-fileforother_file.clj), and can be pulled intocore.cljby doing:or, in an
nsdeclaration: