Dr Racket problems with SICP

耗尽温柔 提交于 2019-11-28 16:51:48
Eli Barzilay

Even if possible, such redefinitions are not something that you should do without really understanding how the system will react to this. For example, if you redefine +, will any other code break? The answer to that in Racket's case is "no" -- but this is because you don't really get to redefine +: instead, you define a new +, which only your code can use.

As for the language choice -- Rackets R5RS mode is a very strict one, and it's not something that you'd usually want to use. For a much more SICP-friendly environment, see Neil Van Dyke's SICP Support page which will provide you with a language specifically made for the book. (IIRC, it even has the graphical language that the books shows off.)

I ran into problems trying to work thru the RSA example here (part of the SICP stuff):
http://mitpress.mit.edu/sicp/psets/ps3/readme.html

To get this working I had to do this:

1) Run thru the initial download by adding this to the top of a blank file:

#lang planet neil/sicp

and then hitting "Run"

2) Enjoy DrRacket's very user friendly, automatic download and install the PLaneT Neil module by going to grab a coffee ;-)

3) And then once it is installed, close DrRacket.

4) Reopen, and choose SICP PLaneT 1.15 from the Choose A Language list.
(I could not get adding the declaration at the top to work for me aside from doing that to perform the initial download.)

Good luck!

In the language panel, you need to disable "disallow redefinition of initial bindings." This fixes the issue.

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