> 1) Start emacs, run M-x swank-clojure-project.
> From the *slime-repl clojure* buffer run:
> ; SLIME 20100404
> user> (use 'alex-and-georges.debug-repl)
> nil
> user> (let [c 1
>         d 2]
>     (defn a [b c]
>       (debug-repl)
>       d))
>   (a "foo" "bar")
> dr-1-1001 => (+ 2 3)
>
> Now it hangs, not evaluating (+ 2 3).


the slime repl is a split repl, stdin/stdout are connected to emacs
which processes the io and then sends it on to a separate java vm.

the standard clojure repl connects stdin/out directly to the java vm.
the debug-repl also works this way. so the debug repl can't be used
with the slime repl directly, but only through the *inferior lisp*
buffer.

that's why Hugo Duncan enhanced the slime repl to be similar to the
debug repl, but you have to use swank/break for that.


>
> 2) Start emacs, run M-x swank-clojure-project.
> From the *inferior-lisp* buffer run:
>  user=> (use 'alex-and-georges.debug-repl)
> nil
> user=>  (let [c 1
>         d 2]
>     (defn a [b c]
>       (debug-repl)
>       d))
>   (a "foo" "bar")
> #'user/a
> user=> dr-1-1001 => (+ 2 3)
> 5
> dr-1-1001 => b
> "foo"
> dr-1-1001 => c
> "bar"
> dr-1-1001 => (quit-dr)
> alex_and_georges.debug_repl.proxy$java.lang.Exception$Enumeration
> $f482e887
> dr-1-1001 => b
> "foo"
> dr-1-1001 => c
> "bar"
> dr-1-1001 => (exit-dr)
> java.lang.Throwable: Exiting back to main repl from debug-repl
> dr-1-1001 => b
> "foo"
> dr-1-1001 => c
> "bar"
> dr-1-1001 =>
>
> so it seems I can't escape back to the main repl.

this is a bug in the debug-repl's quit and exit routines, which i
hadn't noticed before because
i always use the empty list, () , to exit. Try that.  ctrl-d also
works, but is a little dangerous because you risk exiting all the way
out of the original repl.

>
> 3) From a shell run:
> krukow:~/workspaces/trifork/intrafoo_clj$ lein swank
> Listening for transport dt_socket at address: 8030
> WARNING: group-by already refers to: #'clojure.core/group-by in
> namespace: clojure.contrib.pprint, being replaced by:
> #'clojure.contrib.pprint/group-by
> user=> Connection opened on local port  4005
> #<ServerSocket ServerSocket[addr=localhost/
> 127.0.0.1,port=0,localport=4005]>
>
> start emacs and M-x slime-connect
> From *slime-repl clojure* buffer, run:
> ; SLIME 20100404
> user> (use 'alex-and-georges.debug-repl)
> nil
> user>  (let [c 1
>         d 2]
>     (defn a [b c]
>       (debug-repl)
>       d))
>   (a "foo" "bar")
> dr-1-1001 => 2
> user>
>
> it seems to immediately quit the debug-repl (not sure why it writes
> 2).

again, use the empty list.

>
> 4) From a shell start a regular repl. This works like case 2.
>
> In 2,4 I just realized I can exit the debug-repl with C-d. In case 4
> this works, in case 2 it exits both the debug-repl and the regular
> repl
>
> :(
>
> Ideally I would like to run case 3 with lein swank as that lets me set
> JVM options so I can use the Clojure Debugging Tool.

as i explained above you have to use swank/break with case 3.

in addition to these 4 cases, it sounds like you are having a problem
viewing the local java object, which is why i suggested using the
vanilla debug-repl.  I want to see if it has the same problem, because
I use it all the time and have never seen that problem.  I'm
trying to determine if the bug is only in swank/break, or in the
debug-repl too.  (I'm also trying to make people aware of the various
combinations/options available.)

Keep me posted!

thanks,
g

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