Re: clojure debugging repl

2014-03-13 Thread Paul Reidy
Did anyone ever get this working ?

On Saturday, January 25, 2014 10:42:27 AM UTC-5, Magomimmo wrote:
>
> On Jan 25, 2014, at 2:12 AM, Alexandr Kurilin 
> > 
> wrote: 
>
> > 
> > I'd love to be able to set breakpoints in a running clojure application, 
> step through the code and inspect locals and the referencing environment. 
> Anything that gets me off of the time-consuming process of adding 
> timbre/clojure.tools.trace statements would be really welcome. Is vim-redl 
> the closest I can get to that, or is ritz the way to go? Any other 
> recommendations? 
> > 
>
>
>

-- 
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
--- 
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 clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: clojure debugging repl

2014-01-25 Thread Mimmo Cosenza
On Jan 25, 2014, at 2:12 AM, Alexandr Kurilin  wrote:

> 
> I'd love to be able to set breakpoints in a running clojure application, step 
> through the code and inspect locals and the referencing environment. Anything 
> that gets me off of the time-consuming process of adding 
> timbre/clojure.tools.trace statements would be really welcome. Is vim-redl 
> the closest I can get to that, or is ritz the way to go? Any other 
> recommendations?
> 

The paradox is that you can have a simulacra of those features with 
ClojureScript by using :source-map and  Chrome Developer Tools. But AFAIK you 
loose something at the moment (e.g. cljs completion, cljs documentation). 

That said, when the scenario allows it, I always write portable CLJ/CLJS code 
by using cljx plugin. This way I can have an almost full powered REPL 
experience with CLJ REPL and when I really need to set breakpoints or inspect 
locals  (very rare), I switch to CLJS….

mimmo




signature.asc
Description: Message signed with OpenPGP using GPGMail


Re: clojure debugging repl

2014-01-25 Thread t x
https://github.com/GeorgeJahad/debug-repl/blob/master/src/alex_and_georges/debug_repl.clj

is some of the most enlightening clojure code I have read.


Any other suggestions?

Criteria for code I'm looking for:

* need not be production use

* ideally short

* focus is "demonstrate key idea, not necessarily worry about production
use"




On Fri, Jan 24, 2014 at 9:12 PM, Jarrod Swart  wrote:

> Its a part of Chapter 17, just so you know its only a small exercise
> showing the beauty of Clojure, Lisp and Macros.  Its only about 6 six
> pages.  The footnote:
>
> The code in this section is based on *debug-repl* created by the amazing
> George Jahad,
> extended by Alex Osborne, and integrated into Swank-Clojure by Hugo Duncan.
>
> So maybe check those out.  That said I think its a really good book and
> Manning often has specials going so you get Joy of Clojure 1 & 2 for cheap.
>
> On Friday, January 24, 2014 8:51:16 PM UTC-5, t x wrote:
>
>> I am willing to buy the book for this chapter alone.
>>
>> However, looking at http://www.manning.com/fogus2/ I can't seem to find
>> it. Which chapter is it?
>>
>>
>>
>> On Fri, Jan 24, 2014 at 3:46 PM, Jarrod Swart  wrote:
>>
>>> The second version of The Joy of Clojure talks about building a
>>> debugging repl that allows insertion of breakpoints into code.  Perhaps
>>> something similar could be done here.
>>>
>>>
>>> On Friday, January 24, 2014 4:38:59 PM UTC-5, t x wrote:
>>>
 Found it, apparently it's

 debug-repl => swank-clojure => CDT => ritz

 It appears cider does not yet support this, so ritz is probably the
 "most powerful" at the moment.


 On Fri, Jan 24, 2014 at 3:39 AM, t x  wrote:

> Hi,
>
>   One thing I miss from pre-Clojure scheme days is as follows:
>
> ## What I want
>
> 1 => (foo) ;; I'm calling foo at the repl
> ... foo executes ...
> ... at some point, an exception is thrown ...
>
> 2 => my interpreter _starts a new repl_
>   * at the point where the exception was thrown
>   * lets me examine local environment variables
>   * lets me execute commands
>   * lets me "resume" the execution
>
>
> ## Why "it can't work"
>
> Now, I understand why this can not work in general in Clojure, i.e.
> the following example:
>
> (defn foo []
>   (.someJavaFunctionThatThrowsException object))
>
> In this case, the above is impossible since the exception is thrown
> from _java land_ rather than Clojure land.
>
>
> ## Why it might work
>
> Now, I'm not writing any code in java. The work I'm doing is pure
> clojure. I can throw when the exception is thrown.
>
>
> Is there some library, where instead of doing
>
> (defn foo []
>   ...
>   (throw (ex-data ...))
>   ...)
>
> I instead do:
>
> (defn foo []
>   ...
>   (something-went-wrong-please-fire-up-a-repl)
>   ...)
>
> ?
>
> Thanks!
>

  --
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Clojure" group.
>>> To post to this group, send email to clo...@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+u...@googlegroups.com
>>>
>>> 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 clojure+u...@googlegroups.com.
>>>
>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>
>>
>>  --
> --
> 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
> ---
> 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 clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
-- 
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
--- 
You received this message because yo

Re: clojure debugging repl

2014-01-24 Thread Jarrod Swart
Its a part of Chapter 17, just so you know its only a small exercise 
showing the beauty of Clojure, Lisp and Macros.  Its only about 6 six 
pages.  The footnote:

The code in this section is based on *debug-repl* created by the amazing 
George Jahad,
extended by Alex Osborne, and integrated into Swank-Clojure by Hugo Duncan.

So maybe check those out.  That said I think its a really good book and 
Manning often has specials going so you get Joy of Clojure 1 & 2 for cheap.

On Friday, January 24, 2014 8:51:16 PM UTC-5, t x wrote:
>
> I am willing to buy the book for this chapter alone.
>
> However, looking at http://www.manning.com/fogus2/ I can't seem to find 
> it. Which chapter is it?
>
>
>
> On Fri, Jan 24, 2014 at 3:46 PM, Jarrod Swart 
> > wrote:
>
>> The second version of The Joy of Clojure talks about building a debugging 
>> repl that allows insertion of breakpoints into code.  Perhaps something 
>> similar could be done here.
>>
>>
>> On Friday, January 24, 2014 4:38:59 PM UTC-5, t x wrote:
>>
>>> Found it, apparently it's
>>>
>>> debug-repl => swank-clojure => CDT => ritz
>>>
>>> It appears cider does not yet support this, so ritz is probably the 
>>> "most powerful" at the moment.
>>>
>>>
>>> On Fri, Jan 24, 2014 at 3:39 AM, t x  wrote:
>>>
 Hi,

   One thing I miss from pre-Clojure scheme days is as follows:

 ## What I want

 1 => (foo) ;; I'm calling foo at the repl
 ... foo executes ...
 ... at some point, an exception is thrown ...

 2 => my interpreter _starts a new repl_
   * at the point where the exception was thrown
   * lets me examine local environment variables
   * lets me execute commands
   * lets me "resume" the execution


 ## Why "it can't work"

 Now, I understand why this can not work in general in Clojure, i.e. the 
 following example:

 (defn foo []
   (.someJavaFunctionThatThrowsException object))

 In this case, the above is impossible since the exception is thrown 
 from _java land_ rather than Clojure land.


 ## Why it might work

 Now, I'm not writing any code in java. The work I'm doing is pure 
 clojure. I can throw when the exception is thrown.


 Is there some library, where instead of doing

 (defn foo []
   ...
   (throw (ex-data ...))
   ...)

 I instead do:

 (defn foo []
   ...
   (something-went-wrong-please-fire-up-a-repl)
   ...)

 ?
  
 Thanks!

>>>
>>>  -- 
>> -- 
>> You received this message because you are subscribed to the Google
>> Groups "Clojure" group.
>> To post to this group, send email to clo...@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+u...@googlegroups.com 
>> 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 clojure+u...@googlegroups.com .
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>

-- 
-- 
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
--- 
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 clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: clojure debugging repl

2014-01-24 Thread t x
I am willing to buy the book for this chapter alone.

However, looking at http://www.manning.com/fogus2/ I can't seem to find it.
Which chapter is it?



On Fri, Jan 24, 2014 at 3:46 PM, Jarrod Swart  wrote:

> The second version of The Joy of Clojure talks about building a debugging
> repl that allows insertion of breakpoints into code.  Perhaps something
> similar could be done here.
>
>
> On Friday, January 24, 2014 4:38:59 PM UTC-5, t x wrote:
>
>> Found it, apparently it's
>>
>> debug-repl => swank-clojure => CDT => ritz
>>
>> It appears cider does not yet support this, so ritz is probably the "most
>> powerful" at the moment.
>>
>>
>> On Fri, Jan 24, 2014 at 3:39 AM, t x  wrote:
>>
>>> Hi,
>>>
>>>   One thing I miss from pre-Clojure scheme days is as follows:
>>>
>>> ## What I want
>>>
>>> 1 => (foo) ;; I'm calling foo at the repl
>>> ... foo executes ...
>>> ... at some point, an exception is thrown ...
>>>
>>> 2 => my interpreter _starts a new repl_
>>>   * at the point where the exception was thrown
>>>   * lets me examine local environment variables
>>>   * lets me execute commands
>>>   * lets me "resume" the execution
>>>
>>>
>>> ## Why "it can't work"
>>>
>>> Now, I understand why this can not work in general in Clojure, i.e. the
>>> following example:
>>>
>>> (defn foo []
>>>   (.someJavaFunctionThatThrowsException object))
>>>
>>> In this case, the above is impossible since the exception is thrown from
>>> _java land_ rather than Clojure land.
>>>
>>>
>>> ## Why it might work
>>>
>>> Now, I'm not writing any code in java. The work I'm doing is pure
>>> clojure. I can throw when the exception is thrown.
>>>
>>>
>>> Is there some library, where instead of doing
>>>
>>> (defn foo []
>>>   ...
>>>   (throw (ex-data ...))
>>>   ...)
>>>
>>> I instead do:
>>>
>>> (defn foo []
>>>   ...
>>>   (something-went-wrong-please-fire-up-a-repl)
>>>   ...)
>>>
>>> ?
>>>
>>> Thanks!
>>>
>>
>>  --
> --
> 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
> ---
> 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 clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
-- 
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
--- 
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 clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: clojure debugging repl

2014-01-24 Thread Alexandr Kurilin
I've been looking for a simple and convenient to use clojure debugger for
ages now and would love to hear your recommendations. I'm a vim-fireplace
user as well, if that makes a difference.

I'd love to be able to set breakpoints in a running clojure application,
step through the code and inspect locals and the referencing environment.
Anything that gets me off of the time-consuming process of adding
timbre/clojure.tools.trace statements would be really welcome. Is vim-redl
the closest I can get to that, or is ritz the way to go? Any other
recommendations?

I'll have to checkout JoC2's chapter on that, that sounds really helpful.


On Fri, Jan 24, 2014 at 4:11 PM, dgrnbrg  wrote:

> I have an implementation of this that's thoroughly integrated into vim.
>
> clojure code: https://github.com/dgrnbrg/redl
> vim plugin: https://github.com/dgrnbrg/vim-redl
>
> The code itself is written with core.async, and is capable of monitoring a
> thread, inspecting its stack while its running, stopping it, and
> programmatically creating breakpoints that give you a repl with captured
> locals.
>
> I'd love for this work to be extended to a generic nrepl handler, but I
> don't have the time to do so at the moment.
>
>
> On Friday, January 24, 2014 6:46:23 PM UTC-5, Jarrod Swart wrote:
>>
>> The second version of The Joy of Clojure talks about building a debugging
>> repl that allows insertion of breakpoints into code.  Perhaps something
>> similar could be done here.
>>
>> On Friday, January 24, 2014 4:38:59 PM UTC-5, t x wrote:
>>>
>>> Found it, apparently it's
>>>
>>> debug-repl => swank-clojure => CDT => ritz
>>>
>>> It appears cider does not yet support this, so ritz is probably the
>>> "most powerful" at the moment.
>>>
>>>
>>> On Fri, Jan 24, 2014 at 3:39 AM, t x  wrote:
>>>
 Hi,

   One thing I miss from pre-Clojure scheme days is as follows:

 ## What I want

 1 => (foo) ;; I'm calling foo at the repl
 ... foo executes ...
 ... at some point, an exception is thrown ...

 2 => my interpreter _starts a new repl_
   * at the point where the exception was thrown
   * lets me examine local environment variables
   * lets me execute commands
   * lets me "resume" the execution


 ## Why "it can't work"

 Now, I understand why this can not work in general in Clojure, i.e. the
 following example:

 (defn foo []
   (.someJavaFunctionThatThrowsException object))

 In this case, the above is impossible since the exception is thrown
 from _java land_ rather than Clojure land.


 ## Why it might work

 Now, I'm not writing any code in java. The work I'm doing is pure
 clojure. I can throw when the exception is thrown.


 Is there some library, where instead of doing

 (defn foo []
   ...
   (throw (ex-data ...))
   ...)

 I instead do:

 (defn foo []
   ...
   (something-went-wrong-please-fire-up-a-repl)
   ...)

 ?

 Thanks!

>>>
>>>  --
> --
> 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
> ---
> 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 clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>



-- 
Alexandr Kurilin
206.687.8740 | @alex_kurilin  |
blog

-- 
-- 
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
--- 
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 clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: clojure debugging repl

2014-01-24 Thread dgrnbrg
I have an implementation of this that's thoroughly integrated into vim.

clojure code: https://github.com/dgrnbrg/redl
vim plugin: https://github.com/dgrnbrg/vim-redl

The code itself is written with core.async, and is capable of monitoring a 
thread, inspecting its stack while its running, stopping it, and 
programmatically creating breakpoints that give you a repl with captured 
locals.

I'd love for this work to be extended to a generic nrepl handler, but I 
don't have the time to do so at the moment.

On Friday, January 24, 2014 6:46:23 PM UTC-5, Jarrod Swart wrote:
>
> The second version of The Joy of Clojure talks about building a debugging 
> repl that allows insertion of breakpoints into code.  Perhaps something 
> similar could be done here.
>
> On Friday, January 24, 2014 4:38:59 PM UTC-5, t x wrote:
>>
>> Found it, apparently it's
>>
>> debug-repl => swank-clojure => CDT => ritz
>>
>> It appears cider does not yet support this, so ritz is probably the "most 
>> powerful" at the moment.
>>
>>
>> On Fri, Jan 24, 2014 at 3:39 AM, t x  wrote:
>>
>>> Hi,
>>>
>>>   One thing I miss from pre-Clojure scheme days is as follows:
>>>
>>> ## What I want
>>>
>>> 1 => (foo) ;; I'm calling foo at the repl
>>> ... foo executes ...
>>> ... at some point, an exception is thrown ...
>>>
>>> 2 => my interpreter _starts a new repl_
>>>   * at the point where the exception was thrown
>>>   * lets me examine local environment variables
>>>   * lets me execute commands
>>>   * lets me "resume" the execution
>>>
>>>
>>> ## Why "it can't work"
>>>
>>> Now, I understand why this can not work in general in Clojure, i.e. the 
>>> following example:
>>>
>>> (defn foo []
>>>   (.someJavaFunctionThatThrowsException object))
>>>
>>> In this case, the above is impossible since the exception is thrown from 
>>> _java land_ rather than Clojure land.
>>>
>>>
>>> ## Why it might work
>>>
>>> Now, I'm not writing any code in java. The work I'm doing is pure 
>>> clojure. I can throw when the exception is thrown.
>>>
>>>
>>> Is there some library, where instead of doing
>>>
>>> (defn foo []
>>>   ...
>>>   (throw (ex-data ...))
>>>   ...)
>>>
>>> I instead do:
>>>
>>> (defn foo []
>>>   ...
>>>   (something-went-wrong-please-fire-up-a-repl)
>>>   ...)
>>>
>>> ?
>>>  
>>> Thanks!
>>>
>>
>>

-- 
-- 
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
--- 
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 clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: clojure debugging repl

2014-01-24 Thread Jarrod Swart
The second version of The Joy of Clojure talks about building a debugging 
repl that allows insertion of breakpoints into code.  Perhaps something 
similar could be done here.

On Friday, January 24, 2014 4:38:59 PM UTC-5, t x wrote:
>
> Found it, apparently it's
>
> debug-repl => swank-clojure => CDT => ritz
>
> It appears cider does not yet support this, so ritz is probably the "most 
> powerful" at the moment.
>
>
> On Fri, Jan 24, 2014 at 3:39 AM, t x >wrote:
>
>> Hi,
>>
>>   One thing I miss from pre-Clojure scheme days is as follows:
>>
>> ## What I want
>>
>> 1 => (foo) ;; I'm calling foo at the repl
>> ... foo executes ...
>> ... at some point, an exception is thrown ...
>>
>> 2 => my interpreter _starts a new repl_
>>   * at the point where the exception was thrown
>>   * lets me examine local environment variables
>>   * lets me execute commands
>>   * lets me "resume" the execution
>>
>>
>> ## Why "it can't work"
>>
>> Now, I understand why this can not work in general in Clojure, i.e. the 
>> following example:
>>
>> (defn foo []
>>   (.someJavaFunctionThatThrowsException object))
>>
>> In this case, the above is impossible since the exception is thrown from 
>> _java land_ rather than Clojure land.
>>
>>
>> ## Why it might work
>>
>> Now, I'm not writing any code in java. The work I'm doing is pure 
>> clojure. I can throw when the exception is thrown.
>>
>>
>> Is there some library, where instead of doing
>>
>> (defn foo []
>>   ...
>>   (throw (ex-data ...))
>>   ...)
>>
>> I instead do:
>>
>> (defn foo []
>>   ...
>>   (something-went-wrong-please-fire-up-a-repl)
>>   ...)
>>
>> ?
>>  
>> Thanks!
>>
>
>

-- 
-- 
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
--- 
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 clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: clojure debugging repl

2014-01-24 Thread t x
Found it, apparently it's

debug-repl => swank-clojure => CDT => ritz

It appears cider does not yet support this, so ritz is probably the "most
powerful" at the moment.


On Fri, Jan 24, 2014 at 3:39 AM, t x  wrote:

> Hi,
>
>   One thing I miss from pre-Clojure scheme days is as follows:
>
> ## What I want
>
> 1 => (foo) ;; I'm calling foo at the repl
> ... foo executes ...
> ... at some point, an exception is thrown ...
>
> 2 => my interpreter _starts a new repl_
>   * at the point where the exception was thrown
>   * lets me examine local environment variables
>   * lets me execute commands
>   * lets me "resume" the execution
>
>
> ## Why "it can't work"
>
> Now, I understand why this can not work in general in Clojure, i.e. the
> following example:
>
> (defn foo []
>   (.someJavaFunctionThatThrowsException object))
>
> In this case, the above is impossible since the exception is thrown from
> _java land_ rather than Clojure land.
>
>
> ## Why it might work
>
> Now, I'm not writing any code in java. The work I'm doing is pure clojure.
> I can throw when the exception is thrown.
>
>
> Is there some library, where instead of doing
>
> (defn foo []
>   ...
>   (throw (ex-data ...))
>   ...)
>
> I instead do:
>
> (defn foo []
>   ...
>   (something-went-wrong-please-fire-up-a-repl)
>   ...)
>
> ?
>
> Thanks!
>

-- 
-- 
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
--- 
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 clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


clojure debugging repl

2014-01-24 Thread t x
Hi,

  One thing I miss from pre-Clojure scheme days is as follows:

## What I want

1 => (foo) ;; I'm calling foo at the repl
... foo executes ...
... at some point, an exception is thrown ...

2 => my interpreter _starts a new repl_
  * at the point where the exception was thrown
  * lets me examine local environment variables
  * lets me execute commands
  * lets me "resume" the execution


## Why "it can't work"

Now, I understand why this can not work in general in Clojure, i.e. the
following example:

(defn foo []
  (.someJavaFunctionThatThrowsException object))

In this case, the above is impossible since the exception is thrown from
_java land_ rather than Clojure land.


## Why it might work

Now, I'm not writing any code in java. The work I'm doing is pure clojure.
I can throw when the exception is thrown.


Is there some library, where instead of doing

(defn foo []
  ...
  (throw (ex-data ...))
  ...)

I instead do:

(defn foo []
  ...
  (something-went-wrong-please-fire-up-a-repl)
  ...)

?

Thanks!

-- 
-- 
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
--- 
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 clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.