On Thu, Mar 3, 2011 at 4:12 PM, Sam Ritchie <sritchi...@gmail.com> wrote:
> 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 > Thanks for the detailed description. Will look into it. 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