4

我想通读这本书:http ://www.eecs.berkeley.edu/~bh/ss-toc2.html 。但是我很难让“简单方案”语言工作。代码不会运行。

    #lang planet dyoo/simply-scheme:2
    (parse ’(4 + 3 * 7 - 5 / (3 + 4) + 6))

我不断收到以下错误消息:“解析:模块中的未绑定标识符:解析”。

4

3 回答 3

5
于 2013-10-05T23:50:54.100 回答
1

There is also a module allowing you to run "Simply Scheme" here: https://gist.github.com/alexgian/5b351f367169b40a4ad809f0bb718e1f

You can just run it and then type your code in interactively, no need for an installation like the Planet/dyoo code mentioned above. Should you wish to, though, you can also install it, so that all you have to do then is to prefix any program with #lang simply-scheme and it will work. Instructions for how to do so can be seen here: https://groups.google.com/forum/#!topic/racket-users/jHPtw3Gzqk4 in the message by Matthew Butterick, June 4 2018.

This version takes care of some stuff not done the dyoo code, for instance

> (first 'american)
'a
> (first 'American)
"A"
> (every butfirst '(AmericAn Legacy CODE))
'("mericAn" egacy "ODE")

I.e. incorrect mixing of strings and symbols, instead of

> (first 'american)
a
> (first 'American)
A
> (every butfirst '(AmericAn Legacy CODE))
(mericAn egacy ODE)    

as it should be. The dyoo implementation might be more complete for docs, etc, though

However, as noted in the answer above, you will still have to enter the code for the parse function yourself, as this was the intention of the authors.

于 2018-06-06T10:41:53.640 回答
0

I had to revert to DrRacket 5.4.1 in order to get both Simply Scheme and SICP to work.

于 2014-03-31T05:30:36.583 回答