On Sat, Dec 18, 2010 at 10:34 AM, Lee Spector <lspec...@hampshire.edu> wrote:
>
> On Dec 18, 2010, at 8:23 AM, .Bill Smith wrote:
>
>> While this not what tor explicitly asked about, it is worth mentioning that 
>> the only way to kill an infinite loop in a Clojure repl is to kill the JVM.
>
> Is this architecturally necessary, or might someone be able to provide a more 
> flexible interrupt system some day?
>
> Having spent decades in other lisps one of the things I miss most in Clojure 
> is the ability to interrupt a process from the keyboard, land in a "break 
> loop" REPL, and be able to examine the local state in which the interrupt 
> occurred, evaluate forms, possibly reset variables, and possibly restart the 
> process. This is really handy when debugging, not only for infinite loops but 
> for all sorts of long-running processes. I understand that in a 
> multi-threaded application there might be choices about which thread(s) to 
> interrupt, but it would be great to have anything along these lines. I also 
> understand that allowing for this may have a runtime cost, but perhaps it 
> could be turned on/off for development/deployment?
>

There already exists clojure.contrib.repl-utils/add-break-thread!
which attempts to address this.
(http://clojure.github.com/clojure-contrib/repl-utils-api.html#clojure.contrib.repl-utils/add-break-thread!).
I'm not sure there's any way to resume the broken-into threads though.

Note that it's impossible in the JVM to cause threads to cancel in
some cases (for instance are looping and never execute an
interruptible function within the loop).

-- 
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

Reply via email to