leiningen

Why does leiningen make a directory hierarchy? Can I dispense with it?

穿精又带淫゛_ 提交于 2019-12-13 13:18:01
问题 If I create a new clojure project with leiningen, it makes a directory tree like so: . |-- doc | `-- intro.md |-- project.clj |-- README.md |-- src | `-- hello_friend | `-- core.clj `-- test `-- hello_friend `-- core_test.clj Often, all I want is a single clojure file, and I want to use leiningen to handle libraries and start a repl. I've got two questions: (1) Is is possible to get leiningen to work properly with this structure . |-- project.clj `-- hello.clj which I'd greatly prefer. (In

Project organization and cljsbuild config to require namespace

二次信任 提交于 2019-12-13 06:06:30
问题 How do I organize my project structure and configure cljsbuild to require my own namespace? For example in my project/src-cljs folder I have: └── project ├── file1 │ └── file1.cljs ├── file2 │ └── file2.cljs └─── required └── required.cljs I'd like file1.cljs (namespaced as file1.file1 ) and file2.cljs (namespaced as file2.file2 ) to require required.cljs (namespaced as required.required ). My :cljsbuild looks like: :cljsbuild {:builds [{:source-paths ["src-cljs/project/file1"] :compiler {

Git Bash for Windows not working 'lein repl' command

两盒软妹~` 提交于 2019-12-12 21:54:01
问题 I'm actually using git bash instead of default windows command shell (cmd). But I cannot run 'lein repl' in git bash. It doesn't show anything and I must press crtl + c to regain control. Any suggestion? Thank you. -- EDIT I'm running lein instead of lein.bat because I added alias lein=lein.bat in my .bashrc, so I don't think it is a problem. lein run is working fine in Git Bash and leiningen works fine in windows cmd. The problem is explicity with lein repl . When I run which lein I got

Leiningen compiling error with Java files that reference classes generated from Clojure files

纵饮孤独 提交于 2019-12-12 15:28:34
问题 I have a Leiningen project that is compiling both Java and Clojure files. The Java files import some of the classes that are generated from the Clojure files (with gen-class). When I do lein compile, I get compilation errors on the imports in the Java files (saying it can't find the classes). If I remove the Java files from the project, do lein compile, add the Java files back, and do lein compile again, everything works fine. So, it's like the Clojure files need to be compiled before the

lein repl error:Connection refused

你。 提交于 2019-12-12 14:19:28
问题 I installed leiningen on my Ubuntu, but it throws a "Connection refused" error when I run lein repl . Here's the error: $ lein repl Exception in thread "Thread-4" java.net.ConnectException: Connection refused at java.net.PlainSocketImpl.socketConnect(Native Method) at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339) at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200) at java.net.AbstractPlainSocketImpl.connect

java.lang.NoSuchMethodError: clojure.lang.KeywordLookupSite when running Leiningen

时间秒杀一切 提交于 2019-12-12 12:34:00
问题 I have just downloaded Leiningen but I cannot manage to run it. After downloading its own Jar archive, the script fails with a java error. By running bash -x lein I can see that it hangs at this line: + exec java -Xbootclasspath/a:/home/andrea/.m2/repository/org/clojure/clojure/1.2.1/clojure-1.2.1.jar -client -Dleiningen.original.pwd=/home/andrea/bin -cp /home/andrea/.clojure/clojure.jar:::::test/:src/:resources/:/home/andrea/.lein/self-installs/leiningen-1.6.2-standalone.jar clojure.main -e

Where should the file user.clj go?

蹲街弑〆低调 提交于 2019-12-12 11:20:50
问题 I am trying to setup proto-repl atom-editor package and apparently it needs a file user.clj to exist somewhere - which I guess is some leiningen's init file. Where should I create this file? 回答1: Clojure will load the file user.clj from your class path if it is found. In a default leinengen project src/ will be on the class path, so if you create src/user.clj the contents of that file will be loaded in the context of the user namespace. user is the default namespace for the clojure repl, but

Setting a project property to a non literal string appears to not work in leiningen

对着背影说爱祢 提交于 2019-12-12 09:54:12
问题 Take a simple project file: (defproject sample-clojure-cloudbees "1.0.0-SNAPSHOT" :description "Sample clojure application - clojure 1.3 !" :blah "hello") When I read (get project :blah) I get "hello" string returned - as expected. If I replace "hello" :blah (slurp "some file...") I get an error, Caused by: java.lang.ClassCastException: clojure.lang.PersistentList cannot be cast to java.lang.String It seems to not be evaluating things how I expect, any ideas? 回答1: defproject is a macro it won

Improving startup time of Clojure REPL with Leiningen on the Raspberry Pi

浪子不回头ぞ 提交于 2019-12-12 08:19:32
问题 I got a Rasperry Pi 512 MB version (late 2012) and installed the Developer Preview of Java SE 8 for ARM on it. When I create a new Clojure project with Leiningen and launch the nREPL by doing lein repl it takes a bit more than two minutes (roughly 130 - 140 seconds) until the REPL has been initialized and can be used. When launching the JAR file directly java -jar clojure-1.4.0/clojure-1.4.0 the REPL starts up in 25s. I'm using fast class 10 SD cards (SanDisk Extreme with up to 30 MB/s). How

How does one pre-load a clojure file in the leiningen repl?

那年仲夏 提交于 2019-12-12 07:49:55
问题 I have some clojure functions that I would like pre-loaded when I start the clojure REPL. The functions aren't much use unless you are using them within the context of a REPL. If it helps, I generally use leiningen to start a clojure REPL for me. How can I tell clojure (or leiningen, if it's not available through flat clojure) to pre-load a clojure file containing these definitions for me? 回答1: There are several ways to do this described in the leiningen sample project one of my favorite