如何在麻省理工学院方案中扩展宏
我写了一个简单的宏:
(define-syntax myif
(syntax-rules ()
((_ condition a b)
(if condition a b))))
用法示例:(myif#t“ yes”“否”)
。
在MIT方案中,如何显示上述示例的宏扩展?是否有类似于Common Lisp的Macroexpand
和Macroexpand-1
或球拍的展开
和Expand-once-once
?
(麻省理工学院方案版本:11.2)
I have written a simple macro:
(define-syntax myif
(syntax-rules ()
((_ condition a b)
(if condition a b))))
Usage example: (myif #t "yes" "no")
.
In MIT Scheme, how do I show the macro expansion of the example above? Is there something similar to Common Lisp's macroexpand
and macroexpand-1
or Racket's expand
and expand-once
?
(MIT Scheme version: 11.2)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
将打印SCODE。这足以调试。
正如它在汇编警告中所表达的那样,重要的是不要激活优化,否则您将不会再将其字面翻译成SCODE。
这是我调试(不仅宏)的起点。
will print the Scode. This is enough for debugging.
As it's expressed in the warning of compilation, it is important not to activate the optimizations, otherwise you won't see any more the literal translation into Scode.
This is the starting point when I debug (not only macros).