Re: Save current namespace like a Smalltalk image

2009-07-08 Thread Jurjen
I seem to be lagging a little in the conversation, but for what it's worth, the code I use to capture function definitions is: (defmacro mkfn "Create a function and record the source in the var metadata" [name & fdecl] (list* `defn (with-meta name (assoc (meta name) :source (s

Re: Save current namespace like a Smalltalk image

2009-07-08 Thread Daniel
On Wed, Jul 8, 2009 at 11:37 PM, Phil Hagelberg wrote: > > Robert Campbell writes: > >> The main reason this is an issue for me is during development I >> sometimes find I need another library added to my classpath. Right now >> the only way I know how to modify the classpath in Emacs is to chang

Re: Save current namespace like a Smalltalk image

2009-07-08 Thread Richard Newman
> I hate to go completely off topic, but could you explain what advices > are in Lisp? When I was reading a post by Steve Yegge he wrote CLOS (the Common Lisp Object System) has before, around, and after methods. Advice is similar, and certainly informed the CL standard. So far as I understan

Re: Save current namespace like a Smalltalk image

2009-07-08 Thread Robert Campbell
Phil - got it. It wouldn't be hard at all to write a script to monitor a directory, and any jar you throw in there gets exploded to the classpath dir like you use. That would make it pretty painless. > For the record, this is usually termed "dribbling" in the Lisp world. > It's very handy for deb

Re: Save current namespace like a Smalltalk image

2009-07-08 Thread Richard Newman
> 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. For the record, this is usually termed "dribbling" in the Lisp world. It's very h

Re: Save current namespace like a Smalltalk image

2009-07-08 Thread Phil Hagelberg
Robert Campbell writes: > Doesn't this seem a little crazy though? My day job is Java dev in > Eclipse and a little IntelliJ and both IDEs allow you to modify > classpath at any time. It seems like it would be a basic requirement > for any IDE. Think of how often you do this. If I had to reboot

Re: Save current namespace like a Smalltalk image

2009-07-08 Thread Robert Campbell
>> Unfortunately this is impossible due to the way the classloaders in >> the >> JVM work; you can't modify your classpath at runtime and have it work >> consistently. Doesn't this seem a little crazy though? My day job is Java dev in Eclipse and a little IntelliJ and both IDEs allow you to modif

Re: Save current namespace like a Smalltalk image

2009-07-08 Thread mccraigmccraig
what's the problem with adding urls to the current ClassLoader ? i've seen remarks to the effect that it doesn't work well, but i don't understand why... c On 8 Jul 2009, at 17:37, Phil Hagelberg wrote: > > Robert Campbell writes: > >> The main reason this is an issue for me is during devel

Re: Save current namespace like a Smalltalk image

2009-07-08 Thread Daniel Lyons
On Jul 8, 2009, at 10:22 AM, Sean Devlin wrote: > Isn't this why you would use a doc string, and not a comment? Docstrings aren't the only comments in my code. :) — Daniel Lyons --~--~-~--~~~---~--~~ You received this message because you are subscribed to the

Re: Save current namespace like a Smalltalk image

2009-07-08 Thread Phil Hagelberg
Robert Campbell writes: > The main reason this is an issue for me is during development I > sometimes find I need another library added to my classpath. Right now > the only way I know how to modify the classpath in Emacs is to change > the .emacs file with an add-to-list 'swank-clojure-extra-cl

Re: Save current namespace like a Smalltalk image

2009-07-08 Thread Sean Devlin
Isn't this why you would use a doc string, and not a comment? On Jul 8, 12:14 pm, Daniel Lyons wrote: > On Jul 8, 2009, at 5:46 AM, Robert Campbell wrote: > > > It seems strange to me that Clojure doesn't support this concept   > > natively > > Comments are part of the problem. Clojure's reader

Re: Save current namespace like a Smalltalk image

2009-07-08 Thread Daniel Lyons
On Jul 8, 2009, at 5:46 AM, Robert Campbell wrote: > It seems strange to me that Clojure doesn't support this concept > natively Comments are part of the problem. Clojure's reader strips them out while parsing before compiling the function, so you would lose them during the first round-t

Re: Save current namespace like a Smalltalk image

2009-07-08 Thread Josh Daghlian
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=> (n

Re: Save current namespace like a Smalltalk image

2009-07-08 Thread Michael Wood
2009/7/8 John Harrop : > On Wed, Jul 8, 2009 at 5:14 AM, Robert Campbell 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

Re: Save current namespace like a Smalltalk image

2009-07-08 Thread Robert Campbell
> 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

Re: Save current namespace like a Smalltalk image

2009-07-08 Thread John Harrop
On Wed, Jul 8, 2009 at 5:14 AM, Robert Campbell 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 transc

Re: Save current namespace like a Smalltalk image

2009-07-08 Thread Robert Campbell
Hi Jurjen, That wrapper for defn is something I was looking for in another post; I previously asked how I can inspect the definitions of my functions on the REPL. When I'm exploring stuff I'll be redefining many functions many times and sometimes I lose track things. I basically have to scroll ar

Re: Save current namespace like a Smalltalk image

2009-07-08 Thread Jurjen
I had the same thought (as posted in the other thread) and haven't come to a final solution yet. The main reason I wanted to achieve it was that I do my developing / tinkering / brainstorming spread over several work boxes spread out through several locations, and a clojure REPL is cheap and easy,

Re: Save current namespace like a Smalltalk image

2009-07-08 Thread Robert Campbell
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. The main reason this is an issue for me is during development I sometimes find I need another library added to my classpath. Right now

Re: Save current namespace like a Smalltalk image

2009-07-08 Thread Daniel Lyons
Robert, On Jul 8, 2009, at 2:13 AM, Robert Campbell wrote: > Sometimes I have pretty long REPL sessions where I'm trying to flesh > out some ideas. When I close my instance of Clojure Box (Emacs based) > I lose all the definitions I had worked out over time. Is there any > way to dump namespace(

Save current namespace like a Smalltalk image

2009-07-08 Thread Robert Campbell
Hello, Sometimes I have pretty long REPL sessions where I'm trying to flesh out some ideas. When I close my instance of Clojure Box (Emacs based) I lose all the definitions I had worked out over time. Is there any way to dump namespace(s) to an image? It would be great to be able to load up some