求博士方案的简单方案成语

问题描述:

我正在通过SICP工作,同时使用Ableson/Sussman 讲座和伯克利61A讲座,这些讲座远远超过了我的 速度。我想做一些伯克利家庭作业,但需要定义句子,但第一个,最后一个等等。看起来似乎曾经有一种简单的方案语言嵌入到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 

我试图从here 抓住simply.scm文件,并粘贴到我计划博士定义窗口,但它不工作:

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

对于线(拉姆达(字符串参数)

(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) 

高级学员将永远不会真正除非你下面的设计为它说的实例为你工作。大多数书籍和实例将承担R5RS或类似的东西。我会建议使用预tty Big语言,包括R RS,以及PLT require语法,以及其他一些内容。

为了利用从地球上简单的方案包,您将需要使用新的需要语法(你可以在package listing page找到这个,它看起来像docs for the package尚未更新):

(require (planet dyoo/simply-scheme:1:2/simply-scheme)) 
+0

谢谢Brian。你是男人! – Leonard 2009-04-11 13:55:54