How to invoke restart on condition from Sly/REPL? - emacs

Once after I made some error condition, I get a prompt looks like:
[1] CL-USER>
It seems like, the number in square bracket indicates number of restart conditions of current REPL.
But, IDK how can I (re-)invoke the restart from REPL. (I'm using SBCL/Sly)
Thank you in advance.

Related

How do you cope with emacs halting on receiving big input?

I am developing project in clojure using emacs cider under windows. And sometimes I have a problem that after accidently forgotten println function or on printing contents of big file Emacs stops responding (cursor and all key combinations doesn't work) and retire into oneself for processing that information to show it in repl. The only way to continue I know is to close program and open project files from scratch. And it is so simple to get in this trap.
Are there any other better solutions or configuration restrictions?
Though this suggestion will not solve your problem completely, it can help you a little.
First, set *print-length* to some value to limit the number of items of each collection to be printed.
(set! *print-length* 10)
And use cider-connect instead of cider-jack-in. You should run lein repl in a separate console window, then run cider-connect to connect to the repl. Then you can evaluate some expressions in the console window.
It would be good if there's an option to limit the contents to be printed by number of characters, however, I couldn't find it.

Clojure command line: cursor moves every time I type closing parenthesis

In the clojure command line
user=>
Every time I close a parenthesis, the cursor ▌ quickly moves to the opening paren of that block and moves back right away (probably to help me see where I started).
This can quickly get very frustrating when I type fast. How can I turn this option off?
if you are using lein repl, it should be using readline - put the following in ~/.inputrc
set blink-matching-paren off

DrRacket REPL not returning the cursor

I am using Dr Racket for racket programming. I am a newbie.
I have run into this problem where when I type anything on the REPL, lets say:
> (define a 7)
The cursor never returns.
If I define this in the editor
(define a 7)
And in the REPL I do
> a
The cursor never returns.
I do have #lang racket at the very top in the editor window.
It was working just fine for some time and then it suddenly stopped working.
Can you help?
It is an old bug that sometimes appears on Ubuntu, no one has yet figured out why.
On relevant problem report: http://bugs.racket-lang.org/query/?cmd=view&pr=12640
I find it much less frequent these days though.
Meanwhile, I've found that if the pointer doesn't return, you can type other things like 'a or 1.1 followed by Enter, and it should evaluate both expressions at once and return the pointer. Note that the particular case that you give does not occur on my machine.
(define a 7)
should not be printing anything. It is merely binds a to be 7. Try typing a into REPL after and see what you get.
See Racket's documentation on define for further info.

debug the last sentence of a program

I have used Eclipse and VS. When I insert a breakpoint and debug the program, it will stop before the breakpoint.
But what if I want to debug the effect of the last sentence of the program? Inserting a meaningless sentence(say print 'pause' in Python) is OK but seems awkward. Is there any alternatives?
In Visual Studio you can put break point on closing bracket in main (or any) method of Program (or any) class (default naming, may vary), then debugger stops just before closing application.
Is there any reason not to use a breakpoint on the last statement, like you said, then manually proceed one step? Depending on the debugger, this can also be automated. In GDB, one can use commands N, where N is the breakpoint number, to set a list of (debugger) commands to be executed immediately after a breakpoint is hit.

My slime-repl is not working in ClojureBox

I installed ClojureBox and the REPL is not working.
If I type (+ 1 2) into the *slime-repl clojure* buffer and press enter, the expression text becomes bold as if it has been evaluated, but there is no result of the evaluation printed on the screen.
Can anyone help me figure out why my REPL is not printing the evaluation results?
Thanks.
Try looking in *inferior-lisp* and failing that all other buffers.
The binding of clojure's *out* plus emacs slime-swank based capture and redirection of output streams can occasionally make it seem like emacs is swallowing output. (This can get really confusing when output comes from multiple threads - definitely one of the few warts of developing clojure with the slime-swank environment.)
Have you ever tried emacs before using clojurebox? Any left behind .emacs configuration or library paths etc. can interact badly with clojurebox which, in my experience, assumes it is the only installation of emacs going onto a clean system.