天天看點

mac osx 下安裝lisp環境sbcl,并解決方向鍵不能用問題

首先假設你的系統已經安裝好homebrew, 若沒有安裝可參看我之前的部落格: mac osx 下的apt-get,yum的代替工具 ----homebrew

安裝sbcl

$brew install sbcl
           

sbcl互動模式下, 輸入代碼時不支援左右箭頭移動光标,比較崩潰.

如下圖

$ sbcl
This is SBCL ., an implementation of ANSI Common Lisp.
More information about SBCL is available at <http://www.sbcl.org/>.

SBCL is free software, provided as is, with absolutely no warranty.
It is mostly in the public domain; some portions are provided under
BSD-style licenses.  See the CREDITS and COPYING files in the
distribution for more information.
* ()^[[D
           

接下來安裝rlwrap

$ brew install rlwrap
           

rlwrap是指令行輸入互動增強工具, 可以解決左右方向鍵問題和支援曆史指令等. 使用以下指令啟動sbcl即可

$ rlwrap sbcl
           

rlwrap的更多技巧可以參考這篇部落格: 【rlwrap】讓rlwrap工具更加的生動有趣——快捷鍵的嘗試

繼續閱讀