texlive[60117] Master/texmf-dist: macrolist (30jul21)

commits+karl at tug.org commits+karl at tug.org
Fri Jul 30 22:14:14 CEST 2021


Revision: 60117
          http://tug.org/svn/texlive?view=revision&revision=60117
Author:   karl
Date:     2021-07-30 22:14:14 +0200 (Fri, 30 Jul 2021)
Log Message:
-----------
macrolist (30jul21)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/macrolist/README.md
    trunk/Master/texmf-dist/doc/latex/macrolist/macrolist.pdf
    trunk/Master/texmf-dist/source/latex/macrolist/macrolist.dtx
    trunk/Master/texmf-dist/tex/latex/macrolist/macrolist.sty

Modified: trunk/Master/texmf-dist/doc/latex/macrolist/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/macrolist/README.md	2021-07-30 20:13:55 UTC (rev 60116)
+++ trunk/Master/texmf-dist/doc/latex/macrolist/README.md	2021-07-30 20:14:14 UTC (rev 60117)
@@ -1,4 +1,4 @@
-# The LaTeX package macrolist - version 1.2.1 (2021/07/25)
+# The LaTeX package macrolist - version 2.0.0 (2021/07/29)
 
 > Copyright (C) 2021 Dennis Chen <proofprogram at gmail.com>
 >

Modified: trunk/Master/texmf-dist/doc/latex/macrolist/macrolist.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/source/latex/macrolist/macrolist.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/macrolist/macrolist.dtx	2021-07-30 20:13:55 UTC (rev 60116)
+++ trunk/Master/texmf-dist/source/latex/macrolist/macrolist.dtx	2021-07-30 20:14:14 UTC (rev 60117)
@@ -16,7 +16,7 @@
 %<*package>
 
 \NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{macrolist}[2021/07/25 v1.2.1 Create lists of macros and perform operations on them]
+\ProvidesPackage{macrolist}[2021/07/29 v2.0.0 Create lists of macros and perform operations on them]
 
 \RequirePackage{pgffor}
 %</package>
@@ -35,6 +35,7 @@
 %</driver>
 % \fi
 %
+% \changes{v2.0.0}{2021/07/29}{Add ``macro'' in front of each external command (to avoid conflicts with etoolbox)}
 % \changes{v1.0.2}{2021/07/17}{Print changelog in documentation}
 % \changes{v1.0.2}{2021/07/17}{Added comment markers to remove pars and fix spacing in listforeach}
 % \changes{v1.0.1}{2021/07/16}{Make a couple of defs and lets global to prevent scoping issues}
@@ -52,19 +53,19 @@
 % \maketitle
 %
 % \begin{abstract}
-% The \textsf{macrolist} package allows you to create lists and manipulate them, with utilities such as |\listforeach| and an implementation of arr.join() from Javascript. Contrary to the name of the package, non-macros and groups of macros can be put into an item of the list.
+% The \textsf{macrolist} package allows you to create lists and manipulate them, with utilities such as |\macrolistforeach| and an implementation of arr.join() from Javascript. Contrary to the name of the package, non-macros and groups of macros can be put into an item of the list.
 % \end{abstract}
 %
 % \section{Usage}
 % The scope of lists is always global. This provides the most consistency and functionality for developers in places that are usually local (part of a group), such as environments and loops.
 %
-% \DescribeMacro{\newlist}
-% To create a list, pass in |\newlist{listname}| to create a list with the name \textsf{listname}.
+% \DescribeMacro{\macronewlist}
+% To create a list, pass in |\macronewlist{listname}| to create a list with the name \textsf{listname}.
 %
 % The package checks that \textsf{listname} is not the name of another list, and will throw an error if another list \textsf{listname} has already been defined.
 %
 % \iffalse
-\newcommand{\newlist}[1]{
+\newcommand{\macronewlist}[1]{
     \ifcsname c at macrolist@list@#1\endcsname
         \PackageError{macrolist}{The list '#1' is already defined}{}
     \else
@@ -75,41 +76,42 @@
 % \fi
 %
 % \changes{v1.1.0}{2021/07/22}{Add listexists}
-% \DescribeMacro{\listexists}
-% Writing |\listexists{listname}{true}{false}| will execute \textsf{true} if \textsf{listname} exists and \textsf{false} otherwise.
+% \DescribeMacro{\macrolistexists}
+% Writing |\macrolistexists{listname}{true}{false}| will execute \textsf{true} if \textsf{listname} exists and \textsf{false} otherwise.
 %
 % \iffalse
-\newcommand{\listexists}[3]{\ifcsname c at macrolist@list@#1\endcsname#2\else#3\fi}
+\newcommand{\macrolistexists}[3]{\ifcsname c at macrolist@list@#1\endcsname#2\else#3\fi}
 % \fi
 %
-% \DescribeMacro{\listelement}
+% \DescribeMacro{\macrolistelement}
 %
-% To execute the \textsf{i}th element of \textsf{listname}, write |\listelement{listname}{i}|. Note that \textit{lists are 1-indexed}, meaning the first element is numbered 1, the second element numbered 2, and so on.
+% To execute the \textsf{i}th element of \textsf{listname}, write |\macrolistelement{listname}{i}|. Note that \textit{lists are 1-indexed}, meaning the first element is numbered 1, the second element numbered 2, and so on.
 %
 % An error will be thrown if \textsf{listname} is not a defined list, if \textsf{i} is empty, or if \textsf{i} is greater than the size of the list.
 %
 % \iffalse
-\newcommand{\listelement}[2]{%
+\newcommand{\macrolistelement}[2]{%
     \macrolist at inbounds{#1}{#2}%
     \csname macrolist at list@#1\the\numexpr #2\relax\endcsname%
 }
 % \fi
+% \changes{}
 % \changes{v1.2.1}{2021/07/25}{Fix behavior of listindexof and listcontains for empty lists}
 % \changes{v1.2.0}{2021/07/23}{Add listindexof and listcontains}
-% \DescribeMacro{\listindexof}
+% \DescribeMacro{\macrolistindexof}
 %
-% This works similar to \textsf{indexof} in almost any ordinary programming language. Write |\listindexof{list}{element}| to get the index of where \textsf{element} first appears in \textsf{list}. If it never does, then the macro will expand to \textsf{0}.
+% This works similar to \textsf{indexof} in almost any ordinary programming language. Write |\macrolistindexof{list}{element}| to get the index of where \textsf{element} first appears in \textsf{list}. If it never does, then the macro will expand to \textsf{0}.
 %
-% The command uses |\ifx| instead of |\if|; this means that if you have |\macro| as an element with the definition \textsf{this is a macro} (assuming that \textsf{this is a macro} is not an element itself), then |\listindexof{listname}{this is a macro}| will expand to \textsf{0}.
+% The command uses |\ifx| instead of |\if|; this means that if you have |\macro| as an element with the definition \textsf{this is a macro} (assuming that \textsf{this is a macro} is not an element itself), then |\macrolistindexof{listname}{this is a macro}| will expand to \textsf{0}.
 %
 % Because of the implementation of this macro, it can't actually be parsed as a number. (See the `Limitations' section for more information.) 
 % \iffalse
-\newcommand{\listindexof}[2]{%
+\newcommand{\macrolistindexof}[2]{%
     \def\macrolist at listindex{0}%
     \macrolist at exists{#1}%
-    \ifnum\listsize{#1}>0\relax
+    \ifnum\macrolistsize{#1}>0\relax
         \def\macrolist at el{#2}%
-        \listforeach{#1}{\macrolist at listindexel}[\listsize{#1}][1]{%
+        \macrolistforeach{#1}{\macrolist at listindexel}[\macrolistsize{#1}][1]{%
             \ifx\macrolist at el\macrolist at listindexel
                 \xdef\macrolist at listindex{\macrolist at index}%
             \fi
@@ -120,17 +122,17 @@
 }
 % \fi
 %
-% \DescribeMacro{\listcontains}
+% \DescribeMacro{\macrolistcontains}
 %
-% Writing |\listcontains{listname}{element}{true branch}{false branch}| checks whether list \textsf{listname} contains \textsf{element}, executing \textsf{true branch} if it does and \textsf{false branch} if it does not.
+% Writing |\macrolistcontains{listname}{element}{true branch}{false branch}| checks whether list \textsf{listname} contains \textsf{element}, executing \textsf{true branch} if it does and \textsf{false branch} if it does not.
 %
 % \iffalse
-\newcommand{\listcontains}[4]{%
+\newcommand{\macrolistcontains}[4]{%
     \def\macrolist at listindex{0}%
     \macrolist at exists{#1}%
-    \ifnum\listsize{#1}>0\relax
+    \ifnum\macrolistsize{#1}>0\relax
         \def\macrolist at el{#2}%
-        \listforeach{#1}{\macrolist at listindexel}[\listsize{#1}][1]{%
+        \macrolistforeach{#1}{\macrolist at listindexel}[\macrolistsize{#1}][1]{%
             \ifx\macrolist at el\macrolist at listindexel
                 \xdef\macrolist at listindex{\macrolist at index}%
             \fi
@@ -144,28 +146,28 @@
 }
 % \fi
 %
-% \DescribeMacro{\listadd}
+% \DescribeMacro{\macrolistadd}
 %
-% To add something to the list \textsf{listname}, pass in |\listadd{listname}[position]{element}|, where \textsf{position} is an optional argument. If nothing is passed in for \textsf{position}, then by default \textsf{element} will be added to the end of the list.
+% To add something to the list \textsf{listname}, pass in |\macrolistadd{listname}[position]{element}|, where \textsf{position} is an optional argument. If nothing is passed in for \textsf{position}, then by default \textsf{element} will be added to the end of the list.
 %
 % \iffalse
-\newcommand{\listadd}[1]{
+\newcommand{\macrolistadd}[1]{
     \macrolist at exists{#1}
     \def\macrolist at currlist{#1}
     \macrolist at listadd
 }
-%% We write \listadd this way such that the optional argument will be positioned correctly
+%% We write \macrolistadd this way such that the optional argument will be positioned correctly
 \newcommand{\macrolist at listadd}[2][]{
     \stepcounter{macrolist at list@\macrolist at currlist}
 
     \if\relax\detokenize{#1}\relax
-        \expandafter\gdef\csname macrolist at list@\macrolist at currlist\listsize{\macrolist at currlist}\endcsname{#2}
+        \expandafter\gdef\csname macrolist at list@\macrolist at currlist\macrolistsize{\macrolist at currlist}\endcsname{#2}
     \else
         \expandafter\ifnum\csname themacrolist at list@\macrolist at currlist\endcsname=#1
-            \expandafter\gdef\csname macrolist at list@\macrolist at currlist\listsize{\macrolist at currlist}\endcsname{#2}
+            \expandafter\gdef\csname macrolist at list@\macrolist at currlist\macrolistsize{\macrolist at currlist}\endcsname{#2}
         \else
             \macrolist at inbounds{\macrolist at currlist}{#1}
-            \foreach \macrolist at index in {\listsize{\macrolist at currlist}, ...,\the\numexpr #1+1\relax} {
+            \foreach \macrolist at index in {\macrolistsize{\macrolist at currlist}, ...,\the\numexpr #1+1\relax} {
                 \global\expandafter\let\csname macrolist at list@\macrolist at currlist\macrolist at index\expandafter\endcsname\csname macrolist at list@\macrolist at currlist\the\numexpr\macrolist at index-1\relax\endcsname
             }
             \expandafter\gdef\csname macrolist at list@\macrolist at currlist#1\endcsname{#2}
@@ -174,47 +176,47 @@
 }
 % \fi
 %
-% \DescribeMacro{\listremove}
+% \DescribeMacro{\macrolistremove}
 %
-% To remove an element in a list, write |\listremove{listname}{index}|.
+% To remove an element in a list, write |\macrolistremove{listname}{index}|.
 %
 % \iffalse
-\newcommand{\listremove}[2]{
+\newcommand{\macrolistremove}[2]{
     \macrolist at inbounds{#1}{#2}
 
-    \ifnum\numexpr#2\relax=\listsize{#1}
+    \ifnum\numexpr#2\relax=\macrolistsize{#1}
     \else
-        \foreach \macrolist at index in {#2, ..., \the\numexpr\listsize{#1}-1\relax} {
+        \foreach \macrolist at index in {#2, ..., \the\numexpr\macrolistsize{#1}-1\relax} {
             \global\expandafter\let\csname macrolist at list@#1\macrolist at index\expandafter\endcsname\csname macrolist at list@#1\the\numexpr\macrolist at index+1\endcsname
         }
     \fi
 
-    \global\expandafter\let\csname macrolist at list@#1\listsize{#1}\endcsname\relax
+    \global\expandafter\let\csname macrolist at list@#1\macrolistsize{#1}\endcsname\relax
     \addtocounter{macrolist at list@#1}{-1}
 }
 % \fi
 %
-% \DescribeMacro{\listremovelast}
+% \DescribeMacro{\macrolistremovelast}
 %
-% To remove the last element in a list, write |\listremovelast{listname}|. This behaves like C++'s |pop_back|.
+% To remove the last element in a list, write |\macrolistremovelast{listname}|. This behaves like C++'s |pop_back|.
 %
 % \iffalse
-\newcommand{\listremovelast}[1]{
+\newcommand{\macrolistremovelast}[1]{
     \macrolist at exists{#1}
-    \global\expandafter\let\csname macrolist at list@#1\listsize{#1}\endcsname\relax
+    \global\expandafter\let\csname macrolist at list@#1\macrolistsize{#1}\endcsname\relax
     \addtocounter{macrolist at list@#1}{-1}
 }
 % \fi
 %
-% \DescribeMacro{\listclear}
+% \DescribeMacro{\macrolistclear}
 %
-% To clear a list, write |\listclear{listname}|.
+% To clear a list, write |\macrolistclear{listname}|.
 %
 % \iffalse
-\newcommand{\listclear}[2]{
+\newcommand{\macrolistclear}[2]{
     \macrolist at inbounds{#1}{#2}
 
-    \foreach \macrolist at index in {1, ..., \listsize{#1}} {
+    \foreach \macrolist at index in {1, ..., \macrolistsize{#1}} {
         \global\expandafter\let\csname \macrolist at list@#1\macrolist at index\endcsname\relax
     }
 
@@ -222,36 +224,36 @@
 }
 % \fi
 %
-% \DescribeMacro{\listsize}
+% \DescribeMacro{\macrolistsize}
 %
-% To get the size of a list, write |\listsize{listname}|.
+% To get the size of a list, write |\macrolistsize{listname}|.
 %
 % \iffalse
-\newcommand*{\listsize}[1]{%
+\newcommand*{\macrolistsize}[1]{%
     \macrolist at exists{#1}%
     \csname themacrolist at list@#1\endcsname
 }
 % \fi
 %
-% \DescribeMacro{\listforeach}
+% \DescribeMacro{\macrolistforeach}
 % \changes{v1.1.1}{2021/07/23}{Fix foreach doc by removing incorrect begin}
 %
 % To write a for each loop, write
 % \begin{verbatim}
-%\listforeach{listname}{\element}[begin][end]{action}
+%\macrolistforeach{listname}{\element}[begin][end]{action}
 % \end{verbatim}
 %
 %
-% Note that begin and end are optional arguments, and by default, they take the values \textsf{1} and |\listsize{listname}|. If you pass in \textsf{begin}, you must also pass in \textsf{end}.
+% Note that begin and end are optional arguments, and by default, they take the values \textsf{1} and |\macrolistsize{listname}|. If you pass in \textsf{begin}, you must also pass in \textsf{end}.
 %
 % \iffalse
-\newcommand{\listforeach}[2]
+\newcommand{\macrolistforeach}[2]
 {%
     \def\macrolist at foreachstart{0}% Reset
     % This is used to make optional arguments line up correctly
 %
     \def\macrolist at start{1}%
-    \def\macrolist at end{\listsize{#1}}%
+    \def\macrolist at end{\macrolistsize{#1}}%
     \def\macrolist at listname{#1}%
     \def\macrolist at element{#2}%
     \macrolist at listforeachi
@@ -281,11 +283,11 @@
 %
     \macrolist at exists{\macrolist at listname}%
 %
-    \ifnum\numexpr\macrolist at start\relax>\listsize{\macrolist at listname}%
+    \ifnum\numexpr\macrolist at start\relax>\macrolistsize{\macrolist at listname}%
         \PackageError{macrolist}{The starting index of the loop is out of the bounds of list '\macrolist at listname'}{}
     \fi
 %
-    \ifnum\numexpr\macrolist at end\relax>\listsize{\macrolist at listname}
+    \ifnum\numexpr\macrolist at end\relax>\macrolistsize{\macrolist at listname}
         \PackageError{macrolist}{The ending index of the loop is out of the bounds of list '\macrolist at listname'}{}
     \fi
 %
@@ -296,17 +298,17 @@
 }
 % \fi
 %
-% \DescribeMacro{\listjoin}
+% \DescribeMacro{\macrolistjoin}
 %
-% Executing |\listjoin{listname}{joiner}| returns all of the elements separated by \textsf{joiner}. This behaves like Javascript's \textsf{arr.join()}.
+% Executing |\macrolistjoin{listname}{joiner}| returns all of the elements separated by \textsf{joiner}. This behaves like Javascript's \textsf{arr.join()}.
 %
 % \iffalse
-\newcommand{\listjoin}[2]{%
-    \ifnum\listsize{#1}>1
-        \listforeach{#1}{\macrolist at joinelement}[1][\listsize{#1}-1]{\macrolist at joinelement#2}%
+\newcommand{\macrolistjoin}[2]{%
+    \ifnum\macrolistsize{#1}>1
+        \macrolistforeach{#1}{\macrolist at joinelement}[1][\macrolistsize{#1}-1]{\macrolist at joinelement#2}%
     \fi
-    \ifnum\listsize{#1}>0
-        \listelement{#1}{\listsize{#1}}%
+    \ifnum\macrolistsize{#1}>0
+        \macrolistelement{#1}{\macrolistsize{#1}}%
     \fi
 }
 % \fi
@@ -320,28 +322,28 @@
 %
 %\begin{document}
 %
-%\newlist{mylist}
-%\listadd{mylist}{Some text}
+%\macronewlist{mylist}
+%\macrolistadd{mylist}{Some text}
 %% List: Some text
 %
 %\newcommand\macro{This is a macro}
 %
-%\listadd{mylist}{\macro}
+%\macrolistadd{mylist}{\macro}
 %% List: Some text, \macro
 %
-%\listelement{mylist}{1}
+%\macrolistelement{mylist}{1}
 %% Prints out "Some text"
 %
-%\listadd{mylist}[1]{Element inserted into beginning}
+%\macrolistadd{mylist}[1]{Element inserted into beginning}
 %% List: Element inserted into beginning, Some text, \macro
 %
-%\listremove{mylist}{1}
+%\macrolistremove{mylist}{1}
 %% List: Some text, \macro
 %
-%\listforeach{mylist}{\element}{We're printing out \textbf{\element}. }
+%\macrolistforeach{mylist}{\element}{We're printing out \textbf{\element}. }
 %% We're printing out \textbf{Some text}. We're printing out \textbf{\macro}.
 %
-%\listjoin{mylist}{, }
+%\macrolistjoin{mylist}{, }
 %% Some text, \macro
 %
 %\end{document}
@@ -349,7 +351,7 @@
 %
 % \section{Limitations}
 %
-% The |\listindexof| macro cannot be parsed as a number. This is because we have to compare each element of the list to the passed in element and requires storing the index in a macro, which requires some unexpandable macros. (This is why we do not directly use |\listindexof| when defining |\listcontains|.)
+% The |\macrolistindexof| macro cannot be parsed as a number. This is because we have to compare each element of the list to the passed in element and requires storing the index in a macro, which requires some unexpandable macros. (This is why we do not directly use |\macrolistindexof| when defining |\macrolistcontains|.)
 %
 % \section{Implementation details}
 %
@@ -382,7 +384,7 @@
         }{Pass in a number to the second argument of your command.}
     \fi
     %
-    \ifnum\numexpr#2 \relax>\listsize{#1}
+    \ifnum\numexpr#2 \relax>\macrolistsize{#1}
         \PackageError{macrolist}
         {Index out of bounds}
         {The number you have passed in to the second argument of your command\MessageBreak

Modified: trunk/Master/texmf-dist/tex/latex/macrolist/macrolist.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/macrolist/macrolist.sty	2021-07-30 20:13:55 UTC (rev 60116)
+++ trunk/Master/texmf-dist/tex/latex/macrolist/macrolist.sty	2021-07-30 20:14:14 UTC (rev 60117)
@@ -15,11 +15,11 @@
 %% version 2005/12/01 or later.
 
 \NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{macrolist}[2021/07/25 v1.2.1 Create lists of macros and perform operations on them]
+\ProvidesPackage{macrolist}[2021/07/29 v2.0.0 Create lists of macros and perform operations on them]
 
 \RequirePackage{pgffor}
 
-\newcommand{\newlist}[1]{
+\newcommand{\macronewlist}[1]{
     \ifcsname c at macrolist@list@#1\endcsname
         \PackageError{macrolist}{The list '#1' is already defined}{}
     \else
@@ -27,17 +27,17 @@
         \setcounter{macrolist at list@#1}{0}
     \fi
 }
-\newcommand{\listexists}[3]{\ifcsname c at macrolist@list@#1\endcsname#2\else#3\fi}
-\newcommand{\listelement}[2]{%
+\newcommand{\macrolistexists}[3]{\ifcsname c at macrolist@list@#1\endcsname#2\else#3\fi}
+\newcommand{\macrolistelement}[2]{%
     \macrolist at inbounds{#1}{#2}%
     \csname macrolist at list@#1\the\numexpr #2\relax\endcsname%
 }
-\newcommand{\listindexof}[2]{%
+\newcommand{\macrolistindexof}[2]{%
     \def\macrolist at listindex{0}%
     \macrolist at exists{#1}%
-    \ifnum\listsize{#1}>0\relax
+    \ifnum\macrolistsize{#1}>0\relax
         \def\macrolist at el{#2}%
-        \listforeach{#1}{\macrolist at listindexel}[\listsize{#1}][1]{%
+        \macrolistforeach{#1}{\macrolist at listindexel}[\macrolistsize{#1}][1]{%
             \ifx\macrolist at el\macrolist at listindexel
                 \xdef\macrolist at listindex{\macrolist at index}%
             \fi
@@ -46,12 +46,12 @@
     \macrolist at listindex%
     \let\macrolist at listindex\relax%
 }
-\newcommand{\listcontains}[4]{%
+\newcommand{\macrolistcontains}[4]{%
     \def\macrolist at listindex{0}%
     \macrolist at exists{#1}%
-    \ifnum\listsize{#1}>0\relax
+    \ifnum\macrolistsize{#1}>0\relax
         \def\macrolist at el{#2}%
-        \listforeach{#1}{\macrolist at listindexel}[\listsize{#1}][1]{%
+        \macrolistforeach{#1}{\macrolist at listindexel}[\macrolistsize{#1}][1]{%
             \ifx\macrolist at el\macrolist at listindexel
                 \xdef\macrolist at listindex{\macrolist at index}%
             \fi
@@ -63,23 +63,23 @@
         #4%
     \fi
 }
-\newcommand{\listadd}[1]{
+\newcommand{\macrolistadd}[1]{
     \macrolist at exists{#1}
     \def\macrolist at currlist{#1}
     \macrolist at listadd
 }
-%% We write \listadd this way such that the optional argument will be positioned correctly
+%% We write \macrolistadd this way such that the optional argument will be positioned correctly
 \newcommand{\macrolist at listadd}[2][]{
     \stepcounter{macrolist at list@\macrolist at currlist}
 
     \if\relax\detokenize{#1}\relax
-        \expandafter\gdef\csname macrolist at list@\macrolist at currlist\listsize{\macrolist at currlist}\endcsname{#2}
+        \expandafter\gdef\csname macrolist at list@\macrolist at currlist\macrolistsize{\macrolist at currlist}\endcsname{#2}
     \else
         \expandafter\ifnum\csname themacrolist at list@\macrolist at currlist\endcsname=#1
-            \expandafter\gdef\csname macrolist at list@\macrolist at currlist\listsize{\macrolist at currlist}\endcsname{#2}
+            \expandafter\gdef\csname macrolist at list@\macrolist at currlist\macrolistsize{\macrolist at currlist}\endcsname{#2}
         \else
             \macrolist at inbounds{\macrolist at currlist}{#1}
-            \foreach \macrolist at index in {\listsize{\macrolist at currlist}, ...,\the\numexpr #1+1\relax} {
+            \foreach \macrolist at index in {\macrolistsize{\macrolist at currlist}, ...,\the\numexpr #1+1\relax} {
                 \global\expandafter\let\csname macrolist at list@\macrolist at currlist\macrolist at index\expandafter\endcsname\csname macrolist at list@\macrolist at currlist\the\numexpr\macrolist at index-1\relax\endcsname
             }
             \expandafter\gdef\csname macrolist at list@\macrolist at currlist#1\endcsname{#2}
@@ -86,43 +86,43 @@
         \fi
     \fi
 }
-\newcommand{\listremove}[2]{
+\newcommand{\macrolistremove}[2]{
     \macrolist at inbounds{#1}{#2}
 
-    \ifnum\numexpr#2\relax=\listsize{#1}
+    \ifnum\numexpr#2\relax=\macrolistsize{#1}
     \else
-        \foreach \macrolist at index in {#2, ..., \the\numexpr\listsize{#1}-1\relax} {
+        \foreach \macrolist at index in {#2, ..., \the\numexpr\macrolistsize{#1}-1\relax} {
             \global\expandafter\let\csname macrolist at list@#1\macrolist at index\expandafter\endcsname\csname macrolist at list@#1\the\numexpr\macrolist at index+1\endcsname
         }
     \fi
 
-    \global\expandafter\let\csname macrolist at list@#1\listsize{#1}\endcsname\relax
+    \global\expandafter\let\csname macrolist at list@#1\macrolistsize{#1}\endcsname\relax
     \addtocounter{macrolist at list@#1}{-1}
 }
-\newcommand{\listremovelast}[1]{
+\newcommand{\macrolistremovelast}[1]{
     \macrolist at exists{#1}
-    \global\expandafter\let\csname macrolist at list@#1\listsize{#1}\endcsname\relax
+    \global\expandafter\let\csname macrolist at list@#1\macrolistsize{#1}\endcsname\relax
     \addtocounter{macrolist at list@#1}{-1}
 }
-\newcommand{\listclear}[2]{
+\newcommand{\macrolistclear}[2]{
     \macrolist at inbounds{#1}{#2}
 
-    \foreach \macrolist at index in {1, ..., \listsize{#1}} {
+    \foreach \macrolist at index in {1, ..., \macrolistsize{#1}} {
         \global\expandafter\let\csname \macrolist at list@#1\macrolist at index\endcsname\relax
     }
 
     \setcounter{macrolist at list@#1}{0}
 }
-\newcommand*{\listsize}[1]{%
+\newcommand*{\macrolistsize}[1]{%
     \macrolist at exists{#1}%
     \csname themacrolist at list@#1\endcsname
 }
-\newcommand{\listforeach}[2]
+\newcommand{\macrolistforeach}[2]
 {%
     \def\macrolist at foreachstart{0}% Reset
     % This is used to make optional arguments line up correctly
     \def\macrolist at start{1}%
-    \def\macrolist at end{\listsize{#1}}%
+    \def\macrolist at end{\macrolistsize{#1}}%
     \def\macrolist at listname{#1}%
     \def\macrolist at element{#2}%
     \macrolist at listforeachi
@@ -150,10 +150,10 @@
 
 \newcommand{\macrolist at listforeachaction}[1]{%
     \macrolist at exists{\macrolist at listname}%
-    \ifnum\numexpr\macrolist at start\relax>\listsize{\macrolist at listname}%
+    \ifnum\numexpr\macrolist at start\relax>\macrolistsize{\macrolist at listname}%
         \PackageError{macrolist}{The starting index of the loop is out of the bounds of list '\macrolist at listname'}{}
     \fi
-    \ifnum\numexpr\macrolist at end\relax>\listsize{\macrolist at listname}
+    \ifnum\numexpr\macrolist at end\relax>\macrolistsize{\macrolist at listname}
         \PackageError{macrolist}{The ending index of the loop is out of the bounds of list '\macrolist at listname'}{}
     \fi
     \foreach \macrolist at index in {\the\numexpr\macrolist at start\relax, ..., \the\numexpr\macrolist at end\relax} {%
@@ -161,12 +161,12 @@
         #1%
     }%
 }
-\newcommand{\listjoin}[2]{%
-    \ifnum\listsize{#1}>1
-        \listforeach{#1}{\macrolist at joinelement}[1][\listsize{#1}-1]{\macrolist at joinelement#2}%
+\newcommand{\macrolistjoin}[2]{%
+    \ifnum\macrolistsize{#1}>1
+        \macrolistforeach{#1}{\macrolist at joinelement}[1][\macrolistsize{#1}-1]{\macrolist at joinelement#2}%
     \fi
-    \ifnum\listsize{#1}>0
-        \listelement{#1}{\listsize{#1}}%
+    \ifnum\macrolistsize{#1}>0
+        \macrolistelement{#1}{\macrolistsize{#1}}%
     \fi
 }
 %% List: Some text
@@ -193,7 +193,7 @@
         }{Pass in a number to the second argument of your command.}
     \fi
     %
-    \ifnum\numexpr#2 \relax>\listsize{#1}
+    \ifnum\numexpr#2 \relax>\macrolistsize{#1}
         \PackageError{macrolist}
         {Index out of bounds}
         {The number you have passed in to the second argument of your command\MessageBreak



More information about the tex-live-commits mailing list.