2

我正在学习 SICP,同时使用 Ableson/Sussman 讲座和 Berkeley 61A 讲座,这比我的速度要快得多。我想做一些伯克利的作业,但需要句子的定义,butfirst,butlast 等等。看起来曾经有一种简单的方案语言内置于 Dr. Scheme,但最新的 4.1.5 版没有它。从Planet PLT ,我想我可以在我的定义窗口中简单地添加 (require (planet "simply-scheme.ss" ("dyoo" "simply-scheme" 1 0)))。我明白了

require: PLaneT
could not find the requested package: Server had no matching package:
No package matched the specified criteria

我尝试从这里抓取 simple.scm 文件 并将其粘贴到我的 Dr Scheme 定义窗口中,但它不起作用:

在高级学生模式下,我读到:非法使用“。”

对于以下代码中的 (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)
4

2 回答 2

4

除非您遵循为其设计的示例,否则 Advanced Student 永远不会真正为您工作。大多数书籍和示例将假定R 5 RS或类似的东西。我建议使用 Pretty Big 语言,因为它包括 R 5 RS、PLTrequire语法和其他一些东西。

为了使用 PLaneT 的 Simply Scheme 包,您需要使用新的 require 语法(您可以在包列表页面上找到它;看起来包的文档还没有更新):

(require (planet dyoo/simply-scheme:1:2/simply-scheme))
于 2009-04-11T05:47:14.780 回答
2

跟进;可以在以下位置找到 Racket 的简单方案支持库: 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

于 2011-08-26T23:43:19.567 回答