summaryrefslogtreecommitdiff
path: root/tex/context/base/syst-ext.tex
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2003-08-21 00:00:00 +0200
committerHans Hagen <pragma@wxs.nl>2003-08-21 00:00:00 +0200
commit309b7e1b8d2422eb36e584f3c57591d960bcc402 (patch)
tree08691435b84e3978f244616c400915719b4c256a /tex/context/base/syst-ext.tex
parent3f9c44091f54eb858cfbb71b6346445e606b8687 (diff)
downloadcontext-309b7e1b8d2422eb36e584f3c57591d960bcc402.tar.gz
stable 2003.08.21
Diffstat (limited to 'tex/context/base/syst-ext.tex')
-rw-r--r--tex/context/base/syst-ext.tex63
1 files changed, 40 insertions, 23 deletions
diff --git a/tex/context/base/syst-ext.tex b/tex/context/base/syst-ext.tex
index d5c3d53b3..8970025e5 100644
--- a/tex/context/base/syst-ext.tex
+++ b/tex/context/base/syst-ext.tex
@@ -4332,34 +4332,51 @@
%D \filterfromvalue{xx}{3}{2}
%D \filterfromvalue{xx}{3}{1}
%D \stoptypen
+%D
+%D An alternative is to store 'max' in the list, say:
+%D
+%D \starttypen
+%D \setvalue{xx}{3{A}{B}{C}}
+%D
+%D \filterfromvalues{xx}{3}
+%D \filterfromvalues{xx}{2}
+%D \filterfromvalues{xx}{1}
+%D \stoptypen
+%D
+%D I'll implement this when I'm in \quotation {writing dirty
+%D macros mood}.
\def\filterfromvalue#1#2#3% value max n
- {\@EA\@EAEAEA\csname
- \ifcase#2\or
- \ifcase#3\or
- \strippedcsname\firstofoneargument
- \else
- \strippedcsname\gobbleoneargument
- \fi
- \or
- \ifcase#3\or
- \strippedcsname\firstoftwoarguments
- \or
- \strippedcsname\secondoftwoarguments
- \else
- \strippedcsname\gobbletwoarguments
- \fi
- \or
- \ifcase#3\or
- \strippedcsname\firstofthreearguments
+ {\@EA\@EAEAEA\csname % we use the fact that an
+ \@EA\ifx\csname#1\endcsname\relax % undefined cs has become \relax
+ \strippedcsname\gobbleoneargument % which we then gobble here
+ \else
+ \ifcase#2\or
+ \ifcase#3\or
+ \strippedcsname\firstofoneargument
+ \else
+ \strippedcsname\gobbleoneargument
+ \fi
\or
- \strippedcsname\secondofthreearguments
+ \ifcase#3\or
+ \strippedcsname\firstoftwoarguments
+ \or
+ \strippedcsname\secondoftwoarguments
+ \else
+ \strippedcsname\gobbletwoarguments
+ \fi
\or
- \strippedcsname\thirdofthreearguments
- \else
- \strippedcsname\gobblethreearguments
+ \ifcase#3\or
+ \strippedcsname\firstofthreearguments
+ \or
+ \strippedcsname\secondofthreearguments
+ \or
+ \strippedcsname\thirdofthreearguments
+ \else
+ \strippedcsname\gobblethreearguments
+ \fi
\fi
\fi
- \endcsname\csname#1\endcsname}
+ \endcsname\csname#1\endcsname}
\protect \endinput