宏变量会被“就地”扩展,其所产生的文本字符串还可以进一步的扩展。
A macro variable is expanded "in place" to yield a text string that may then be expanded further.
这是因为实际的源代码和变量绑定可以更改,这是建立在环境或者构建宏预处理程序指令的时间定义的基础上的。
This is because the actual source code and the variable binding can change, based on the environment or the build time definitions of macros and preprocessor commands.
使用这样的宏可以显著减少代码输入量,因为不必不断地编写和重新编写变量绑定、派生和参数传递。
Using macros like this significantly reduces typing because you do not have to constantly be writing and rewriting variable bindings, derivations, and parameter passing.
健康的宏可以安全地在任何地方使用,不必担心与现有的变量名冲突。
Hygienic macros can be safely used anywhere without fear of stomping on existing variable names.
这意味着宏所使用的所有临时变量都会在替换发生之前自动重新进行命名,从而防止名字产生冲突。
This means that all temporary variables used by a macro are automatically renamed before the substitution occurs in order to prevent them from having conflicting names.
如果引入的变量名正好是一个宏中以前定义过的,那么就会覆盖绑定。
Accidentally overwriting bindings by introducing a variable name that was previously defined in a macro.
在宏内开头定义DATABASE变量告诉它要连接到哪一个数据库。
Define a database variable initially within the macro to tell it which database to connect to.
同样,也可以创建其他标准宏来使用样板中定义的变量。
Likewise, other standard macros can be created which make use of variables defined in the boilerplate.
仔细地在文档中记录所有样板宏,尤其是引入的变量绑定和版本之间的所有变化。
Carefully document all boilerplate macros, especially the introduced variable bindings and all changes between versions.
常用的汇编级结构,比如变量、循环、标签和宏。
Common assembly level constructs such as variables, loops, labels, and macros.
这个简单的宏(清单4)通过引入一个新的临时变量来实现交换。
This simple macro (Listing 4) implements the swap by introducing a new temporary variable.
把 #undef宏改为 #define,把变量类型设置为int(见清单2)。
Change the #undef macros to #define and set the variable types to int (see Listing 2).
不需要通过 read_inheritable_attribute宏来使用属性,因为这是ActiveRecord定义的类实例变量。
There's no need to go through the read_inheritable_attribute macro to use attributes because these are class instance variables defined by ActiveRecord.
该宏创建了一个变量数组(每个CPU一个变量)。
The macro creates an array of variables, one per CPU instance.
健康的宏在宏中安全地引入变量名,但是有时候也想让宏成为非健康的。
While hygienic macros make introducing variable names within macros safe, there are cases in which you will want your macros to be non-hygienic.
非健康宏的问题是,引入的变量和代码中的其他变量可能相互覆盖。
The problem with non-hygienic macros is that the introduced variables can overwrite and be overwritten by other variables in the code.
为宏建立明确的命名约定,并指出来自样板代码的变量。
Have a naming convention which clearly labels macros as such, as well as indicate that a variable came from boilerplate code.
例如,假设您希望创建一个宏,它将一个变量引入调用宏的人可以使用的范围中。
For example, let's say that you wanted to create a macro that introduced a variable into a scope that could be used by the person calling the macro.
per - CPU变量由define_per_cpu宏进行定义,需要为该宏提供类型和变量名称。
Defining a per-CPU variable is done with the DEFINE_PER_CPU macro, to which you provide a type and variable name.
用不冲突的名称替换引入的变量名,这种方法称为健康的(hygiene);产生的宏称为健康的宏(hygienicmacros)。
The idea of replacing introduced variable names with non-conflicting names is called hygiene; the resulting macros are called hygienic macros.
这个宏引入了一个名为c的新变量。
由于宏的运作方式与l - value类似,因此也可在宏中进行变量的初始化。
Since the macro behaves like an l-value, you can also initialize it there.
表5 - 1是本章所涉及到的一些函数,宏,变量以及数据结构。
Table 5-1. Functions, macros, variables, and data structures related to system.
汇编程序采用的一种动作,例如在宏定义展开时,它用一个值来代替一个变量符号。
The action taken by the assembler when it replaces a variable symbol with a value , for example , during the expansion of a macro definition.
读写前一步长下的时间在表5.2.1里的宏中加入下标_M1就可以得到前一次步长时间下(t-⊿t)的变量的值。
The M1 suffix can be generally applied to the macros in Table 5.2.1 to allow access to the value of the variable at the previous time step (i. e.
这使您可以在每次宏运行时重置发生时自动重新初始化变量和事件处理程序。
This allows you to automatically re-initialize variables and event handlers whenever a macro runtime reset occurs.
如果您已经定义了几个变量的步骤,应该很容易写一个宏,不会在变化的情况下停止。
If you have defined the steps with a few variables, it should be easy to write a macro that wouldn't stop in case of variation.
宏在宏执行之间保持它们的变量值,但不在集成开发环境(IDE)的会话之间保持变量值。
Macros maintain the value of their variables between executions of the macro, but not between sessions of the integrated development environment (IDE).
单元格宏这章所列出的宏是由求解器返回的实数变量,并且这些变量都是定义在一个单元格中的。
The macros listed in this section are real variables returned by the solver, and are de_ned on a cell.
单元格宏这章所列出的宏是由求解器返回的实数变量,并且这些变量都是定义在一个单元格中的。
The macros listed in this section are real variables returned by the solver, and are de_ned on a cell.
应用推荐