英文:
Scheme is not able to identify define-macro
问题
我正在跟随Harvey教授的cs61a,其中提供了一个实现面向对象范式的文件(此处)。将其加载到Dr. Racket并添加simply-scheme语言(#lang simply-scheme
)时,我遇到了以下错误:
define-macro: unbound identifier in: define-macro
我不确定如何规避这个问题,寻找了不同的来源,但未能找到方向。
感谢帮助!
英文:
I'm following Prof. Harvey's cs61a and among the files made available, there is one that implements Object Oriented Paradigm (here). When loading it to Dr. Racket and adding the simply-scheme language (#lang simply-scheme
), I get the following error:
define-macro: unbound identifier in: define-macro
I'm not sure how to circumvent this problem, look for different sources but was not able to find a direction.
Thank you for the help!
答案1
得分: 2
起始的源文件链接如下:
;;; obj.scm 版本 4.0 2000年5月18日
;;; -- 对象导向语法的实现
;; 由Matt Wright编写,基于MIT的一份讲义
;; 由Brian Gaeke为STk进行修订 - 移除了scm和procedure->macro
因此,看起来这个源代码是为STk而不是Racket编写的。
如今,Racket不再使用define-macro
风格的宏。
最佳建议:在 https://racket.discourse.group/ 上提问,希望有人已经实现了OO语法。
如果你包含了OO语法的描述(类似于MIT的讲义),将会很有帮助。
请注意,Harvey建议安装UCB(他们的STk版本):
https://inst.eecs.berkeley.edu//~cs61a/sp11/
编辑
https://github.com/zackads/sicp/blob/main/inst.eecs.berkeley.edu/~cs61as/fa11/lib/obj.rkt
英文:
The source file linked begins:
;;; obj.scm version 4.0 5/18/2000
;;; -- implementation of the object-oriented syntax
;; By Matt Wright, based on a handout from MIT
;; Revised for STk by Brian Gaeke - removed scm and procedure->macro
So it seems the source for is for STk and not Racket.
These days Racket no longer uses define-macro
-style macros.
Best advice: Ask on https://racket.discourse.group/ and hope someone has implemented the OO-syntax.
It would be helpful, if you included a description of the OO-syntax
(like the MIT handout).
Note that Harvey writes to install UCB (their version of STk):
https://inst.eecs.berkeley.edu//~cs61a/sp11/
EDIT
https://github.com/zackads/sicp/blob/main/inst.eecs.berkeley.edu/~cs61as/fa11/lib/obj.rkt
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论