Composable and compilable macros:: you want it when?
Composable and compilable macros:: you want it when?
复制标题
可组合和可编译宏:: 你什么时候想要它?
DOI:
--
复制
发表时间:
2002
期刊:
影响因子:
--
通讯作者:
M. Flatt
中科院分区:
文献类型:
--
作者:
M. Flatt
Many macro systems, especially for Lisp and Scheme, allow macro transformers to perform general computation. Moreover, the language for implementing compile-time macro transformers is usually the same as the language for implementing run-time functions. As a side effect of this sharing, implementations tend to allow the mingling of compile-time values and run-time values, as well as values from separate compilations. Such mingling breaks programming tools that must parse code without executing it. Macro implementors avoid harmful mingling by obeying certain macro-definition protocols and by inserting phase-distinguishing annotations into the code. However, the annotations are fragile, the protocols are not enforced, and programmers can only reason about the result in terms of the compiler's implementation. MzScheme---the language of the PLT Scheme tool suite---addresses the problem through a macro system that separates compilation without sacrificing the expressiveness of macros.