Article View: comp.text.tex
Article #2038Why \new... is outer. Was: reserving registers from within macros
From: David Kastrup
Date: Thu, 03 Sep 1992 13:37
Date: Thu, 03 Sep 1992 13:37
19 lines
1628 bytes
1628 bytes
asnd@reg.triumf.ca (Donald Arseneau) writes:
>In article <repasky.715398745@sun.bdc.ubc.ca>, repasky@bdc.ubc.ca (Dick Repasky) writes...
>>I would like to write a macro that reserves registers and assigns them
>>names using pararmeters passed to the macro. For example, a call such
>>as \doit{zork} would be expanded so that the result was \newinsert\bigzork.
>>I've made the following attempt:
>>
>> \def\doit#1{\expandafter\newinsert\csname big#1\endcsname}
>>
>>and I receive the error that \newinsert is a forbidden command sequence in
>>a macro definition. Does anyone have advice?
>The problem is that \newinsert etc are defined "\outer". There are two
>solutions:
The reason that the \new-commands are outer is that they are only needed
for global variables. If you do it locally (inside a new group) you can
use ANY numeric register (save those used by the output routine) and assign
any values to them, since they will be restored on end of the group.
Technical Details
Message-ID:
<dak.715527435@kaa>Path:
arc1-ca.pugleaf.net!sparky!uunet!dtix!darwin.sura.net!Sirius.dfn.de!Urmel.Informatik.RWTH-Aachen.DE!kaa!dakReferences:
<repasky.715398745@sun.bdc.ubc.ca> <2SEP199204130168@reg.triumf.ca>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!dtix!darwin.sura.net!Sirius.dfn.de!Urmel.Informatik.RWTH-Aachen.DE!kaa!dak From: dak@kaa.informatik.rwth-aachen.de (David Kastrup) Newsgroups: comp.text.tex Subject: Why \new... is outer. Was: reserving registers from within macros Keywords: \new..., register, reserve, macro, definition, forbidden control seq. Message-ID: <dak.715527435@kaa> Date: 3 Sep 92 13:37:15 GMT References: <repasky.715398745@sun.bdc.ubc.ca> <2SEP199204130168@reg.triumf.ca> Sender: news@Urmel.Informatik.RWTH-Aachen.DE (Newsfiles Owner) Organization: Rechnerbetrieb Informatik / RWTH Aachen Lines: 19 Nntp-Posting-Host: kaa