Problems starting with Clojure and Leiningen and Light Table

716 views
Skip to first unread message

Zeynel

unread,
Oct 1, 2013, 6:26:07 AM10/1/13
to clo...@googlegroups.com
I was hoping that someone here can help me to start with Clojure. Nothing seems to be working now. This is the thread with question about Light Table https://groups.google.com/forum/#!topic/light-table-discussion/Nif7b82DrzY. Light Table cannot connect to the project. 

This is the question about Leiningen: http://stackoverflow.com/questions/19105792/creating-a-new-project-with-leiningen-in-windows-7 I am unable to create a new project with Leiningen. 

Can anybody help me resolve these issues? Unfortunately, I am on Windows 8 working as Windows 7. I hope to switch to Mac but it's too expensive.

I also downloaded Emacs and I am learning that. Is it better to use Emacs repl instead of Light Table? I don't know how to do that yet, I am still learning the basics of Emacs.

Shantanu Kumar

unread,
Oct 1, 2013, 6:45:16 AM10/1/13
to clo...@googlegroups.com
Hi Zeynel,

I suspect you are fighting too many challenges at once. I would suggest that you get Leiningen working first, then try a simple editor that you are most comfortable with. Which Leiningen version are you using? Make sure it's the latest version. What error message are you getting? Do not create a project in C:\Windows\system32 directory. Try it thus (I assume lein.bat is on your PATH):

C:\> mkdir \work
C:\> cd \work
C:\work> lein new app foo
C:\work> cd foo
C:\work\foo> lein repl

Once you are at the REPL in Windows, you can press Ctrl+Z followed by <Enter> to quit.


Shantanu

George Oliver

unread,
Oct 1, 2013, 11:04:31 AM10/1/13
to clo...@googlegroups.com
To add to Shantanu's directions, if you receive an error when doing mkdir in C:\ it's probably because your user account doesn't have permissions to create directories there. At that point you have two basic options:

1) use a user account with admin privileges to do all your work (not recommended)
2) create your work account in your user directory (e.g. C:\Users\Zeynel\work)

To add lein to your PATH, follow these steps:



Peter Mancini

unread,
Oct 1, 2013, 5:36:51 PM10/1/13
to clo...@googlegroups.com
At home I'm working in Win 8, Light Table and Lein with no issues. So, have hope and save the money you'd spend on Apple products for fine arts investment or arctic expeditions. :-)

First get lein working. If you do nothing else that will get you very far. You'll need a version of curl for windows. Get that installed and tested. Make sure you can call it anywhere.

Once you get the lein install script working, make sure you deal with any errors. If it worked fine do:

Lein new testprj
cd testprj/src/testprj
lein repl

(print "Hello World!")

Good luck.

Peter Mancini

unread,
Oct 1, 2013, 5:39:52 PM10/1/13
to clo...@googlegroups.com
Also, forgot to add, emacs is awful to learn on. Too many issues come with it. Its a lot to ask anyone to learn Clojure and emacs at the same time. In my honest opinion you get no benefit. LT's instatepl is awesome and the latest interface works great!

Zeynel

unread,
Oct 1, 2013, 6:39:34 PM10/1/13
to clo...@googlegroups.com
Thanks. I downloaded leiningen again and installed it and I created the folder as described above but I get this error message. Does this make sense?

C:\Users\a\work>lein new app my-app
java.lang.UnsupportedOperationException: nth not supported on this type: Symbol
        at clojure.lang.RT.nthFrom(RT.java:857)
        at clojure.lang.RT.nth(RT.java:807)
        at leiningen.core.project$dep_key.invoke(project.clj:175)
        at leiningen.core.project$reduce_dep_step.invoke(project.clj:183)
        at clojure.lang.ArrayChunk.reduce(ArrayChunk.java:58)
        at clojure.core.protocols$fn__6041.invoke(protocols.clj:98)
        at clojure.core.protocols$fn__6005$G__6000__6014.invoke(protocols.clj:19
)
        at clojure.core.protocols$seq_reduce.invoke(protocols.clj:31)
        at clojure.core.protocols$fn__6024.invoke(protocols.clj:60)
        at clojure.core.protocols$fn__5979$G__5974__5992.invoke(protocols.clj:13
)
        at clojure.core$reduce.invoke(core.clj:6177)
        at leiningen.core.project$meta_merge.invoke(project.clj:391)
        at clojure.core$merge_with$merge_entry__4279.invoke(core.clj:2698)
        at clojure.core$reduce1.invoke(core.clj:896)
        at clojure.core$merge_with$merge2__4281.invoke(core.clj:2701)
        at clojure.core$reduce1.invoke(core.clj:896)
        at clojure.core$reduce1.invoke(core.clj:887)
        at clojure.core$merge_with.doInvoke(core.clj:2702)
        at clojure.lang.RestFn.invoke(RestFn.java:439)
        at leiningen.core.project$meta_merge.invoke(project.clj:395)
        at leiningen.core.project$apply_profiles$fn__1009.invoke(project.clj:417
)
        at clojure.lang.ArrayChunk.reduce(ArrayChunk.java:58)
        at clojure.core.protocols$fn__6041.invoke(protocols.clj:98)
        at clojure.core.protocols$fn__6005$G__6000__6014.invoke(protocols.clj:19
)
        at clojure.core.protocols$seq_reduce.invoke(protocols.clj:31)
        at clojure.core.protocols$fn__6026.invoke(protocols.clj:54)
        at clojure.core.protocols$fn__5979$G__5974__5992.invoke(protocols.clj:13
)
        at clojure.core$reduce.invoke(core.clj:6177)
        at leiningen.core.project$apply_profiles.invoke(project.clj:415)
        at leiningen.core.project$init_profiles.doInvoke(project.clj:603)
        at clojure.lang.RestFn.invoke(RestFn.java:425)
        at leiningen.core.main$_main$fn__1332.invoke(main.clj:257)
        at leiningen.core.main$_main.doInvoke(main.clj:252)
        at clojure.lang.RestFn.invoke(RestFn.java:436)
        at clojure.lang.Var.invoke(Var.java:423)
        at clojure.lang.AFn.applyToHelper(AFn.java:167)
        at clojure.lang.Var.applyTo(Var.java:532)
        at clojure.core$apply.invoke(core.clj:617)
        at clojure.main$main_opt.invoke(main.clj:335)
        at clojure.main$main.doInvoke(main.clj:440)
        at clojure.lang.RestFn.invoke(RestFn.java:482)
        at clojure.lang.Var.invoke(Var.java:431)
        at clojure.lang.AFn.applyToHelper(AFn.java:178)
        at clojure.lang.Var.applyTo(Var.java:532)
        at clojure.main.main(main.java:37)
C:\Users\a\work

Zeynel

unread,
Oct 1, 2013, 6:41:32 PM10/1/13
to clo...@googlegroups.com
Thanks. Now I got a different error copied above to my answer to Shantanu. I used Windows installer to reinstall leiningen and that takes cares of adding leing to the PATH. Is this a problem?

Zeynel

unread,
Oct 1, 2013, 6:50:05 PM10/1/13
to clo...@googlegroups.com
Thanks. I am glad to hear that Light Table and Lein are working on Windows 8. I am using a wrapper to have the start button, but I did not have any problems related to that so far.

I checked curl's site but I wasn't sure why I need it. I installed Lein using Windows installer and that worked. But when I enter 

C:\work> lein new app foo

as suggested by Shantanu I get the error message the first line of which is 

C:\Users\a\work>lein new app my-app
java.lang.UnsupportedOperationException: nth not supported on this type: Symbol
...

What does this mean?

Zeynel

unread,
Oct 1, 2013, 6:54:19 PM10/1/13
to clo...@googlegroups.com
I understand this, and I want to continue with Light Table, I liked it too. And the error pasted above is the same error that Light Table gives. I asked the same question in Light Table forum but there were no answers yet about the error message. https://groups.google.com/forum/#!topic/light-table-discussion/Nif7b82DrzY

Zeynel

unread,
Oct 1, 2013, 7:06:22 PM10/1/13
to clo...@googlegroups.com
There is an explanation of the error message here http://dev.clojure.org/jira/browse/CLJ-5 but I did not understand if there is a fix or what causes the error.

Zeynel

unread,
Oct 1, 2013, 8:57:30 PM10/1/13
to clo...@googlegroups.com
Thanks everyone. I reinstalled Lein this time without using the window installer and it is now working. Thanks, again.


On Tuesday, October 1, 2013 6:26:07 AM UTC-4, Zeynel wrote:

Peter Mancini

unread,
Oct 2, 2013, 12:41:12 PM10/2/13
to clo...@googlegroups.com
Ok, so you did not get lein working. If it were working you would not have problems creating a new project. I know you are eager to press forward. Admirable. However, it is what we call initiative without judgement. In the world of engineering that is considered ill-advised. So, lets get back to square 1.

Delete everything involving lein from your machine. Purge your path and other env variables of it as well. Start again.

First, validate you have Java 7.

Second, follow this again, to the letter. http://leiningen-win-installer.djpowell.net/

Third create a new project with "lein new myproject". Change directory to myproject/src/myproject and see if it created a core.clj file.

If anything fails return to that step and look to see what the issue is. You have to be more methodical. Every time you make more than one change you create branching error probabilities. Do that 3 times and you have 8 times as many possible root causes for errors. Do it more and the perplexity increases geometrically.

Zeynel

unread,
Oct 2, 2013, 8:28:04 PM10/2/13
to clo...@googlegroups.com
Ok. I created a project and there is core.clj file and I also ran the failing tests included in the project file. One thing I noticed the installer didn't do is that it did not put a shortcut to closure REPL on the start menu. I am just starting the windows command line from the start menu.

Gary Verhaegen

unread,
Oct 3, 2013, 12:58:12 PM10/3/13
to clo...@googlegroups.com
That is because the repl is specific to a given project, so there would not be much point in a general shortcut (or it would require more work than juste wrapping the commandline repl, such as a gui to beowse the filesystem to a given project).

You have to start the repl from the root folder of your project. Then the repl loads all of the code from your project and can actually work as it is intended.
--
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clo...@googlegroups.com
Note that posts from new members are moderated - please be patient with your first post.
To unsubscribe from this group, send email to
clojure+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to the Google Groups "Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clojure+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
Reply all
Reply to author
Forward
0 new messages