diff options
author | Hans Hagen <pragma@wxs.nl> | 2001-08-28 00:00:00 +0200 |
---|---|---|
committer | Hans Hagen <pragma@wxs.nl> | 2001-08-28 00:00:00 +0200 |
commit | 398264e8338d79fc389c76f0a1f0b30e4442f4e3 (patch) | |
tree | 01f154356243a9c3330689cd5b25a6d48e15ec6e /tex/context/base/syst-ext.tex | |
parent | 60cc55d63b06031c0c852888fddeaff74a209011 (diff) | |
download | context-398264e8338d79fc389c76f0a1f0b30e4442f4e3.tar.gz |
stable 2001.08.28
Diffstat (limited to 'tex/context/base/syst-ext.tex')
-rw-r--r-- | tex/context/base/syst-ext.tex | 40 |
1 files changed, 31 insertions, 9 deletions
diff --git a/tex/context/base/syst-ext.tex b/tex/context/base/syst-ext.tex index 9b64e25ae..afda909c2 100644 --- a/tex/context/base/syst-ext.tex +++ b/tex/context/base/syst-ext.tex @@ -1862,7 +1862,8 @@ \next} %D \macros -%D {appendtocommalist,addtocommalist,removefromcommalist} +%D {appendtocommalist,prependtocommalist, +%D addtocommalist,removefromcommalist} %D %D When working with comma separated lists, one sooner or %D later want the tools to append or remove items from such a @@ -1894,7 +1895,8 @@ %D also provided: %D %D \starttypen -%D \appendtocommalist {something} \name +%D \appendtocommalist {something} \name +%D \prependtocommalist {something} \name %D \stoptypen \def\appendtocommalist#1#2% @@ -1904,14 +1906,34 @@ \dodoglobal\edef#2{#2,#1}% \fi} +\def\prependtocommalist#1#2% + {\ifx#2\empty + \dodoglobal\edef#2{#1}% + \else % no test on empty + \dodoglobal\edef#2{#1,#2}% + \fi} + \def\addtocommalist#1#2% - {\doifelse{#2}{} - {\dodoglobal\edef#2{#1}} - {\edef\!!stringa{#2,,}% - \beforesplitstring#2\at,,\to#2\relax - \ExpandBothAfter\doifinsetelse{#1}{#2} - {\resetglobal} - {\dodoglobal\edef#2{#2,#1}}}} + {\ifx#2\empty + \dodoglobal\edef#2{#1}% + \else + \edef\!!stringa{#2,,}% + \beforesplitstring#2\at,,\to#2\relax + \ExpandBothAfter\doifinsetelse{#1}{#2} + {\resetglobal} + {\dodoglobal\edef#2{#2,#1}}% + \fi} + +\def\pretocommalist#1#2% + {\ifx#2\empty + \dodoglobal\edef#2{#1}% + \else + \edef\!!stringa{#2,,}% + \beforesplitstring#2\at,,\to#2\relax + \ExpandBothAfter\doifinsetelse{#1}{#2} + {\resetglobal} + {\dodoglobal\edef#2{#1,#2}}% + \fi} \def\doremovefromcommalist#1#2#3% nog \doglobal {\edef\!!stringa{,,#3,,}% |