Article View: comp.text.tex
Article #1983Re: reserving registers from within macros
From: Donald Arseneau
Date: Wed, 02 Sep 1992 11:13
Date: Wed, 02 Sep 1992 11:13
22 lines
1581 bytes
1581 bytes
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:
1) redefine \newinsert the same way, but without the \outer.
(The definition is short. See plain.tex)
2) define \innernewinsert:
\edef\innernewinsert{\noexpand\newinsert}
The \noexpand hides the outerness.
Donald Arseneau asnd@reg.triumf.ca
Technical Details
Message-ID:
<2SEP199204130168@reg.triumf.ca>Path:
arc1-ca.pugleaf.net!sparky!uunet!usc!sol.ctr.columbia.edu!destroyer!ubc-cs!unixg.ubc.ca!reg.triumf.ca!asndReferences:
<repasky.715398745@sun.bdc.ubc.ca>Show Full Headers
Complete Article Headers
Newsgroups: comp.text.tex Path: arc1-ca.pugleaf.net!sparky!uunet!usc!sol.ctr.columbia.edu!destroyer!ubc-cs!unixg.ubc.ca!reg.triumf.ca!asnd From: asnd@reg.triumf.ca (Donald Arseneau) Subject: Re: reserving registers from within macros Message-ID: <2SEP199204130168@reg.triumf.ca> Summary: How to reserve registers within macros. News-Software: VAX/VMS VNEWS 1.41 Keywords: \new..., register, reserve, macro, definition, forbidden control seq. Sender: news@unixg.ubc.ca (Usenet News Maintenance) Nntp-Posting-Host: reg.triumf.ca Organization: TRIUMF: Tri-University Meson Facility References: <repasky.715398745@sun.bdc.ubc.ca> Date: Wed, 2 Sep 1992 11:13:00 GMT Lines: 22