views:

546

answers:

5

I am shifting from DrScheme to Emacs to edit my PLT Scheme files. Can you teach me how to use steppers or debuggers in Emacs? Thanks.

A: 

You cannot do that with DrScheme's stepper and/or debugger, since they are currently integrated into DrScheme's GUI. It probably won't be too hard to make the connection, but nobody bothered with this work so far.

Eli Barzilay
Sir, how do you debug your scheme files in emacs? I really love my emacs but I dont think I can live without a good debugging option.
kunjaan
Well, there are many options for that. In fact, for the PL class, the lack of DrScheme's debugger and stepper will not be a problems since they will not be relevant tools even inside DrScheme. The good way to work is just the same as what HtDP teaches: write good contracts, write tests, and make sure that your code passes the tests. If you do all of that, you will find that debugging is something you need much more rarely, and in cases where you need it, simple printouts will do just fine.
Eli Barzilay
+2  A: 

Would something as simple as scheme-mode suffice or do you need something more along the lines of QuackMode? I highly-suggest you read around the Emacs Wiki article on Scheme as it describes a fair number of options regarding Scheme and Emacs. To be quite honest, a debugger and stepper wouldn't necessarily be found in Emacs even though they were present in DrScheme which is a specific environment. Perhaps looking for a Scheme debugger you like should be done before you figure out how to hook it into Emacs.

All this being said, I'm pretty sure that MIT-Scheme has what you want because you can run a Scheme process from Emacs. Also, there's EdWin.

yonkeltron
+1  A: 

Tracing functions can be helpful for debugging.

(trace function-name)

It will print arguments and return value. To turn off tracing use:

(untrace)
Aryadev
It's one of the best features for debugging. In Plt Scheme, make sure you (require (lib "trace.ss")) before.
A: 

you can try to setup slime for some scheme implementation. Look to my article about Emacs + Scheme

Alex Ott
A: 

This isn't the answer you're looking for, but I've found the best way to debug is to insert "printf"s throughout the code. Pretty Neanderthal, but ...

offby1