Re: how 'bout a debug-repl?

2009-12-13 Thread George Jahad
What about using a function that throws an exception to quit? The nice thing about using a function to quit is that then you can return values. I've done so here: http://gist.github.com/255883 In addition I've made it so the debug-repl call can wrap a form. If you call quit-dr with no

Re: how 'bout a debug-repl?

2009-12-12 Thread Konrad Hinsen
On 11 Dec 2009, at 23:26, Dan Larkin wrote: On Dec 11, 2009, at 3:04 PM, Sean Devlin wrote: Wouldn't ::quit do the same thing? It wouldn't, because the repl is evaluating in the context of wherever you put the (debug-repl) call, so its namespace won't be dr. What about instead of

Re: how 'bout a debug-repl?

2009-12-11 Thread Konrad Hinsen
On 10 Dec 2009, at 21:34, George Jahad wrote: are you using slime? Currently, you need to use a non-slime repl, (I think because of how slime handles io redirection) I don't use slime, but I had a similar issue with Counterclockwise/ Eclipse, which doesn't quite understand that

Re: how 'bout a debug-repl?

2009-12-11 Thread Laurent PETIT
Great ! thanks Konrad ! Another, presumably more general solution, but implying modifications (by adding another optional attribute) to clojure.main/repl, would be to give to the REPL a particular instance whose meaning could be interpreted by the reader as end the current reader. This instance

Re: how 'bout a debug-repl?

2009-12-11 Thread Stephen C. Gilardi
On Dec 11, 2009, at 5:08 AM, Laurent PETIT wrote: But then, we could even go one level deeper: not only provide a particular instance that would allow to quit the REPL, but a set of instances. And if the returned value of the call to the REPL returns one of the instances in the set, then

Re: how 'bout a debug-repl?

2009-12-11 Thread Sean Devlin
Wouldn't ::quit do the same thing? On Dec 11, 11:57 am, Stephen C. Gilardi squee...@mac.com wrote: On Dec 11, 2009, at 5:08 AM, Laurent PETIT wrote: But then, we could even go one level deeper: not only provide a particular instance that would allow to quit the REPL, but a set of

Re: how 'bout a debug-repl?

2009-12-11 Thread Laurent PETIT
namespacing symbols seems sufficient, indeed. 2009/12/11 Stephen C. Gilardi squee...@mac.com On Dec 11, 2009, at 5:08 AM, Laurent PETIT wrote: But then, we could even go one level deeper: not only provide a particular instance that would allow to quit the REPL, but a set of instances. And

Re: how 'bout a debug-repl?

2009-12-11 Thread Laurent PETIT
s/symbols/keywords/ 2009/12/11 Laurent PETIT laurent.pe...@gmail.com namespacing symbols seems sufficient, indeed. 2009/12/11 Stephen C. Gilardi squee...@mac.com On Dec 11, 2009, at 5:08 AM, Laurent PETIT wrote: But then, we could even go one level deeper: not only provide a particular

Re: how 'bout a debug-repl?

2009-12-11 Thread Dan Larkin
On Dec 11, 2009, at 3:04 PM, Sean Devlin wrote: Wouldn't ::quit do the same thing? It wouldn't, because the repl is evaluating in the context of wherever you put the (debug-repl) call, so its namespace won't be dr. What about instead of using keywords for commands, we use functions for

Re: how 'bout a debug-repl?

2009-12-11 Thread Sean Devlin
Hmmm... functions as commands at a REPL. Now I feel silly for considering the keyword approach :) On Dec 11, 5:26 pm, Dan Larkin d...@danlarkin.org wrote: On Dec 11, 2009, at 3:04 PM, Sean Devlin wrote: Wouldn't ::quit do the same thing? It wouldn't, because the repl is evaluating in the

Re: how 'bout a debug-repl?

2009-12-10 Thread kyle smith
I'm having some trouble with Alex's macro. I can type in the debug- repl, but when I hit enter, it just hangs and nothing happens. -- 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

Re: how 'bout a debug-repl?

2009-12-10 Thread George Jahad
are you using slime? Currently, you need to use a non-slime repl, (I think because of how slime handles io redirection) On Dec 10, 12:14 pm, kyle smith the1physic...@gmail.com wrote: I'm having some trouble with Alex's macro.  I can type in the debug- repl, but when I hit enter, it just hangs

Re: how 'bout a debug-repl?

2009-12-10 Thread kyle smith
Yes, I just figured that out. Is there a way to use this with slime? -- 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

Re: how 'bout a debug-repl?

2009-12-10 Thread George Jahad
It's definitely on my todo list. But probably like yours, that list ain't short. On Dec 10, 12:56 pm, kyle smith the1physic...@gmail.com wrote: Yes, I just figured that out.  Is there a way to use this with slime? -- You received this message because you are subscribed to the Google Groups

Re: how 'bout a debug-repl?

2009-12-09 Thread Jeff Rose
Awesome! I've googled high and low for exactly this functionality in the past. +1 for getting this into core or contrib if it could work there. Can you wrap a require to make a whole library debuggable? (with-lexical-frames (require 'foo.bar)) It would be very handy to have a debug mode

Re: how 'bout a debug-repl?

2009-12-09 Thread Alex Osborne
George Jahad cloj...@blackbirdsystems.net writes: Every time I stick a println into some Clojure code to debug it, I think to myself, This is Lisp! I should be able to insert a repl here! The problem is of course that Clojure's eval function doesn't know about the surrounding lexical scope.

Re: how 'bout a debug-repl?

2009-12-09 Thread George Jahad
Brilliant. With such a simple change, I think we just revolutionized the way people debug Clojure. (They just don't realize it yet.) On Dec 9, 3:46 am, Alex Osborne a...@meshy.org wrote: Neat idea. Unless I'm misunderstanding what your modifications do, I've come up with a simple pure

Re: how 'bout a debug-repl?

2009-12-09 Thread Konrad Hinsen
On 9 Dec 2009, at 18:59, George Jahad wrote: Brilliant. With such a simple change, I think we just revolutionized the way people debug Clojure. (They just don't realize it yet.) I for one do - this is an excellent improvement, and I hope that Clojure IDEs will integrate similar tools into

Re: how 'bout a debug-repl?

2009-12-09 Thread Raoul Duke
Clojure IDEs will integrate similar tools into their debuggers. I'd love to be able to single-step through my code and have a REPL in the current environment at any time! yes, catching up with what i assume CL can do would rock :-) -- You received this message because you are subscribed to

Re: how 'bout a debug-repl?

2009-12-08 Thread Mike Douglas
Very cool. Any chance we'd see this get merged into 'new'? -- 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

how 'bout a debug-repl?

2009-12-07 Thread George Jahad
Every time I stick a println into some Clojure code to debug it, I think to myself, This is Lisp! I should be able to insert a repl here! The problem is of course that Clojure's eval function doesn't know about the surrounding lexical scope. So I started asking myself, what is the simplest change

Re: how 'bout a debug-repl?

2009-12-07 Thread Richard Newman
I'm pretty pleased with the results and wanted to show them off. More details here: http://georgejahad.com/clojure/debug-repl.html Pretty slick work, George! Thanks for sharing! -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this