Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Prevent Guile from Starting a Debugger for Every Error?

I am using Guile in conjunction with Geiser under Emacs while learning how to program in Scheme. I find it actually a hindrance that Guile drops into a debugger each time I make a typo or enter a wrong piece of code. How can I make Guile more tolerant of my typos/errors and skip the debugger, while using it through Geiser under Emacs?

As I get more advanced in Scheme programming, how would I restore the default behavior or else how can I toggle between having the debugger always start vs start only on demand?

like image 470
haziz Avatar asked Sep 28 '22 18:09

haziz


2 Answers

You can set the on-error option to report, and it will simply report the error without dropping you in the debugger (that's the default value, debug); e.g.

scheme@(guile-user)> ,option on-error 'report
scheme@(guile-user)> (/ 1 0)
ERROR: Throw to key `numerical-overflow' with args `("/" "Numerical overflow" #f #f)'.
scheme@(guile-user)> 

See: https://www.gnu.org/software/guile/manual/html_node/System-Commands.html

like image 134
djcb Avatar answered Oct 08 '22 17:10

djcb


I don't really write a lot of Scheme, but it seems that you can just ignore the debugger.

If you're using lispy to do the eval with e, you don't even see the REPL window, you just get messages in the echo area with the result.

If you set (setq geiser-impl--implementation 'guile), and press e in lispy-mode, it will start a Geiser REPL automatically (if there isn't a live one) and eval the expression.

like image 39
abo-abo Avatar answered Oct 08 '22 16:10

abo-abo