(eplain.info)Allocation macros


Next: Iteration Prev: Category codes Up: Programming definitions
Enter node , (file) or (file)node

7.2 Allocation macros
=====================

Plain TeX provides macros that allocate registers of each primitive type
in TeX, to prevent different sets of macros from using the same register
for two different things. The macros are all named starting with 'new',
e.g., '\newcount' allocates a new "count" (integer) register. Such
allocations are usually needed only at the top level of some macro
definition file; therefore, plain TeX makes the allocation registers
'\outer', to help find errors. (The error this helps to find is a
missing right brace in some macro definition.)

   Sometimes, however, it is useful to allocate a register as part of
some macro. An outer control sequence cannot be used as part of a macro
definition (or in a few other contexts: the parameter text of a
definition, an argument to a definition, the preamble of an alignment,
or in conditional text that is being skipped). Therefore, Eplain defines
"inner" versions of all the allocation macros, named with the prefix
'inner': '\innernewbox', '\innernewcount', '\innernewdimen',
'\innernewfam', '\innernewhelp', '\innernewif', '\innernewinsert',
'\innernewlanguage', '\innernewread',
'\innernewskip', '\innernewtoks', '\innernewwrite'.

   You can also define non-outer versions of other macros in the same
way that Eplain defines the above. The basic macro is called
'\innerdef':

     \innerdef \INNERNAME {OUTERNAME}

   The first argument (\INNERNAME) to '\innerdef' is the control
sequence that you want to define. Any previous definition of \INNERNAME
is replaced. The second argument (OUTERNAME) is the _characters_ in the
name of the outer control sequence. (You can't use the actual control
sequence name, since it's outer!)

   If the outer control sequence is named \CS, and you want to define
'innerCS' as the inner one, you can use '\innerinnerdef', which is just
an abbreviation for a call to '\innerdef'. For example, these two calls
are equivalent:

     \innerdef\innerproclaim{proclaim}
     \innerinnerdef{proclaim}


automatically generated by info2www version 1.2.2.9