Pattern Patter
Forces
ExampleC is extended with a macro language. Pro*C (Oracle) extends C with Oracle features.ResolutionUse a source-to-source translation via a macro or template language.DiscussionMacro facilities are often syntactically orthogonal to the rest of the language. For example, in C you can do this:#define STARTCALL(a) f(a You have to worry about compile-time vs run-time. The macro language can execute at compile-time. For example, Bliss (a low-level systems language similar to C) has an elaborate macro tool that can populate tables via arbitrary functions. The "modern" approach is to avoid a macro language. Java has none; C++ has a number of mechanisms that reduce the need for macros. More uses
[Written 12-1-98] |
|
Copyright 1994-2010, William C. Wake - William.Wake@acm.org |