mit-scheme REPL with command line history and tab completion

岁酱吖の 提交于 2019-12-02 16:19:43

Install the readline wrapper:

brew install rlwrap

Once installed, rlwrap scheme will give you persistent history, paren matching, and tab completion. I typically use rlwrap with the following arguments:

-r Put all words seen on in- and output on the completion list.

-c Complete filenames

-f Specify a list of words to use for tab completion. I'm using an abridged list of bindings from the MIT Scheme Reference Manual. Rather than republish the list here, you can find it in this gist. I have this file stored in "$HOME"/scheme_completion.txt

rlwrap -r -c -f "$HOME"/scheme_completion.txt scheme

1 ]=> (flo:a <tab tab>
flo:abs    flo:acos   flo:asin   flo:atan   flo:atan2  
1 ]=> (flo:abs -42.0)

;Value: 42.
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!