为什么这在 DrRacket 中有效,但在控制台中的 Racket 中无效
(define pick
(lambda (num lat)
(cond ((null? lat) (quote()))
((= (sub1 num) 0) (car lat))
(else
(pick (sub1 num) (cdr lat))))))
(define brees (quote (a b c d e touchdown g h i)))
(pick 6 brees)
DrRacket 中的语言设置为高级学生。定义 sub1
后,它在 IronScheme 控制台中也可以正常工作。
错误消息为:
reference to undefined identifier: R
(define pick
(lambda (num lat)
(cond ((null? lat) (quote()))
((= (sub1 num) 0) (car lat))
(else
(pick (sub1 num) (cdr lat))))))
(define brees (quote (a b c d e touchdown g h i)))
(pick 6 brees)
The language in DrRacket is set to Advanced Student. It also works fine in the IronScheme console after defining sub1
.
The error message is:
reference to undefined identifier: R
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
当我在控制台中输入此内容时,我得到
How are you running this in the console?如果您正在加载它,则第一行可能需要一个
#lang Racket
。When I type this into the console I get
How are you running this in the console? If you are loading it, you may need a
#lang Racket
for the first line.