- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在使用 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
我尝试从 here 获取 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 中我得到set!: 无法改变模块所需的标识符:数字->字符串(以下代码第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或类似的东西。我建议使用 Pretty Big 语言,因为它包括 R5RS、PLT require
语法以及其他一些内容。
为了使用 PLAneT 中的 SimplyScheme 包,您需要使用新的 require 语法(您可以在 package listing page 上找到它;看起来 docs for the package 尚未更新):
(require (planet dyoo/simply-scheme:1:2/simply-scheme))
关于scheme - 为 Dr.Scheme 寻找 SimplyScheme 成语,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/739525/
我正在使用 PLT 方案 (DrScheme)。我想加载从 here 获得的文件.要加载文件,我进入 PLT Scheme 并在交互窗口(或底部窗口)中输入(加载“simply.scm”),然后按 E
根据我的阅读,Scheme 中的符号不区分大小写 - 即 (eq? 'Hello 'hello) 评估为 #t (因为两者都由符号 'hello 表示,并且 scheme 具有两个具有相同名称的符
我正在尝试在 Scheme 中完成一个有限状态机。问题是,我不确定如何告诉它应该测试哪些字符。如果我想测试字符串“abc112”,我该怎么做? 代码如下: #lang racket (defin
我正在尝试做我的家庭作业,并通过一些示例代码进行破解,我看到了这一行: [(:+ (:or VAR)) (token-VAR (string->symbol lexeme))] 这是来自计算器中
我在 MIT/GNU Scheme 中运行了这个: (define x (+ 2 3)) 然后解释器打印: ;Value: x 但是根据我的教科书,define 表达式返回的值应该是未定义的。为什么解
考虑以下定义数字树的 BNF。请注意,树可以是叶子、具有一个子树的节点 1 或节点 2有两个子树。 tree ::= (’leaf number) | (’node-1 tree) | (’node-
(show-data 'YHOO :config 'my-config) 我看到了一些 Scheme 代码(在 Guile 中),如上面的行,并且对 colon 语法 :config 感到困惑。 这有
我目前正在尝试理解方案中流的概念。例如,我应该编写一个函数 fibonacci,它返回斐波那契数作为流表示形式。 函数的期望输出/用法如下所示: > (define a (finbonacci)) >
我想创建一个可以确定方案中任意函数定义的函数。如果我们将这样的函数称为“定义”,它会这样工作: (define (triple x) (* 3 x)) (definition triple) woul
在 Common Lisp 中,当我想根据 Common Lisp 实现使用不同的代码片段时,我可以使用 *features* 和提供的 #+ 和 #- 符号来检查给定功能的可用性并相应地进行。例如(
我正在学习 Scheme,具有 C/C++ 背景。我非常习惯于将相关的值组合到结构中,而且我发现 Scheme 的记录在这方面工作得很好。 如果发现自己经常这样做以避免函数体中的视觉噪音: (defi
在 Scheme R7RS 中,有 load 和 include 两种形式。 包含描述为: Semantics: Both include and include-ci take one or mor
我无法理解 Scheme 中收集器函数的使用。我正在使用“The Little Schemer”一书(Daniel P. Friedman 和 Matthias Felleisen 着)。一个带有一些
我知道您可以使用 (read) 来获取用户输入的表达式,但是 (read) 只会获取第一个表达式,然后对任何内容进行评估。我想知道是否有任何方法可以读取整行用户输入,也许将所述行转换为列表? (let
我正在重新熟悉 Scheme,我遇到了一个问题,这可能反射(reflect)了我的根本误解。 假设我在 Scheme 中执行以下操作(在这种情况下使用 Guile,但在 Chicken 中也是如此):
这是我目前正在自学的链接 Scheme,http://www.ccs.neu.edu/home/dorai/t-y-scheme/t-y-scheme-Z-H-1.html 据作者介绍, 然后我尝试了
假设我有这样的事情: (define pair (cons 1 (lambda (x) (* x x)) 如果我想返回这对的前对象,我会这样做: (car pair) 它返回 1。但是当对象是一个过程
我编写了以下示例,以尝试在 Chibi Scheme 0.5.3 中使用 R7RS 库: (define-library (example hello) (export hello-world
CODE SNIPPET 1 和 CODE SNIPPET 2 有什么区别? ;CODE SNIPPET 1 (define i 0) (do ()
长度为 n 的 k 元项链是一个长度为 n 的有序列表,其项目是从长度为 k 的字母表中抽取的,它是所有共享轮换排序的列表中按字典顺序排列的第一个列表。 例子: (1 2 3) 和 (1 3 2) 是
我是一名优秀的程序员,十分优秀!