我正在阅读 SICP 并尝试跟进,但为什么我在网上找到的 Lisp 解释器在使用 DEFINE 关键字时会失败?
这是书...
http://mitpress.mit.edu/ sicp/full-text/book/book.html
知道我应该使用哪种解释器来处理此处提供的代码吗?
到目前为止,我已经尝试了一些在线并下载 Lisp 解释器,当我尝试使用 DEFINE 时,我得到的只是错误。
示例:
从此部分中: http: //mitpress.mit.edu/sicp/full-text/book/book-ZH-10.html#%_sec_1.1
在此输入:http://www.ugcs.caltech.edu/~rona/tlisp/
> (define (square x) (* x x))
*** EVAL Error: Function 'DEFINE' is not defined. ***
也尝试过与 'lispbox' 具有类似的结果。
啊哈: http://sisc-scheme.org/sisc-online.php 有效,感谢blabla999的提示,很快就会接受答案。
经过进一步研究:Scheme != Common Lisp
This is the book...
http://mitpress.mit.edu/sicp/full-text/book/book.html
Any idea which interpreter I should use to work with the code presented here?
So far I have tried a few online and download Lisp interpreters and all I get is errors when I try to use DEFINE.
Example:
From this section: http://mitpress.mit.edu/sicp/full-text/book/book-Z-H-10.html#%_sec_1.1
Put in here: http://www.ugcs.caltech.edu/~rona/tlisp/
> (define (square x) (* x x))
*** EVAL Error: Function 'DEFINE' is not defined. ***
Also tried with 'lispbox' with similar results.
Ah HA: http://sisc-scheme.org/sisc-online.php works, thanks for the tip blabla999, will accept answer soon.
Upon further research: Scheme != Common Lisp
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
可能是因为:
(EQ方案CommonLisp)-> #f
以及:
(EQ 方案 ManyOtherLisps) -> #f
尝试一个真正的方案(我推荐 plt,最近已更名为 Racket)。
(或者编写您自己的 - 请参阅 http://www.avc-cvut.cz/ avc.php?id=9769)
probably because:
(EQ Scheme CommonLisp) -> #f
and also:
(EQ Scheme ManyOtherLisps) -> #f
try a real scheme (I recommand plt, which has been renamed to Racket, recently).
(Or write your own - see http://www.avc-cvut.cz/avc.php?id=9769)
Lisp 有很多不同的方言,其中 Common Lisp 可能是当今最常用的。您所熟悉的Scheme 并不声称自己是Lisp,尽管它具有许多共同特征。
无论如何,您正在尝试做的事情是
用 Common Lisp 编写的。
There is a great many different dialects of Lisp, of which Common Lisp is perhaps the most used today. Scheme, with which you are familiar, does not claim to be a Lisp, although it shares many characteristics.
For what it's worth, what you are trying to do is written
in Common Lisp.
(到目前为止)我发现为 SCIP 中的示例获取 Lisp 环境的最简单方法是在此处找到的 Racket 中使用 DrRacket http://racket-lang.org/
DrRacket 环境有一个编辑器和 REPL,支持复制/粘贴和漂亮的打印,就像 Python Idle 工具一样。它安装简单,可与书中的所有示例一起使用,视频。
我在这里发现了关于学习 Lisp 的其他重要提示:http://www.lisp. Learningclojure.com/2011/02/advice-to-newbie.html
The simplest way (by far) I have found to get a Lisp environment for the examples in SCIP is to use DrRacket in Racket found here http://racket-lang.org/
The DrRacket environment has an editor and REPL that supports copy/paste and pretty print much like the Python Idle tool. It is simple to install and works with all of the examples from the book and the videos.
I found this other great hints on learning lisp here: http://www.learningclojure.com/2011/02/advice-to-newbie.html