Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tutorial for ClojureBox [closed]

I'm trying to learn clojure. ClojureBox appears to be similar to LispBox - http: //gigamonkeys.com/lispbox/ which I've used previously.

I'm looking for a good clojure specific tutorial on using emacs as it's configured with clojurebox.

Here are some specific questions I have:

  • How do I create a new clojure file in emacs and
  • Load an existing clojure file so the forms (values, functions) are available to the REPL
  • What is a good project structure? If I have more than one file what is the best way to proceed and
  • Does Programming Clojure http: //pragprog.com/titles/shcloj/programming-clojure answer these questions?
  • Is there a better environment than clojurebox? I've tried enclojure for netbeans and it's currently broken (won't create a project correctly). Netbeans 6.7.1 and enclojure 2009-08-25-release.
like image 979
Chris Weber Avatar asked Oct 22 '09 14:10

Chris Weber


2 Answers

I can provide a partial answer to this. I hope to get up and running better with ClojureBox myself. I am familiar with emacs in general but not emacs with SLIME which is what ClojureBox provides. If you aren't comfortable with emacs itself I would suggest working with its own tutorial first to get the hang of it.

  • How do I create a new clojure file in emacs?

Use standard emacs file creation "C-x C-f" to open a new file. Chose a file name with the extension ".clj" and it will beauto-detected as a clojure file.

  • Load an existing clojure file so the forms (values, functions) are available to the REPL?

Use the load-file command (C-c C-l), note that you will have to have saved the file first (C-x C-s). It will now be available to the REPL.

Alternatively to just try out a block of code, highlight the region containing it and use (C-c C-r) to eval-region with SLIME (which is running your clojure REPL).

  • Does Programming Clojure http: //pragprog.com/titles/shcloj/programming-clojure answer these questions?

Not that I am aware of. It doesn't really deal with development environments.

For help using the book code with ClojureBox see this thread - http://groups.google.com/group/clojure/browse_thread/thread/b52ca7becceca16a

Also try the Clojure google group in general.

like image 94
Alex Stoddard Avatar answered Oct 12 '22 10:10

Alex Stoddard


I put together Clojure Box, but I don't know if a Clojure-specific Emacs tutorial other than the brief readme that comes with Clojure Box. The tips in Practical Common Lisp for traversing buffers and the REPL and loading code will apply.

For project layout check out the readme from technomancy's swank-clojure project on github. Clojure Box doesn't have this feature, but if you install swank-clojure on your own, you can follow the standard layout instructions under the Project section of the readme.

You may want to try Enclojure again since there was a release in November from Eric Thorsen's github account. The screencast of new features from the August 2009 build (http://www.vimeo.com/6270957) is pretty helpful too.

like image 29
Shawn Hoover Avatar answered Oct 12 '22 08:10

Shawn Hoover