I just finished making a screencast primarily for new Overtone users on how to get set up with Emacs as a primary editor:
It turns out that this should be pretty useful for Clojure hackers in general as it's really a screencast on how to set up a Clojure environment using Emacs slime, swank and cake. Just s/Overtone/your-project/
Of course, it's also great if you're interested in making music with programming languages :-)
Sam
> --
> 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
--
~JT
Sam,
Thanks so much for this. It's quite nice and it worked for me almost without a glitch (the one glitch being that I had to move a pre-existing .emacs to prevent an error). If I could be excused for briefly looking a gift horse in the mouth I'd also say that as a teacher I think it would be even more fabulous if someone could put together packages (presumably platform-specific packages) that allowed one to do this all in one or two steps, rather than five or six... Installing all of the pieces in one automated process, and also adding the needed lines to the project.clj files etc. Users will want to update/tweak these later, but in the same spirit of this overall package I think it'd be nice to have something that works by default with as few steps as possible. In any event, I do think that this is already quite a nice advance.
I have two (related?) questions about working in a REPL in the resulting configuration:
- When I have a split screen with a source file and a REPL I can't seem to get the REPL into the namespace of the source file. I can do C-c C-k to evaluate the file and that produces overtone output as expected (and printed output goes to the REPL), but when I then try to do (in-ns overtoneproject.core) in the REPL [overtoneproject.core is the name I used in the ns form in the file] I get a ClassNotFoundException.
- I also can't get (load "core"), or any variant that I could think of, when typed in the REPL to find the file. When I look at the classpath with (seq (.getURLs (java.lang.ClassLoader/getSystemClassLoader))) I see some of my project's files there, so it "knows" about the project, but it doesn't find my file in the src directory that cake created.
Any pointers would be appreciated.
Thanks,
-Lee
I'm still having no luck getting "load" to find things, but I suspect that that is a similarly basic mistake...
-Lee
On Jun 23, 2011, at 10:08 AM, lambdatronic wrote:
> Lee,
>
> You're just making a simple typo. To get the REPL to switch to the
> source file's namespace, you have several options:
>
> 1) With the point in the source file, press C-c M-p <ENTER>
>
> 2) With the point in the REPL, type ,in <ENTER> overtoneproject.core
> <ENTER>
>
> 3) With the point in the REPL, type (in-ns 'overtoneproject.core)
>
> Your mistake was to not quote overtoneproject.core, which made the
> clojure compiler look up the value of the symbol as a Java class
> (which it isn't unless you added a :gen-class to the ns form). By
> quoting it, in-ns gets the symbol overtoneproject.core, which is what
> it uses to look up namespaces:
>
> clojure.core/in-ns
> ([name])
> Sets *ns* to the namespace named by the symbol, creating it if
> needed.
>
> Happy hacking,
> ~Gary
>
> On Jun 21, 11:09 pm, Lee Spector <lspec...@hampshire.edu> wrote:
>> On Jun 16, 2011, at 11:16 AM, Sam Aaron wrote:
>>
>>> I just finished making a screencast primarily for new Overtone users on how to get set up with Emacs as a primary editor:
>>
>>> http://vimeo.com/25190186
>>>
>>
>>
Now I think it's a more general problem of not setting the classpath correctly. If I try to :use something in the ns form in a file, for which I have a .clj file in the same directory as the core.clj that cake created, then when I evaluate the buffer in emacs the required file is not found.
How and where do I set up the classpath so that this will work (using emacs/cake/swank/slime)? If possible I'd like to set it up so that it always finds anything anywhere in the cake project directory, including .clj files in src/.
Thanks,
-Lee
>> On Jun 21, 11:09 pm, Lee Spector <lspec...@hampshire.edu> wrote:
>>> On Jun 16, 2011, at 11:16 AM, Sam Aaron wrote:
>>>
>>>> I just finished making a screencast primarily for new Overtone users on how to get set up with Emacs as a primary editor:
>>>
>>>> http://vimeo.com/25190186
>>>>
>>>
One thing that I'd like to know more about: when you say "Start a JVM in this directory with the classpath set to contain and files in src or lib" I'm not 100% sure that I know how you mean to do that. I am starting a JVM in that directory by saying "cake swank", and this seems to work now that I have the namespace names and file locations matched up. But how? Is the classpath being set to contain files in src and lib automatically by cake? Where does one specify this? It's not in my project.clj or anywhere else that I see. So even though it's currently working it still seems mysterious.
BTW also I still can't seem to get "load" to work... it never seems to find the files.... I'd sort of like to know how to do that, to help dispel more of the foggy classpath mysteries, but I guess that now that I can get :use to work I can have a reasonable workflow one way or another.
-Lee
Thanks,
-Lee
Thanks!
-Lee
> --
> 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
--
Lee Spector, Professor of Computer Science
Cognitive Science, Hampshire College
893 West Street, Amherst, MA 01002-3359
lspe...@hampshire.edu, http://hampshire.edu/lspector/
Phone: 413-559-5352, Fax: 413-559-5438