我如何在 Common Lisp 中重新实现反引号?
我必须重新制作反引号(使用取消引用和取消引用拼接)而不使用内置读取器宏 `,@ 预期的行为是:
> (BACKQUOTE (A B (LIST ‘C ‘D) (COMA (LIST ‘E ‘F)
(COMA-AT (LIST ‘G ‘H)))
(A B (LIST ‘C ‘D) (E F) G H)
我尝试使用宏来执行此操作,但结果不是预期的。
非常感谢!!!
有什么可以做的提示吗?
I have to remake backquote (with unquote and unquote-splicing) without using the builtins reader macros `,@
The behaviour expected is:
> (BACKQUOTE (A B (LIST ‘C ‘D) (COMA (LIST ‘E ‘F)
(COMA-AT (LIST ‘G ‘H)))
(A B (LIST ‘C ‘D) (E F) G H)
I try to do it with a macro but the results are no the expected.
Many thanks!!!
Any hints of what could be done?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
http://lib.store.yahoo.net/lib/paulgraham/glsbq.lisp 有一个例子
http://lib.store.yahoo.net/lib/paulgraham/glsbq.lisp has an example
对于那些在尝试理解保罗·格雷厄姆代码时接受简单且不正确的解决方案但它有效的人:
欢迎更正和改进它的建议!
For Those Who well settle for a simple and incorrect solution but it works, while trying to understand the paul graham code:
corrections and suggestions to improve it are welcome!