I half-solve the "what have I defined?" problem with a combination of:
1) trying to always work from a file rather than entering stuff by hand at the repl 2) always working in a "scrap" namespace whose contents I can inspect using ns-interns and clojure.inspector/inspect-tree, like so: user=> (ns scrap (:refer-clojure) (:use (clojure inspector set))) scrap=> (inspect-tree (ns-interns 'scrap)) ;;shows me an empty inspector window scrap=> (def x 10) scrap=> (defn hello [s] (str "Hello, " s "!")) scrap=> (inspect-tree (ns-interns 'scrap)) ;;now shows me a list of what I've defined in my namespace At some point I'll improve the gui inspectors to more closely resemble (in functionality) the object inspectors from Eclipse or Idea, but this suffices for now to at least identify what things I've defined so I know to shove their definitions into a file before restarting the repl. Cheers --josh On Jul 8, 9:04 am, Robert Campbell <rrc...@gmail.com> wrote: > > Perhaps instead of saving an image, it should be able to save a transcript > > of the REPL inputs? Then you could rescue code from this, or find any cruft > > your image had become dependent on, or whatever. > > The only problem I see with this approach is that you leave it up to > the user (me) to sort though this transcript and try to reproduce the > latest version of the image. A function may be redefined many times > and the only version I'd _usually_ care about is the latest. This is > typically because the latest definition encompasses the latest > understanding of the problem or solution. > > Having said that, it's better than nothing. There are certainly times > when I need to backtrack to previous definitions when I've down down > the wrong path. Having a transcript is better than where I'm at today. > > > > On Wed, Jul 8, 2009 at 12:00 PM, John Harrop<jharrop...@gmail.com> wrote: > > On Wed, Jul 8, 2009 at 5:14 AM, Robert Campbell <rrc...@gmail.com> wrote: > > >> Thanks Daniel, that makes perfect sense, especially about having > >> random - and forgotten - code in the image. I have a lot of this > >> during my exploration sessions. > > > Perhaps instead of saving an image, it should be able to save a transcript > > of the REPL inputs? Then you could rescue code from this, or find any cruft > > your image had become dependent on, or whatever. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---