Error setting load-noisily? and auto-exiting in MIT-Scheme

自作多情 提交于 2019-12-06 08:46:24

I'm not sure that this one qualifies as a full answer, but this is how to do it in vim+slimv:

  1. Keep only your (define ...) in sicp.scm, remove everything else from the file.
  2. Open sicp.scm in vim and press ,c to start/connect the swank server. This also opens a REPL window.
  3. Place the cursor somewhere into the (define ...) form and press ,d to define your function in the REPL.
  4. Go to the REPL window and type your test expression (e.g. (abs 42)) in insert mode then press ENTER, this will evaluate the test expression and display the result in the REPL window.
  5. You can also evaluate s-expressions from your source window via ,d. Please note that when evaluating multiple s-expressions in one single step (e.g. evaluating a visual selection via ,r) then only the result of the last s-expression is displayed in the REPL window.
  6. In case an error happens then slimv opens the debugger window, displays the backtrace and the possible restarts.

OK - I've never used Vim, and haven't used Scheme since 1992 - so I'm guessing here.

Setting load-noisily? inside the file being loaded is probably too late (because load has already decided not to be noisy before it even opens the file). You probably need to set it before calling load. Try removing it from the file and using :!mit-scheme --eval "(begin (set! load-noisily? #t) (load \"sicp\"))"

As far as (exit) is concerned, I have no idea, but...

I've also never used slimv (or here), but it is apparently the Vim equivalent of Slime, which I have used. Slime turns emacs into a wonderful Lisp IDE, and will hopefully do the same for Scheme and Vim.

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