为 Dr.Scheme 寻找 SimplyScheme 成语
我正在使用 Ableson/Sussman 完成 SICP 讲座和伯克利 61A 讲座,这更多是我的 速度。 我想做一些伯克利的作业,但需要 句子、butfirst、butlast 等的定义。 看起来 Dr.Scheme 中曾经内置了一种简单的方案语言,但最新的 4.1.5 版本没有它。 来自Planet PLT 我想我可以简单地添加 (require (planet "simply-scheme.ss" ("dyoo" “简单方案”1 0))) 在我的定义窗口中。 我
require: PLaneT
could not find the requested package: Server had no matching package:
No package matched the specified criteria
尝试从此处获取 simple.scm 文件 并将其粘贴到我的博士方案定义窗口中,但它不起作用:
在高级学生模式下,我得到 阅读:非法使用“.”
对于以下代码中的 (lambda (string .args) 行。
(define whoops
(let ((string? string?)
(string-append string-append)
(error error)
(cons cons)
(map map)
(apply apply))
(define (error-printform x)
(if (string? x)
(string-append "\"" x "\"")
x))
(lambda (string . args)
(apply error (cons string (map error-printform args))))))
在 R5RS 中我得到 设置!:无法改变模块所需的标识符:数字->字符串 (以下代码第7行)
(if (char=? #\+ (string-ref (number->string 1.0) 0))
(let ((old-ns number->string)
(char=? char=?)
(string-ref string-ref)
(substring substring)
(string-length string-length))
(set! number->string
(lambda args
(let ((result (apply old-ns args)))
(if (char=? #\+ (string-ref result 0))
(substring result 1 (string-length result))
result)))))
'no-problem)
I'm working my way through SICP, using both the Ableson/Sussman
lectures and the Berkeley 61A lectures, which are far more my
speed. I'd like to do some of the Berkeley homework, but need the
definitions for sentence, butfirst, butlast and so forth. It looks like at one time there was a simply scheme language built in to Dr. Scheme, but version 4.1.5, the most recent, doesn't have it. From Planet PLT
I thought I could simply add (require (planet "simply-scheme.ss" ("dyoo"
"simply-scheme" 1 0))) in my definitions window. I get
require: PLaneT
could not find the requested package: Server had no matching package:
No package matched the specified criteria
I tried grabbing the simply.scm file from here
and pasted it into my Dr Scheme definitions window, but it doesn't work:
In Advanced Student mode, I get
read: illegal use of "."
For the line (lambda (string . args) in the following code.
(define whoops
(let ((string? string?)
(string-append string-append)
(error error)
(cons cons)
(map map)
(apply apply))
(define (error-printform x)
(if (string? x)
(string-append "\"" x "\"")
x))
(lambda (string . args)
(apply error (cons string (map error-printform args))))))
In R5RS I get
set!: cannot mutate module-required identifier in: number->string
(line 7 of the following code)
(if (char=? #\+ (string-ref (number->string 1.0) 0))
(let ((old-ns number->string)
(char=? char=?)
(string-ref string-ref)
(substring substring)
(string-length string-length))
(set! number->string
(lambda args
(let ((result (apply old-ns args)))
(if (char=? #\+ (string-ref result 0))
(substring result 1 (string-length result))
result)))))
'no-problem)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
除非您遵循为其设计的示例,否则高级学生永远不会真正为您工作。 大多数书籍和示例都会假设 R5RS 或类似的东西。 我建议使用 Pretty Big 语言,因为它包括 R5RS、PLT
require
语法以及其他一些东西。为了使用 PLAneT 中的 SimplyScheme 包,您需要使用新的 require 语法(您可以在 软件包列表页面;它看起来像 该包的文档尚未更新):
Advanced Student will never really work for you unless you're following examples that were designed for it. Most books and examples will assume R5RS or something like it. I would recommend using the Pretty Big language, as that includes both R5RS, as well as the PLT
require
syntax, and a few other things.In order to use the Simply Scheme package from PLaneT, you will need to use the new require syntax (you can find this on the package listing page; it looks like the docs for the package haven't been updated):
跟进; Racket 的 SimplyScheme 支持库可以在以下位置找到:
http://planet.plt-scheme.org /display.ss?package=simply-scheme.plt&owner=dyoo
我在 http://planet.plt-scheme.org/package-source/dyoo/simply-scheme.plt/2/1/planet-docs/manual/index.html。
Following up; the Simply Scheme support library for Racket can be found at:
http://planet.plt-scheme.org/display.ss?package=simply-scheme.plt&owner=dyoo
I did some light documentation updates in http://planet.plt-scheme.org/package-source/dyoo/simply-scheme.plt/2/1/planet-docs/manual/index.html.