David, not a problem! I was trying to put together a patch, but stumbled on
this one issue, and figured the clojure list might be able to help out with
the more general question, here.

Exact steps:

   1. Open textmate project
   2. run "cake repl" at a terminal, inside the project directory
   3. Navigate to, say, test/namespace.clj, and press Shift-Command-L to
   load the file. "Loading Finished!" should pop up.
   4. In the terminal, run (in-ns 'test.namespace). This gets me into the
   namespace, and gives me access to all current definitions... say,
   (def test-string "test!")

Now, if I change that line to (def test-string "test again!"), reload the
file, and type test-string into the repl, I see "test again!". So, changing
a currently defined var "catches".

But! If I change the line to (def test-string2 "test!"), load the file, and
type test-string2 at the repl, I get an error noting that the var isn't
bound. After running (in-ns 'test.namespace) again, test-string2 returns
"test!".

The textmate-clojure code uses "cake run" to call "load-file" on the current
active file in textmate, as you of course know. The problem seems to be that
load-file isn't making new defs available to the current repl, even though
it can successfully update currently bounds defs. I'm looking for a way to
write a patch that forces (in-ns (ns-name *ns*)) to run inside the current
repl, whenever the user presses shift-command-L, getting around this issue.

(I've also found that (require 'test.playground :reload) and (require
'test.playground :reload-all) have no effect. Only the in-ns call works.)

Sorry about the length, here! The issue applies without textmate-clojure in
the loop -- substitute a call to load-file for the shift-command-L business.

Best,
Sam

On Thu, Mar 3, 2011 at 9:55 AM, David Nolen <dnolen.li...@gmail.com> wrote:

> On Thu, Mar 3, 2011 at 12:39 PM, Sam Ritchie <sritchi...@gmail.com> wrote:
>
>> I'd like to bump this, with the question rephrased:
>>
>> Is there a way to call commands from a JVM process's REPL in any way other
>> than pasting it in to that REPL? Specifically, is there a way to tell an
>> active REPL to re-enter its current namespace?
>>
>
> Sam,
>
> Sorry I haven't been focusing much on textmate-clojure lately and don't
> plan on doing so in the near future (though very open to taking patches).
> What do you mean by "bind a new var in a file and load it?" Can you give me
> the exact set of steps to recreate the issue? There's a textmate-clojure
> Google Group as well.
>
> David
>

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