DrRacket REPL not returning the cursor - racket

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.

Related

CounterClockWise Repl does not print result

I follow gruid install CounterClockwise in eclipse(Juno) and run the sample project, the Repl is up, but it's only show the command what I type, without result. For example, when i type (+ 2 3), just show ==> (+ 2 3). The result is also not printed in the consol view. I take hours on network but did not find out solution on this.
But when I run (javax.swing.JOptionPane/showMessageDialog nil "IT-Homer"), the correct window is shown. So I think clojure is run ok, but only the result is not show in the repl.
When the repl runs up, it show that clojure 1.6.0 is used.
Pls give help, thank you.

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.

How do I use defjump in emacs lisp to jump to a function in a file?

What I'd like that to do, is when I'm on a line of source such as: foo
And I hit a "jump" key, it should match href="foo.html" and open the file c:/project/root/templates/foo.html.
I've found jump.el (package 'jump' in emacs 24) and am trying to get defjump to work:
(require 'jump)
(defjump
'my-follow-ref
'(("href=\"\\1\"" . "templates/\\1"))
"c:/project/root/"
"Follow a logical link from one part of the source to another.")
My code is based on the example in the help, but I'm getting stuck on a pretty basic emacs lisp error:
mapcar: Wrong type argument: listp, quote
What am I doing wrong?
There is no jump.el in the emacs 24 source tree, and google is no help, but, I guess, your problem is unnecessary quoting: defjump is probably a macro.
Chances are this will work:
(defjump
my-follow-ref
(("href=\"\\1\"" . "templates/\\1"))
"c:/project/root/"
"Follow a logical link from one part of the source to another.")

How to stop evaluation of a large repl result causing slime with swank clojure to slow down?

Whenever I evaluate a large value that prints a large datastructure into the repl, slime becomes very slow from then on. Typing anything subsequently into the repl shows a delay in values appearing in the repl and further evaluation of any clojure code is slow. The only thing that seems to work is restarting the repl which doesn't seem like a solution.
An simple example of a large datastructure is slurping a file and then printing it (this could even be a fairly small file).
This seems to happen both in Win7 and Ubuntu.
Any ideas on how to stop this and why it is happening would be appreciated!
When I've run into this issue (which happens often), I simply clear the repl buffer. You can do this with C-c M-o, or by using "Clear Buffer" under the "REPL" menu item. This doesn't restart the repl, and command history and the like are unaffected.
One way you can control how much info is printed from the REPL is from clojure itself using the *print-length* and *print-level* variables.

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.