1)简单的宏
CL-USER> (defmacro print-test (x y)
`(format t "~A ~A~%" ,x ,y))
PRINT-TEST
CL-USER> (print-test 'hello 'world)
HELLO WORLD
NIL
2)
3)
本文介绍了Python中简单的宏定义使用方法,并通过实例展示了如何实现基本的宏功能,如打印测试。此外,还提供了从外部链接获取的进一步阅读资源。
1)简单的宏
CL-USER> (defmacro print-test (x y)
`(format t "~A ~A~%" ,x ,y))
PRINT-TEST
CL-USER> (print-test 'hello 'world)
HELLO WORLD
NIL
2)
3)
转载于:https://my.oschina.net/u/241930/blog/602136
7978

被折叠的 条评论
为什么被折叠?