Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a balancing Scheme REPL for *nix?

I would like a command-line (must be a command line!) read-eval-print-loop Scheme interpreter. But spefically, I'd like an interpreter than can at least highlight parentheses, and maybe even keep a history like GNU readline-enabled programs. All of this at REPL-level.

Does this exist? Is it even possible? Do I have to hack this into some open-source REPL? Am I just bad at computer? Should I even bother?

I've checked other questions for this but I haven't quite found what I'm looking for. I've tried Racket and mzscheme, but it doesn't seem to do what I want. For now I'm using mit-scheme, but that balancing feature (much like whatever program they used in the SICP lectures) would be pretty much all I could ever want from it.

like image 705
eddieantonio Avatar asked Aug 27 '11 21:08

eddieantonio


1 Answers

Both Racket (with readline support loaded; see below) and Chez Scheme will do this. :-) So will Guile, but it will fold multi-line forms into a single line (unlike Racket/Chez).


To enable bracket matching for Racket, add this line to your ~/.racketrc:

(#%require readline/rep)

and this line to your ~/.inputrc:

set blink-matching-paren on
like image 165
Chris Jester-Young Avatar answered Nov 04 '22 04:11

Chris Jester-Young