Thanks so much, Gary. The quoting error is something that I should have seen 
but didn't :-(, and the two other methods are also great to know about.

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
>>> 
>> 
>> 
>> - 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.
> 



-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to