同样,也可以创建其他标准宏来使用样板中定义的变量。
Likewise, other standard macros can be created which make use of variables defined in the boilerplate.
syntax-case 宏并不是实际的标准,但是它们在很多 Scheme 系统中都已经实现了。
syntax-case macros are not really standard, but they are implemented on many Scheme systems.
现在我们只需要一个程序将这个宏转换成标准的 C 语言就可以了。 对于这个简单的例子来说,我们将使用 Perl 来实现这个程序,因为它可以对字符串中的用户代码进行评测,其语法也与 C 语言非常类似。
Now we just need a program to convert our macro into standard C. For this simple example, Perl is used because it can evaluate user code in a string, and its syntax is largely C-like.
应用推荐