commit 3a00691bdfcf266d8bc394edcf270986452212d1
parent 759bae6da6c075507d0b9fe057afebd0935db12a
Author: robert <robertrussell.72001@gmail.com>
Date: Fri, 17 Dec 2021 12:45:34 -0800
Remove unused allocators
Diffstat:
| M | alloc.tex | | | 34 | ++++++---------------------------- |
1 file changed, 6 insertions(+), 28 deletions(-)
diff --git a/alloc.tex b/alloc.tex
@@ -54,7 +54,7 @@
\ifnum#3>#4%
\errmessage{No room for a new \string#1}%
\else
- \allocnum=#3%
+ \global\allocnum=#3%
\global#2#5=\allocnum
\wlog{\string#5=\string#1\the\allocnum}%
\global\advance#31
@@ -70,7 +70,7 @@
\protected\def\newread{\allocate\read\chardef\readnext\readmax}
\protected\def\newwrite{\allocate\write\chardef\writenext\writemax}
\protected\def\newfam{\allocate\fam\chardef\famnext\fammax}
-\protected\def\newattr{\allocate\attr\chardef\attrnext\attrmax}
+\protected\def\newattr{\allocate\attr\attrdef\attrnext\attrmax}
\protected\def\newcctab{\allocate\cctab\chardef\cctabnext\cctabmax}
\protected\def\newinsert#1{%
@@ -91,7 +91,7 @@
\newskip\centering \centering=0pt plus1000pt minus1000pt
\newbox\voidbox
-% Temporaries of various types, including macros:
+% Temporaries of various types:
\countdef\countA=30 \countdef\countB=31 \countdef\countC=32
\dimendef\dimenA=30 \dimendef\dimenB=31 \dimendef\dimenC=32
\skipdef\skipA=30 \skipdef\skipB=31 \skipdef\skipC=32
@@ -100,33 +100,11 @@
\toksdef\toksA=30 \toksdef\toksB=31 \toksdef\toksC=32
% temporary control sequences: csA csB csC
-% \protected\def\newif#1{%
- % \countA=\escapechar \escapechar=-1
- % \csdef{\ea\@remif\string#1true}{\let#1=\iftrue}%
- % \csdef{\ea\@remif\string#1false}{\let#1=\iffalse}%
- % \let#1=\iffalse
- % \escapechar=\countA
-% }
\protected\def\newif#1{%
- \csdef{\ea\@remif\csstring#1true}{\let#1=\iftrue}%
- \csdef{\ea\@remif\csstring#1false}{\let#1=\iffalse}%
- \let#1=\iffalse
+ \gcsdef{\ea\@remif\csstring#1true}{\let#1=\iftrue}%
+ \gcsdef{\ea\@remif\csstring#1false}{\let#1=\iffalse}%
+ \global\let#1=\iffalse
}
{\uccode`1=`i \uccode`2=`f \uppercase{\gdef\@remif12{}}}
-% TODO: do we really need this? If so, protect
-% Allocation of unique control sequences. Example usage:
-% \mycount=\setuniq\mymacro % Save \mymacro
-% ...
-% \letuniq\mymacro=\mycount % Restore \mymacro
-\newcount\uniqnext \uniqnext=0
-\def\letuniq#1{\deferasn{\letcs#1{uniq:\the\countA}}\countA}
-\def\gletuniq#1{\deferasn{\gletcs#1{uniq:\the\countA}}\countA}
-\def\@setuniq#1{\uniqnext
- \deferasn{\global\advance\uniqnext1 }%
- #1{uniq:\the\uniqnext}%
-}
-\def\setuniq{\@setuniq\cslet}
-\def\gsetuniq{\@setuniq\gcslet}
-
\endinput