mit-scheme REPL with command line history and tab completion

前端 未结 2 1061
无人及你
无人及你 2021-01-30 22:47

I\'m reading SICP and I\'m using mit-scheme installed on my os x 10.8 laptop via homebrew.

Everything works as advertised, however I\'m spoiled by the ease with which I g

2条回答
  •  盖世英雄少女心
    2021-01-30 23: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 
    flo:abs    flo:acos   flo:asin   flo:atan   flo:atan2  
    1 ]=> (flo:abs -42.0)
    
    ;Value: 42.
    

提交回复
热议问题