Hey all -- quick question on the REPL. I'm an emacs user, but my two
teammates have been working with the excellent
textmate-clojure<http://goo.gl/9biVW>,
and it's exposed an issue that I'm not sure how to deal with.

The bundle provides a command to load the current file active in textmate,
by running (load-file tm-filepath) within cake's JVM. So, the textmate
workflow is

1. Open the project in textmate
2. Run "cake repl" in the command line
3. switch back and forth, loading files or eval-ing functions in textmate,
and seeing them appear in the cake repl.

Here's the load file <http://goo.gl/cowKG> source code.

Now, if I'm working in a namespace in the REPL, modify a current function,
and load the file, those changes appear right away in the REPL. However, If
I bind a new var in the file and load it, I get the following:

java.lang.Exception: Unable to resolve symbol: testsymbol in this context
(NO_SOURCE_FILE:0)

Running (in-ns 'the.namespace), or even (in-ns (ns-name *ns*)), fixes the
problem right away, and subsequent modifications are picked up with
load-file, as long as I don't change the symbol name.

This happens with the textmate workflow, but I can confirm that running
(load-file "/path/to/file.clj") when it that current file's namespace
doesn't register new vars.

My question is -- why do existing functions catch modifications from
load-file, while new vars need me to re-enter the namespace? Also, does
anyone have any suggestions on how to modify the load
file<http://goo.gl/cowKG> code
to force cake's repl to run (in-ns (ns-name *ns*)), without actually being
at the REPL? Is there some way to run a command, not just in the current
file's namespace, but at the current REPL?

Thanks, all,
Sam

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