This seems like the right approach, but something is odd about the 
namespacing. Details:

0) using vim-fireplace
1) I jump into honeysql-0.4.2.jar::honeysql/format.clj
2) edit the format fn to always return "foo", and eval the new fn definition
3) Eval (format {:select [5]}) in the format.clj split, get "foo". Great.
4) In my app core.clj split, eval (hsql/format {:select [5]}), get "SELECT 
5"

So, in my app.core namespace, the hsql/format fn is unchanged.

Ugh.... I think I just found part of the problem. If I invoke 
honeysql.format/format, I get the new version. honeysql core is doing

(defalias format format/format)

where defalias is some macro that calls (intern *ns* ...). I think honeysql 
is explicitly caching the old definition of the function. :-p

And, yes, indeed, if I reload honeysql core, the format fn is updated. That 
hurts. Not sure why honeysql needs to cache function references like this.


On Thursday, March 27, 2014 11:52:36 AM UTC-7, Moritz Ulrich wrote:
>
> Checking out a project your project depend on, finding the right 
> version, etc. is quite cumbersome. 
>
> With Emacs/nrepl, you can just press M-. over any function to jump to 
> the definition, even when it's inside a jar. 
> You can also edit and reload it (via C-c C-c). I don't think you can 
> save it, but that isn't necessary to reload the function/namespace. 
> Cider can re-evaluate a whole buffer or region in the buffer without 
> the need to save it. 
>
> On Thu, Mar 27, 2014 at 7:49 PM, Michael Blume 
> <[email protected]<javascript:>> 
> wrote: 
> > Don't worry about the jar, especially. You can have your own git 
> checkout of 
> > the upstream project you're working with, and that'll work just fine. 
> Open a 
> > source file you need to work with, connect with nrepl, edit a function, 
> and 
> > eval -- that should be enough. 
> > 
> > 
> > On Thursday, March 27, 2014 11:43:19 AM UTC-7, Brian Craft wrote: 
> >> 
> >> Describing my debug workflow woes at clojure/west, it was suggested to 
> me 
> >> that I could jump into the jar file for a library and add print 
> statements 
> >> to elucidate its inner workings. I guess this is supported in emacs? 
> Jump 
> >> into the library source jar, edit, reload into the repl? How does this 
> work, 
> >> exactly? Does it rewrite the zip file and load that to the repl, or 
> just 
> >> update the repl from the working buffer? 
> >> 
> >> I just tried this in vim-fireplace, but it threw an error on writing to 
> >> the jar buffer. Alternatively, perhaps I should eval it w/o trying to 
> save 
> >> the jar. That works so long as I then only evaluate expressions from 
> the 
> >> same namespace. In other namespaces, the edits are not apparent. It's 
> like 
> >> there are two versions of the namespace active in the repl. Not sure 
> what's 
> >> going on, or how to make other namespaces aware of the changes. 
> > 
> > -- 
> > You received this message because you are subscribed to the Google 
> > Groups "Clojure" group. 
> > To post to this group, send email to [email protected]<javascript:> 
> > Note that posts from new members are moderated - please be patient with 
> your 
> > first post. 
> > To unsubscribe from this group, send email to 
> > [email protected] <javascript:> 
> > For more options, visit this group at 
> > http://groups.google.com/group/clojure?hl=en 
> > --- 
> > You received this message because you are subscribed to the Google 
> Groups 
> > "Clojure" group. 
> > To unsubscribe from this group and stop receiving emails from it, send 
> an 
> > email to [email protected] <javascript:>. 
> > For more options, visit https://groups.google.com/d/optout. 
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to