summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/generic/xint/xintexpr.sty
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2018-03-01 23:29:17 +0000
committerKarl Berry <karl@freefriends.org>2018-03-01 23:29:17 +0000
commit493a842303af8f78cfdf49c540923b69782df718 (patch)
tree088a42c3823e194afb55622efa69f3517f74ef08 /Master/texmf-dist/tex/generic/xint/xintexpr.sty
parenta5fb18d1900916f93730e03f6a4d5274b57b53f5 (diff)
xint (1mar18)
git-svn-id: svn://tug.org/texlive/trunk@46774 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/generic/xint/xintexpr.sty')
-rw-r--r--Master/texmf-dist/tex/generic/xint/xintexpr.sty1033
1 files changed, 613 insertions, 420 deletions
diff --git a/Master/texmf-dist/tex/generic/xint/xintexpr.sty b/Master/texmf-dist/tex/generic/xint/xintexpr.sty
index 7916b026cc8..979511d5410 100644
--- a/Master/texmf-dist/tex/generic/xint/xintexpr.sty
+++ b/Master/texmf-dist/tex/generic/xint/xintexpr.sty
@@ -21,7 +21,7 @@
%% same distribution. (The sources need not necessarily be
%% in the same archive or directory.)
%% ---------------------------------------------------------------
-%% The xint bundle 1.2q 2018/02/06
+%% The xint bundle 1.3 2018/03/01
%% Copyright (C) 2013-2018 by Jean-Francois Burnol
%% xintexpr: Expandable expression parser
%% ---------------------------------------------------------------
@@ -81,7 +81,7 @@
\XINTsetupcatcodes%
\XINT_providespackage
\ProvidesPackage{xintexpr}%
- [2018/02/06 1.2q Expandable expression parser (JFB)]%
+ [2018/03/01 1.3 Expandable expression parser (JFB)]%
\catcode`! 11
\let\XINT_Cmp \xintiiCmp
\def\xint_gob_til_! #1!{}% ! with catcode 11
@@ -202,6 +202,9 @@
\def\xintifboolexpr #1{\romannumeral0\xintifnotzero {\xinttheexpr #1\relax}}%
\def\xintifboolfloatexpr #1{\romannumeral0\xintifnotzero {\xintthefloatexpr #1\relax}}%
\def\xintifbooliiexpr #1{\romannumeral0\xintifnotzero {\xinttheiiexpr #1\relax}}%
+\let\XINT:NEhook:two\empty
+\let\XINT:NEhook:one\empty
+\let\XINT:NEhook:csv\empty
\def\XINT_::_end #1,#2{\xint_gobble_i #2}%
\def\xintCSV::csv #1{\expandafter\XINT_csv::_a\romannumeral`&&@#1,^,}%
\def\XINT_csv::_a {\XINT_csv::_b {}}%
@@ -674,7 +677,7 @@
\expandafter\let\csname XINT_#1_op_a\endcsname \XINT_expr_getop
\expandafter\def\csname XINT_#1_op_++)\endcsname ##1##2\relax
{\expandafter\XINT_expr_foundend \expandafter
- {\expandafter\.=+\csname .=\xintiCeil{\XINT_expr_unlock ##1}\endcsname }}%
+ {\expandafter\.=+\csname .=\XINT:NEhook:one\xintiCeil{\XINT_expr_unlock ##1}\endcsname }}%
}%
\catcode`. 12 \catcode`= 12 \catcode`+ 12
\catcode`& 12
@@ -684,7 +687,7 @@
\do {\expandafter\def\csname XINT_expr_itself_#1\endcsname {#1}}%
\catcode`& 7
\expandafter\let\csname XINT_expr_precedence_***\endcsname \xint_c_viii
-\def\XINT_expr_defbin_c #1#2#3#4#5#6#7#8%
+\def\XINT_expr_defbin_c #1#2#3#4#5#6#7#8#9%
{%
\def #1##1% \XINT_expr_op_<op> ou flexpr ou iiexpr
{% keep value, get next number and operator, then do until
@@ -700,7 +703,7 @@
\xint_afterfi {\expandafter #2\expandafter ##1\romannumeral`&&@%
\csname XINT_#8_op_##3\endcsname {##4}}%
\else \xint_afterfi {\expandafter ##2\expandafter ##3%
- \csname .=#6{\XINT_expr_unlock ##1}{\XINT_expr_unlock ##4}\endcsname }%
+ \csname .=#9#6{\XINT_expr_unlock ##1}{\XINT_expr_unlock ##4}\endcsname }%
\fi }%
\let #7#5%
}%
@@ -713,7 +716,7 @@
\csname XINT_#1_op_-#4\expandafter\endcsname
\csname xint_c_#3\expandafter\endcsname
\csname #5\expandafter\endcsname
- \csname XINT_expr_precedence_#2\endcsname {#1}%
+ \csname XINT_expr_precedence_#2\endcsname {#1}\XINT:NEhook:two
}%
\XINT_expr_defbin_b {expr} | {iii}{vi} {xintOR}%
\XINT_expr_defbin_b {flexpr} | {iii}{vi} {xintOR}%
@@ -742,9 +745,6 @@
\XINT_expr_defbin_b {expr} {!=} {v}{vi} {xintNotEq}%
\XINT_expr_defbin_b {flexpr}{!=} {v}{vi} {xintNotEq}%
\XINT_expr_defbin_b {iiexpr}{!=} {v}{vi} {xintiiNotEq}%
-\XINT_expr_defbin_b {expr} {..} {iii}{vi} {xintSeq::csv}%
-\XINT_expr_defbin_b {flexpr}{..} {iii}{vi} {xintSeq::csv}%
-\XINT_expr_defbin_b {iiexpr}{..} {iii}{vi} {xintiiSeq::csv}%
\XINT_expr_defbin_b {expr} {//} {vii}{vii}{xintDivFloor}% CHANGED IN 1.2p!
\XINT_expr_defbin_b {flexpr}{//} {vii}{vii}{XINTinFloatDivFloor}% "
\XINT_expr_defbin_b {iiexpr}{//} {vii}{vii}{xintiiDivFloor}% "
@@ -769,9 +769,25 @@
\XINT_expr_defbin_b {expr} {..[}{iii}{vi} {xintSeqA::csv}%
\XINT_expr_defbin_b {flexpr}{..[}{iii}{vi} {XINTinFloatSeqA::csv}%
\XINT_expr_defbin_b {iiexpr}{..[}{iii}{vi} {xintiiSeqA::csv}%
+\def\XINT_expr_defbin_b #1#2#3#4#5%
+{%
+ \expandafter\XINT_expr_defbin_c
+ \csname XINT_#1_op_#2\expandafter\endcsname
+ \csname XINT_#1_until_#2_a\expandafter\endcsname
+ \csname XINT_#1_until_#2_b\expandafter\endcsname
+ \csname XINT_#1_op_-#4\expandafter\endcsname
+ \csname xint_c_#3\expandafter\endcsname
+ \csname #5\expandafter\endcsname
+ \csname XINT_expr_precedence_#2\endcsname {#1}{}%
+}%
+\XINT_expr_defbin_b {expr} {..} {iii}{vi} {xintSeq::csv}%
+\XINT_expr_defbin_b {flexpr}{..} {iii}{vi} {xintSeq::csv}%
+\XINT_expr_defbin_b {iiexpr}{..} {iii}{vi} {xintiiSeq::csv}%
\XINT_expr_defbin_b {expr} {]..}{iii}{vi} {xintSeqB::csv}%
\XINT_expr_defbin_b {flexpr}{]..}{iii}{vi} {XINTinFloatSeqB::csv}%
\XINT_expr_defbin_b {iiexpr}{]..}{iii}{vi} {xintiiSeqB::csv}%
+\def\XINT_expr_binop_inline#1%
+ {\XINT_expr_binop_inline_a{\expandafter\XINT:NEhook:two\expandafter#1}}%
\def\XINT_expr_binop_inline_a
{\expandafter\xint_gobble_i\romannumeral`&&@\XINT_expr_binop_inline_b }%
\def\XINT_expr_binop_inline_b #1#2,{\XINT_expr_binop_inline_c #2,{#1}}%
@@ -798,9 +814,8 @@
\xint_afterfi {\expandafter #2\expandafter ##1\romannumeral`&&@%
\csname XINT_#8_op_##3\endcsname {##4}}%
\else \xint_afterfi {\expandafter ##2\expandafter ##3%
- \csname .=\expandafter\XINT_expr_binop_inline_a\expandafter
- {\expandafter\expandafter\expandafter#6\expandafter
- \xint_exchangetwo_keepbraces\expandafter
+ \csname .=\expandafter\XINT_expr_binop_inline\expandafter
+ {\expandafter#6\expandafter\xint_exchangetwo_keepbraces\expandafter
{\expandafter\XINT_expr_unlock\expandafter ##4\expandafter}\expandafter}%
\romannumeral`&&@\XINT_expr_unlock ##1,^,\endcsname }%
\fi }%
@@ -842,7 +857,7 @@
\xint_afterfi {\expandafter #2\expandafter ##1\romannumeral`&&@%
\csname XINT_#7_op_##3\endcsname {##4}}%
\else \xint_afterfi {\expandafter ##2\expandafter ##3%
- \csname .=\expandafter\XINT_expr_binop_inline_a\expandafter
+ \csname .=\expandafter\XINT_expr_binop_inline\expandafter
{\expandafter#5\expandafter
{\expandafter\XINT_expr_unlock\expandafter ##1\expandafter}\expandafter}%
\romannumeral`&&@\XINT_expr_unlock ##4,^,\endcsname }%
@@ -970,7 +985,8 @@
\else
\xint_afterfi
{\expandafter ##2\expandafter ##3\csname
- .=:\xintNum{\XINT_expr_unlock ##1};\xintNum{\XINT_expr_unlock ##4}%
+ .=:\XINT:NEhook:one\xintNum{\XINT_expr_unlock ##1};%
+ \XINT:NEhook:one\xintNum{\XINT_expr_unlock ##4}%
\endcsname
}%
\fi
@@ -990,7 +1006,7 @@
\def\XINT_expr_op_:] #1%
{%
\expandafter\xint_c_i\expandafter )%
- \csname .=]\xintNum{\XINT_expr_unlock #1}\endcsname
+ \csname .=]\XINT:NEhook:one\xintNum{\XINT_expr_unlock #1}\endcsname
}%
\let\XINT_flexpr_op_:] \XINT_expr_op_:]
\let\XINT_iiexpr_op_:] \XINT_expr_op_:]
@@ -1335,7 +1351,8 @@
\csname XINT_#5_op_##2\endcsname {##3}}%
\else
\xint_afterfi {\expandafter ##1\expandafter ##2%
- \csname .=#6{\XINT_expr_unlock ##3}\endcsname }%
+ \csname .=%
+ \XINT:NEhook:one#6{\XINT_expr_unlock ##3}\endcsname }%
\fi
}%
}%
@@ -1362,11 +1379,11 @@
}%
\let\XINT_expr_precedence_! \xint_c_x
\def\XINT_expr_op_! #1{\expandafter\XINT_expr_getop
- \csname .=\xintFac{\XINT_expr_unlock #1}\endcsname }%
+ \csname .=\XINT:NEhook:one\xintFac{\XINT_expr_unlock #1}\endcsname }%
\def\XINT_flexpr_op_! #1{\expandafter\XINT_expr_getop
- \csname .=\XINTinFloatFac{\XINT_expr_unlock #1}\endcsname }%
+ \csname .=\XINT:NEhook:one\XINTinFloatFac{\XINT_expr_unlock #1}\endcsname }%
\def\XINT_iiexpr_op_! #1{\expandafter\XINT_expr_getop
- \csname .=\xintiiFac{\XINT_expr_unlock #1}\endcsname }%
+ \csname .=\XINT:NEhook:one\xintiiFac{\XINT_expr_unlock #1}\endcsname }%
\catcode`[ 11
\catcode`* 11
\let\XINT_expr_precedence_[ \xint_c_vii
@@ -1691,10 +1708,11 @@
\if ^#4\xint_dothis\XINT_expr_op:_end\fi
\xint_orthat{\expandafter\XINT_expr_op:_c}\csname.=#4#5\endcsname {#3}#1{#2}%
}%
-\def\XINT_expr_op:_c #1#2#3#4{\expandafter\XINT_expr_op:_d\romannumeral0#2#1#3{#4}{#2}}%
+\def\XINT_expr_op:_c #1#2#3#4%
+ {\expandafter\XINT_expr_op:_d\romannumeral0#2#1#3{#4}{#2}}%
\def\XINT_expr_op:_d #1!#2#3#4#5%
{\expandafter\XINT_expr_op:_b\expandafter #4\expandafter
- {\romannumeral`&&@#4{\XINT_expr_unlock#1}{#5}}}%
+ {\romannumeral`&&@\XINT:NEhook:two#4{\XINT_expr_unlock#1}{#5}}}%
\def\XINT_expr_op:_noop\csname.=,#1\endcsname #2#3#4{\XINT_expr_op:_b #3{#4}{#2}#1,}%
\def\XINT_expr_op:_end \csname.=^\endcsname #1#2#3{#3}%
\def\XINT_expr_onliteral_subs
@@ -2030,376 +2048,519 @@
\expandafter\XINTinFloatdigits\romannumeral`&&@#1,^,{0[0]}}%
\def\XINTinFloatPrd:csv #1{\expandafter\XINT_oncsv:_a\expandafter\XINTinfloatmul
\expandafter\XINTinFloatdigits\romannumeral`&&@#1,^,{1[0]}}%
-\def\XINT_expr_twoargs #1,#2,{{#1}{#2}}%
-\def\XINT_expr_totwoargs #1#2{#1,#2}%
-\def\XINT_expr_argandopt #1,#2,#3.#4#5%
+\def\XINT:expr:one:and:opt #1,#2,#3!#4#5%
{%
\if\relax#3\relax\expandafter\xint_firstoftwo\else
\expandafter\xint_secondoftwo\fi
- {#4}{#5[\xintNum {#2}]}{#1}%
+ {#4}{#5[\xintNum{#2}]}{#1}%
}%
-\def\XINT_expr_oneortwo #1#2#3,#4,#5.%
+\def\XINT:expr:one:or:two #1,#2,#3!#4#5%
{%
- \if\relax#5\relax\expandafter\xint_firstoftwo\else
+ \if\relax#3\relax\expandafter\xint_firstoftwo\else
\expandafter\xint_secondoftwo\fi
- {#1{0}}{#2{\xintNum {#4}}}{#3}%
+ {#4{0}}{#5{\xintNum{#2}}}{#1}%
}%
-\def\XINT_iiexpr_oneortwo #1#2,#3,#4.%
+\def\XINT:iiexpr:one:or:two #1,#2,#3!#4%
{%
- \if\relax#4\relax\expandafter\xint_firstoftwo\else
+ \if\relax#3\relax\expandafter\xint_firstoftwo\else
\expandafter\xint_secondoftwo\fi
- {#1{0}}{#1{#3}}{#2}%
+ {#4{0}}{#4{#2}}{#1}%
+}%
+\def\XINT:expr:totwo #1#2{#1,#2}%
+\def\XINT:expr:two:to:two #1,#2,!#3%
+{%
+ \expandafter\XINT:expr:totwo\romannumeral`&&@%
+ #3{#1}{#2}%
+}%
+\def\XINT:expr:two:to:one #1,#2,!#3%
+{%
+ #3{#1}{#2}%
}%
+\def\XINT:flexpr:two:to:one #1,#2,!#3%
+{%
+ #3{#1}{#2}%
+}%
+\let\XINT:flexpr:two:to:two\XINT:flexpr:two:to:one
\def\XINT_expr_func_num #1#2#3%
- {\expandafter #1\expandafter #2\csname.=\xintNum {\XINT_expr_unlock #3}\endcsname }%
+{%
+ \expandafter #1\expandafter #2\csname.=%
+ \XINT:NEhook:one\xintNum{\XINT_expr_unlock #3}\endcsname
+}%
\let\XINT_flexpr_func_num\XINT_expr_func_num
\let\XINT_iiexpr_func_num\XINT_expr_func_num
\def\XINT_expr_func_reduce #1#2#3%
- {\expandafter #1\expandafter #2\csname.=\xintIrr {\XINT_expr_unlock #3}[0]\endcsname }%
+{%
+ \expandafter #1\expandafter #2\csname.=%
+ \XINT:NEhook:one\xintIrr{\XINT_expr_unlock #3}[0]\endcsname
+}%
\let\XINT_flexpr_func_reduce\XINT_expr_func_reduce
+\def\XINT_expr_func_preduce #1#2#3%
+{%
+ \expandafter #1\expandafter #2\csname.=%
+ \XINT:NEhook:one\xintPIrr{\XINT_expr_unlock #3}\endcsname
+}%
+\let\XINT_flexpr_func_preduce\XINT_expr_func_preduce
\def\XINT_expr_func_abs #1#2#3%
- {\expandafter #1\expandafter #2\csname.=\xintAbs {\XINT_expr_unlock #3}\endcsname }%
+{%
+ \expandafter #1\expandafter #2\csname.=%
+ \XINT:NEhook:one\xintAbs{\XINT_expr_unlock #3}\endcsname
+}%
\let\XINT_flexpr_func_abs\XINT_expr_func_abs
\def\XINT_iiexpr_func_abs #1#2#3%
- {\expandafter #1\expandafter #2\csname.=\xintiiAbs {\XINT_expr_unlock #3}\endcsname }%
+{%
+ \expandafter #1\expandafter #2\csname.=%
+ \XINT:NEhook:one\xintiiAbs{\XINT_expr_unlock #3}\endcsname
+}%
\def\XINT_expr_func_sgn #1#2#3%
- {\expandafter #1\expandafter #2\csname.=\xintSgn {\XINT_expr_unlock #3}\endcsname }%
+{%
+ \expandafter #1\expandafter #2\csname.=%
+ \XINT:NEhook:one\xintSgn{\XINT_expr_unlock #3}\endcsname
+}%
\let\XINT_flexpr_func_sgn\XINT_expr_func_sgn
\def\XINT_iiexpr_func_sgn #1#2#3%
- {\expandafter #1\expandafter #2\csname.=\xintiiSgn {\XINT_expr_unlock #3}\endcsname }%
+{%
+ \expandafter #1\expandafter #2\csname.=%
+ \XINT:NEhook:one\xintiiSgn{\XINT_expr_unlock #3}\endcsname
+}%
\def\XINT_expr_func_frac #1#2#3%
- {\expandafter #1\expandafter #2\csname.=\xintTFrac {\XINT_expr_unlock #3}\endcsname }%
-\def\XINT_flexpr_func_frac #1#2#3{\expandafter #1\expandafter #2\csname
- .=\XINTinFloatFracdigits {\XINT_expr_unlock #3}\endcsname }%
+{%
+ \expandafter #1\expandafter #2\csname.=%
+ \XINT:NEhook:one\xintTFrac{\XINT_expr_unlock #3}\endcsname
+}%
+\def\XINT_flexpr_func_frac #1#2#3%
+{%
+ \expandafter #1\expandafter #2\csname.=%
+ \XINT:NEhook:one\XINTinFloatFracdigits{\XINT_expr_unlock #3}\endcsname
+}%
\def\XINT_expr_func_floor #1#2#3%
- {\expandafter #1\expandafter #2\csname .=\xintFloor {\XINT_expr_unlock #3}\endcsname }%
+{%
+ \expandafter #1\expandafter #2\csname.=%
+ \XINT:NEhook:one\xintFloor{\XINT_expr_unlock #3}\endcsname
+}%
\let\XINT_flexpr_func_floor\XINT_expr_func_floor
\def\XINT_iiexpr_func_floor #1#2#3%
{%
- \expandafter #1\expandafter #2\csname.=\xintiFloor {\XINT_expr_unlock #3}\endcsname }%
+ \expandafter #1\expandafter #2\csname.=%
+ \XINT:NEhook:one\xintiFloor{\XINT_expr_unlock #3}\endcsname
+}%
\def\XINT_expr_func_ceil #1#2#3%
- {\expandafter #1\expandafter #2\csname .=\xintCeil {\XINT_expr_unlock #3}\endcsname }%
+{%
+ \expandafter #1\expandafter #2\csname.=%
+ \XINT:NEhook:one\xintCeil{\XINT_expr_unlock #3}\endcsname
+}%
\let\XINT_flexpr_func_ceil\XINT_expr_func_ceil
\def\XINT_iiexpr_func_ceil #1#2#3%
{%
- \expandafter #1\expandafter #2\csname.=\xintiCeil {\XINT_expr_unlock #3}\endcsname }%
+ \expandafter #1\expandafter #2\csname.=%
+ \XINT:NEhook:one\xintiCeil{\XINT_expr_unlock #3}\endcsname
+}%
\def\XINT_expr_func_sqr #1#2#3%
- {\expandafter #1\expandafter #2\csname.=\xintSqr {\XINT_expr_unlock #3}\endcsname }%
+{%
+ \expandafter #1\expandafter #2\csname.=%
+ \XINT:NEhook:one\xintSqr{\XINT_expr_unlock #3}\endcsname
+}%
+\def\XINTinFloatSqr#1{\XINTinFloatMul{#1}{#1}}% revoir après
\def\XINT_flexpr_func_sqr #1#2#3%
{%
- \expandafter #1\expandafter #2\csname
- .=\XINTinFloatMul{\XINT_expr_unlock #3}{\XINT_expr_unlock #3}\endcsname
+ \expandafter #1\expandafter #2\csname.=%
+ \XINT:NEhook:one\XINTinFloatSqr{\XINT_expr_unlock #3}\endcsname
+}%
+\def\XINT_iiexpr_func_sqr #1#2#3%
+{%
+ \expandafter #1\expandafter #2\csname.=%
+ \XINT:NEhook:one\xintiiSqr{\XINT_expr_unlock #3}\endcsname
+}%
+\def\XINT_expr_func_? #1#2#3%
+{%
+ \expandafter #1\expandafter #2\csname.=%
+ \XINT:NEhook:one\xintiiIsNotZero{\XINT_expr_unlock #3}\endcsname
+}%
+\let\XINT_flexpr_func_? \XINT_expr_func_?
+\let\XINT_iiexpr_func_? \XINT_expr_func_?
+\def\XINT_expr_func_! #1#2#3%
+{%
+ \expandafter #1\expandafter #2\csname.=%
+ \XINT:NEhook:one\xintiiIsZero{\XINT_expr_unlock #3}\endcsname
}%
+\let\XINT_flexpr_func_! \XINT_expr_func_!
+\let\XINT_iiexpr_func_! \XINT_expr_func_!
+\def\XINT_expr_func_not #1#2#3%
+{%
+ \expandafter #1\expandafter #2\csname.=%
+ \XINT:NEhook:one\xintiiIsZero{\XINT_expr_unlock #3}\endcsname
+}%
+\let\XINT_flexpr_func_not \XINT_expr_func_not
+\let\XINT_iiexpr_func_not \XINT_expr_func_not
+\def\XINT_expr_func_odd #1#2#3%
+{%
+ \expandafter #1\expandafter #2\csname.=%
+ \XINT:NEhook:one\xintOdd{\XINT_expr_unlock #3}\endcsname
+}%
+\let\XINT_flexpr_func_odd\XINT_expr_func_odd
+\def\XINT_iiexpr_func_odd #1#2#3%
+{%
+ \expandafter #1\expandafter #2\csname.=%
+ \XINT:NEhook:one\xintiiOdd{\XINT_expr_unlock #3}\endcsname
+}%
+\def\XINT_expr_func_even #1#2#3%
+{%
+ \expandafter #1\expandafter #2\csname.=%
+ \XINT:NEhook:one\xintEven{\XINT_expr_unlock #3}\endcsname
+}%
+\let\XINT_flexpr_func_even\XINT_expr_func_even
+\def\XINT_iiexpr_func_even #1#2#3%
+{%
+ \expandafter #1\expandafter #2\csname.=%
+ \XINT:NEhook:one\xintiiEven{\XINT_expr_unlock #3}\endcsname
+}%
+\def\XINT_expr_func_nuple #1#2#3%
+ {\expandafter #1\expandafter #2\csname.=\XINT_expr_unlock #3\endcsname }%
+\let\XINT_flexpr_func_nuple\XINT_expr_func_nuple
+\let\XINT_iiexpr_func_nuple\XINT_expr_func_nuple
\def\XINT_expr_func_factorial #1#2#3%
{%
- \expandafter #1\expandafter #2\csname .=%
- \expandafter\XINT_expr_argandopt
- \romannumeral`&&@\XINT_expr_unlock#3,,.\xintFac\XINTinFloatFac
+ \expandafter #1\expandafter #2\csname.=%
+ \expandafter\XINT:expr:one:and:opt
+ \romannumeral`&&@\XINT_expr_unlock#3,,!\xintFac\XINTinFloatFac
\endcsname
}%
\def\XINT_flexpr_func_factorial #1#2#3%
{%
- \expandafter #1\expandafter #2\csname .=%
- \expandafter\XINT_expr_argandopt
- \romannumeral`&&@\XINT_expr_unlock#3,,.\XINTinFloatFacdigits\XINTinFloatFac
+ \expandafter #1\expandafter #2\csname.=%
+ \expandafter\XINT:expr:one:and:opt
+ \romannumeral`&&@\XINT_expr_unlock#3,,!\XINTinFloatFacdigits\XINTinFloatFac
\endcsname
}%
\def\XINT_iiexpr_func_factorial #1#2#3%
{%
- \expandafter #1\expandafter #2\csname.=\xintiiFac{\XINT_expr_unlock #3}\endcsname
+ \expandafter #1\expandafter #2\csname.=%
+ \XINT:NEhook:one\xintiiFac{\XINT_expr_unlock #3}\endcsname
}%
-\def\XINT_iiexpr_func_sqr #1#2#3%
- {\expandafter #1\expandafter #2\csname.=\xintiiSqr {\XINT_expr_unlock #3}\endcsname }%
\def\XINT_expr_func_sqrt #1#2#3%
{%
- \expandafter #1\expandafter #2\csname .=%
- \expandafter\XINT_expr_argandopt
- \romannumeral`&&@\XINT_expr_unlock#3,,.\XINTinFloatSqrtdigits\XINTinFloatSqrt
+ \expandafter #1\expandafter #2\csname.=%
+ \expandafter\XINT:expr:one:and:opt
+ \romannumeral`&&@\XINT_expr_unlock#3,,!\XINTinFloatSqrtdigits\XINTinFloatSqrt
\endcsname
}%
\let\XINT_flexpr_func_sqrt\XINT_expr_func_sqrt
\def\XINT_iiexpr_func_sqrt #1#2#3%
- {\expandafter #1\expandafter #2\csname.=\xintiiSqrt {\XINT_expr_unlock #3}\endcsname }%
+{%
+ \expandafter #1\expandafter #2\csname.=%
+ \XINT:NEhook:one\xintiiSqrt{\XINT_expr_unlock #3}\endcsname
+}%
\def\XINT_iiexpr_func_sqrtr #1#2#3%
- {\expandafter #1\expandafter #2\csname.=\xintiiSqrtR {\XINT_expr_unlock #3}\endcsname }%
+{%
+ \expandafter #1\expandafter #2\csname.=%
+ \XINT:NEhook:one\xintiiSqrtR{\XINT_expr_unlock #3}\endcsname
+}%
\def\XINT_expr_func_round #1#2#3%
{%
- \expandafter #1\expandafter #2\csname .=%
- \expandafter\XINT_expr_oneortwo
- \expandafter\xintiRound\expandafter\xintRound
- \romannumeral`&&@\XINT_expr_unlock #3,,.\endcsname
+ \expandafter #1\expandafter #2\csname.=%
+ \expandafter\XINT:expr:one:or:two
+ \romannumeral`&&@\XINT_expr_unlock #3,,!\xintiRound\xintRound
+ \endcsname
}%
\let\XINT_flexpr_func_round\XINT_expr_func_round
\def\XINT_iiexpr_func_round #1#2#3%
{%
- \expandafter #1\expandafter #2\csname .=%
- \expandafter\XINT_iiexpr_oneortwo\expandafter\xintiRound
- \romannumeral`&&@\XINT_expr_unlock #3,,.\endcsname
+ \expandafter #1\expandafter #2\csname.=%
+ \expandafter\XINT:iiexpr:one:or:two
+ \romannumeral`&&@\XINT_expr_unlock #3,,!\xintiRound
+ \endcsname
}%
\def\XINT_expr_func_trunc #1#2#3%
{%
- \expandafter #1\expandafter #2\csname .=%
- \expandafter\XINT_expr_oneortwo
- \expandafter\xintiTrunc\expandafter\xintTrunc
- \romannumeral`&&@\XINT_expr_unlock #3,,.\endcsname
+ \expandafter #1\expandafter #2\csname.=%
+ \expandafter\XINT:expr:one:or:two
+ \romannumeral`&&@\XINT_expr_unlock #3,,!\xintiTrunc\xintTrunc
+ \endcsname
}%
\let\XINT_flexpr_func_trunc\XINT_expr_func_trunc
\def\XINT_iiexpr_func_trunc #1#2#3%
{%
- \expandafter #1\expandafter #2\csname .=%
- \expandafter\XINT_iiexpr_oneortwo\expandafter\xintiTrunc
- \romannumeral`&&@\XINT_expr_unlock #3,,.\endcsname
+ \expandafter #1\expandafter #2\csname.=%
+ \expandafter\XINT:iiexpr:one:or:two
+ \romannumeral`&&@\XINT_expr_unlock #3,,!\xintiTrunc
+ \endcsname
}%
\def\XINT_expr_func_float #1#2#3%
{%
- \expandafter #1\expandafter #2\csname .=%
- \expandafter\XINT_expr_argandopt
- \romannumeral`&&@\XINT_expr_unlock #3,,.\XINTinFloatdigits\XINTinFloat
+ \expandafter #1\expandafter #2\csname.=%
+ \expandafter\XINT:expr:one:and:opt
+ \romannumeral`&&@\XINT_expr_unlock #3,,!\XINTinFloatdigits\XINTinFloat
\endcsname
}%
\let\XINT_flexpr_func_float\XINT_expr_func_float
\def\XINT_expr_func_divmod #1#2#3%
{%
- \expandafter #1\expandafter #2\csname .=%
- \expandafter\XINT_expr_totwoargs
- \romannumeral0\expandafter\xintdivmod
- \romannumeral`&&@\expandafter\XINT_expr_twoargs
- \romannumeral`&&@\XINT_expr_unlock #3,\endcsname
+ \expandafter #1\expandafter #2\csname.=%
+ \expandafter\XINT:expr:two:to:two
+ \romannumeral`&&@\XINT_expr_unlock #3,!\xintDivMod
+ \endcsname
}%
\def\XINT_flexpr_func_divmod #1#2#3%
{%
- \expandafter #1\expandafter #2\csname .=%
- \expandafter\XINTinFloatDivMod
- \romannumeral`&&@\expandafter\XINT_expr_twoargs
- \romannumeral`&&@\XINT_expr_unlock #3,\endcsname
+ \expandafter #1\expandafter #2\csname.=%
+ \expandafter\XINT:flexpr:two:to:two
+ \romannumeral`&&@\XINT_expr_unlock #3,!\XINTinFloatDivMod
+ \endcsname
}%
\def\XINT_iiexpr_func_divmod #1#2#3%
{%
- \expandafter #1\expandafter #2\csname .=%
- \expandafter\XINT_expr_totwoargs
- \romannumeral0\expandafter\xintiidivmod
- \romannumeral`&&@\expandafter\XINT_expr_twoargs
- \romannumeral`&&@\XINT_expr_unlock #3,\endcsname
+ \expandafter #1\expandafter #2\csname.=%
+ \expandafter\XINT:expr:two:to:two
+ \romannumeral`&&@\XINT_expr_unlock #3,!\xintiiDivMod
+ \endcsname
}%
\def\XINT_expr_func_mod #1#2#3%
{%
- \expandafter #1\expandafter #2\csname .=%
- \expandafter\expandafter\expandafter\xintMod
- \expandafter\XINT_expr_twoargs
- \romannumeral`&&@\XINT_expr_unlock #3,\endcsname
+ \expandafter #1\expandafter #2\csname.=%
+ \expandafter\XINT:expr:two:to:one
+ \romannumeral`&&@\XINT_expr_unlock #3,!\xintMod
+ \endcsname
}%
\def\XINT_flexpr_func_mod #1#2#3%
{%
- \expandafter #1\expandafter #2\csname .=%
- \expandafter\XINTinFloatMod
- \romannumeral`&&@\expandafter\XINT_expr_twoargs
- \romannumeral`&&@\XINT_expr_unlock #3,\endcsname
+ \expandafter #1\expandafter #2\csname.=%
+ \expandafter\XINT:flexpr:two:to:one
+ \romannumeral`&&@\XINT_expr_unlock #3,!\XINTinFloatMod
+ \endcsname
}%
\def\XINT_iiexpr_func_mod #1#2#3%
{%
- \expandafter #1\expandafter #2\csname .=%
- \expandafter\expandafter\expandafter\xintiiMod
- \expandafter\XINT_expr_twoargs
- \romannumeral`&&@\XINT_expr_unlock #3,\endcsname
+ \expandafter #1\expandafter #2\csname.=%
+ \expandafter\XINT:expr:two:to:one
+ \romannumeral`&&@\XINT_expr_unlock #3,!\xintiiMod
+ \endcsname
}%
\def\XINT_expr_func_binomial #1#2#3%
{%
- \expandafter #1\expandafter #2\csname .=%
- \expandafter\expandafter\expandafter\xintBinomial
- \expandafter\XINT_expr_twoargs
- \romannumeral`&&@\XINT_expr_unlock #3,\endcsname
+ \expandafter #1\expandafter #2\csname.=%
+ \expandafter\XINT:expr:two:to:one
+ \romannumeral`&&@\XINT_expr_unlock #3,!\xintBinomial
+ \endcsname
}%
\def\XINT_flexpr_func_binomial #1#2#3%
{%
- \expandafter #1\expandafter #2\csname .=%
- \expandafter\expandafter\expandafter\XINTinFloatBinomial
- \expandafter\XINT_expr_twoargs
- \romannumeral`&&@\XINT_expr_unlock #3,\endcsname
+ \expandafter #1\expandafter #2\csname.=%
+ \expandafter\XINT:flexpr:two:to:one
+ \romannumeral`&&@\XINT_expr_unlock #3,!\XINTinFloatBinomial
+ \endcsname
}%
\def\XINT_iiexpr_func_binomial #1#2#3%
{%
- \expandafter #1\expandafter #2\csname .=%
- \expandafter\expandafter\expandafter\xintiiBinomial
- \expandafter\XINT_expr_twoargs
- \romannumeral`&&@\XINT_expr_unlock #3,\endcsname
+ \expandafter #1\expandafter #2\csname.=%
+ \expandafter\XINT:expr:two:to:one
+ \romannumeral`&&@\XINT_expr_unlock #3,!\xintiiBinomial
+ \endcsname
}%
\def\XINT_expr_func_pfactorial #1#2#3%
{%
- \expandafter #1\expandafter #2\csname .=%
- \expandafter\expandafter\expandafter\xintPFactorial
- \expandafter\XINT_expr_twoargs
- \romannumeral`&&@\XINT_expr_unlock #3,\endcsname
+ \expandafter #1\expandafter #2\csname.=%
+ \expandafter\XINT:expr:two:to:one
+ \romannumeral`&&@\XINT_expr_unlock #3,!\xintPFactorial
+ \endcsname
}%
\def\XINT_flexpr_func_pfactorial #1#2#3%
{%
- \expandafter #1\expandafter #2\csname .=%
- \expandafter\expandafter\expandafter\XINTinFloatPFactorial
- \expandafter\XINT_expr_twoargs
- \romannumeral`&&@\XINT_expr_unlock #3,\endcsname
+ \expandafter #1\expandafter #2\csname.=%
+ \expandafter\XINT:flexpr:two:to:one
+ \romannumeral`&&@\XINT_expr_unlock #3,!\XINTinFloatPFactorial
+ \endcsname
}%
\def\XINT_iiexpr_func_pfactorial #1#2#3%
{%
- \expandafter #1\expandafter #2\csname .=%
- \expandafter\expandafter\expandafter\xintiiPFactorial
- \expandafter\XINT_expr_twoargs
- \romannumeral`&&@\XINT_expr_unlock #3,\endcsname
+ \expandafter #1\expandafter #2\csname.=%
+ \expandafter\XINT:expr:two:to:one
+ \romannumeral`&&@\XINT_expr_unlock #3,!\xintiiPFactorial
+ \endcsname
}%
\def\XINT_expr_func_quo #1#2#3%
{%
- \expandafter #1\expandafter #2\csname .=%
- \expandafter\expandafter\expandafter\xintiQuo
- \expandafter\XINT_expr_twoargs
- \romannumeral`&&@\XINT_expr_unlock #3,\endcsname
+ \expandafter #1\expandafter #2\csname.=%
+ \expandafter\XINT:expr:two:to:one
+ \romannumeral`&&@\XINT_expr_unlock #3,!\xintiQuo
+ \endcsname
}%
\let\XINT_flexpr_func_quo\XINT_expr_func_quo
\def\XINT_iiexpr_func_quo #1#2#3%
{%
- \expandafter #1\expandafter #2\csname .=%
- \expandafter\expandafter\expandafter\xintiiQuo
- \expandafter\XINT_expr_twoargs
- \romannumeral`&&@\XINT_expr_unlock #3,\endcsname
+ \expandafter #1\expandafter #2\csname.=%
+ \expandafter\XINT:expr:two:to:one
+ \romannumeral`&&@\XINT_expr_unlock #3,!\xintiiQuo
+ \endcsname
}%
\def\XINT_expr_func_rem #1#2#3%
{%
- \expandafter #1\expandafter #2\csname .=%
- \expandafter\expandafter\expandafter\xintiRem
- \expandafter\XINT_expr_twoargs
- \romannumeral`&&@\XINT_expr_unlock #3,\endcsname
+ \expandafter #1\expandafter #2\csname.=%
+ \expandafter\XINT:expr:two:to:one
+ \romannumeral`&&@\XINT_expr_unlock #3,!\xintiRem
+ \endcsname
}%
\let\XINT_flexpr_func_rem\XINT_expr_func_rem
\def\XINT_iiexpr_func_rem #1#2#3%
{%
- \expandafter #1\expandafter #2\csname .=%
- \expandafter\expandafter\expandafter\xintiiRem
- \expandafter\XINT_expr_twoargs
- \romannumeral`&&@\XINT_expr_unlock #3,\endcsname
+ \expandafter #1\expandafter #2\csname.=%
+ \expandafter\XINT:expr:two:to:one
+ \romannumeral`&&@\XINT_expr_unlock #3,!\xintiiRem
+ \endcsname
}%
\def\XINT_expr_func_gcd #1#2#3%
- {\expandafter #1\expandafter #2\csname
- .=\xintGCDof:csv{\XINT_expr_unlock #3}\endcsname }%
+{%
+ \expandafter #1\expandafter #2\csname.=%
+ \XINT:NEhook:csv\xintGCDof:csv{\XINT_expr_unlock #3}\endcsname
+}%
\let\XINT_flexpr_func_gcd\XINT_expr_func_gcd
\def\XINT_iiexpr_func_gcd #1#2#3%
- {\expandafter #1\expandafter #2\csname
- .=\xintiiGCDof:csv{\XINT_expr_unlock #3}\endcsname }%
+{%
+ \expandafter #1\expandafter #2\csname.=%
+ \XINT:NEhook:csv\xintiiGCDof:csv{\XINT_expr_unlock #3}\endcsname
+}%
\def\XINT_expr_func_lcm #1#2#3%
- {\expandafter #1\expandafter #2\csname
- .=\xintLCMof:csv{\XINT_expr_unlock #3}\endcsname }%
+{%
+ \expandafter #1\expandafter #2\csname.=%
+ \XINT:NEhook:csv\xintLCMof:csv{\XINT_expr_unlock #3}\endcsname
+}%
\let\XINT_flexpr_func_lcm\XINT_expr_func_lcm
\def\XINT_iiexpr_func_lcm #1#2#3%
- {\expandafter #1\expandafter #2\csname
- .=\xintiiLCMof:csv{\XINT_expr_unlock #3}\endcsname }%
+{%
+ \expandafter #1\expandafter #2\csname.=%
+ \XINT:NEhook:csv\xintiiLCMof:csv{\XINT_expr_unlock #3}\endcsname
+}%
\def\XINT_expr_func_max #1#2#3%
- {\expandafter #1\expandafter #2\csname
- .=\xintMaxof:csv{\XINT_expr_unlock #3}\endcsname }%
+{%
+ \expandafter #1\expandafter #2\csname.=%
+ \XINT:NEhook:csv\xintMaxof:csv{\XINT_expr_unlock #3}\endcsname
+}%
\def\XINT_iiexpr_func_max #1#2#3%
- {\expandafter #1\expandafter #2\csname
- .=\xintiiMaxof:csv{\XINT_expr_unlock #3}\endcsname }%
+{%
+ \expandafter #1\expandafter #2\csname.=%
+ \XINT:NEhook:csv\xintiiMaxof:csv{\XINT_expr_unlock #3}\endcsname
+}%
\def\XINT_flexpr_func_max #1#2#3%
- {\expandafter #1\expandafter #2\csname
- .=\XINTinFloatMaxof:csv{\XINT_expr_unlock #3}\endcsname }%
+{%
+ \expandafter #1\expandafter #2\csname.=%
+ \XINT:NEhook:csv\XINTinFloatMaxof:csv{\XINT_expr_unlock #3}\endcsname
+}%
\def\XINT_expr_func_min #1#2#3%
- {\expandafter #1\expandafter #2\csname
- .=\xintMinof:csv{\XINT_expr_unlock #3}\endcsname }%
+{%
+ \expandafter #1\expandafter #2\csname.=%
+ \XINT:NEhook:csv\xintMinof:csv{\XINT_expr_unlock #3}\endcsname
+}%
\def\XINT_iiexpr_func_min #1#2#3%
- {\expandafter #1\expandafter #2\csname
- .=\xintiiMinof:csv{\XINT_expr_unlock #3}\endcsname }%
+{%
+ \expandafter #1\expandafter #2\csname.=%
+ \XINT:NEhook:csv\xintiiMinof:csv{\XINT_expr_unlock #3}\endcsname
+}%
\def\XINT_flexpr_func_min #1#2#3%
- {\expandafter #1\expandafter #2\csname
- .=\XINTinFloatMinof:csv{\XINT_expr_unlock #3}\endcsname }%
-\expandafter\def\csname XINT_expr_func_+\endcsname #1#2#3%
- {\expandafter #1\expandafter #2\csname
- .=\xintSum:csv{\XINT_expr_unlock #3}\endcsname }%
-\expandafter\def\csname XINT_flexpr_func_+\endcsname #1#2#3%
- {\expandafter #1\expandafter #2\csname
- .=\XINTinFloatSum:csv{\XINT_expr_unlock #3}\endcsname }%
-\expandafter\def\csname XINT_iiexpr_func_+\endcsname #1#2#3%
- {\expandafter #1\expandafter #2\csname
- .=\xintiiSum:csv{\XINT_expr_unlock #3}\endcsname }%
-\expandafter\def\csname XINT_expr_func_*\endcsname #1#2#3%
- {\expandafter #1\expandafter #2\csname
- .=\xintPrd:csv{\XINT_expr_unlock #3}\endcsname }%
-\expandafter\def\csname XINT_flexpr_func_*\endcsname #1#2#3%
- {\expandafter #1\expandafter #2\csname
- .=\XINTinFloatPrd:csv{\XINT_expr_unlock #3}\endcsname }%
-\expandafter\def\csname XINT_iiexpr_func_*\endcsname #1#2#3%
- {\expandafter #1\expandafter #2\csname
- .=\xintiiPrd:csv{\XINT_expr_unlock #3}\endcsname }%
-\def\XINT_expr_func_? #1#2#3%
- {\expandafter #1\expandafter #2\csname
- .=\xintiiIsNotZero {\XINT_expr_unlock #3}\endcsname }%
-\let\XINT_flexpr_func_? \XINT_expr_func_?
-\let\XINT_iiexpr_func_? \XINT_expr_func_?
-\def\XINT_expr_func_! #1#2#3%
- {\expandafter #1\expandafter #2\csname.=\xintiiIsZero {\XINT_expr_unlock #3}\endcsname }%
-\let\XINT_flexpr_func_! \XINT_expr_func_!
-\let\XINT_iiexpr_func_! \XINT_expr_func_!
-\def\XINT_expr_func_not #1#2#3%
- {\expandafter #1\expandafter #2\csname.=\xintiiIsZero {\XINT_expr_unlock #3}\endcsname }%
-\let\XINT_flexpr_func_not \XINT_expr_func_not
-\let\XINT_iiexpr_func_not \XINT_expr_func_not
+{%
+ \expandafter #1\expandafter #2\csname.=%
+ \XINT:NEhook:csv\XINTinFloatMinof:csv{\XINT_expr_unlock #3}\endcsname
+}%
+\expandafter
+\def\csname XINT_expr_func_+\endcsname #1#2#3%
+{%
+ \expandafter #1\expandafter #2\csname.=%
+ \XINT:NEhook:csv\xintSum:csv{\XINT_expr_unlock #3}\endcsname
+}%
+\expandafter
+\def\csname XINT_flexpr_func_+\endcsname #1#2#3%
+{%
+ \expandafter #1\expandafter #2\csname.=%
+ \XINT:NEhook:csv\XINTinFloatSum:csv{\XINT_expr_unlock #3}\endcsname
+}%
+\expandafter
+\def\csname XINT_iiexpr_func_+\endcsname #1#2#3%
+{%
+ \expandafter #1\expandafter #2\csname.=%
+ \XINT:NEhook:csv\xintiiSum:csv{\XINT_expr_unlock #3}\endcsname
+}%
+\expandafter
+\def\csname XINT_expr_func_*\endcsname #1#2#3%
+{%
+ \expandafter #1\expandafter #2\csname.=%
+ \XINT:NEhook:csv\xintPrd:csv{\XINT_expr_unlock #3}\endcsname
+}%
+\expandafter
+\def\csname XINT_flexpr_func_*\endcsname #1#2#3%
+{%
+ \expandafter #1\expandafter #2\csname.=%
+ \XINT:NEhook:csv\XINTinFloatPrd:csv{\XINT_expr_unlock #3}\endcsname
+}%
+\expandafter
+\def\csname XINT_iiexpr_func_*\endcsname #1#2#3%
+{%
+ \expandafter #1\expandafter #2\csname.=%
+ \XINT:NEhook:csv\xintiiPrd:csv{\XINT_expr_unlock #3}\endcsname
+}%
\def\XINT_expr_func_all #1#2#3%
- {\expandafter #1\expandafter #2\csname
- .=\xintANDof:csv{\XINT_expr_unlock #3}\endcsname }%
+{%
+ \expandafter #1\expandafter #2\csname.=%
+ \XINT:NEhook:csv\xintANDof:csv{\XINT_expr_unlock #3}\endcsname
+}%
\let\XINT_flexpr_func_all\XINT_expr_func_all
\let\XINT_iiexpr_func_all\XINT_expr_func_all
\def\XINT_expr_func_any #1#2#3%
- {\expandafter #1\expandafter #2\csname
- .=\xintORof:csv{\XINT_expr_unlock #3}\endcsname }%
+{%
+ \expandafter #1\expandafter #2\csname.=%
+ \XINT:NEhook:csv\xintORof:csv{\XINT_expr_unlock #3}\endcsname
+}%
\let\XINT_flexpr_func_any\XINT_expr_func_any
\let\XINT_iiexpr_func_any\XINT_expr_func_any
\def\XINT_expr_func_xor #1#2#3%
- {\expandafter #1\expandafter #2\csname
- .=\xintXORof:csv{\XINT_expr_unlock #3}\endcsname }%
+{%
+ \expandafter #1\expandafter #2\csname.=%
+ \XINT:NEhook:csv\xintXORof:csv{\XINT_expr_unlock #3}\endcsname
+}%
\let\XINT_flexpr_func_xor\XINT_expr_func_xor
\let\XINT_iiexpr_func_xor\XINT_expr_func_xor
-\def\xintifNotZero: #1,#2,#3,{\xintiiifNotZero{#1}{#2}{#3}}%
-\def\XINT_expr_func_if #1#2#3%
- {\expandafter #1\expandafter #2\csname
- .=\expandafter\xintifNotZero:\romannumeral`&&@\XINT_expr_unlock #3,\endcsname }%
-\let\XINT_flexpr_func_if\XINT_expr_func_if
-\let\XINT_iiexpr_func_if\XINT_expr_func_if
-\def\xintifSgn: #1,#2,#3,#4,{\xintiiifSgn{#1}{#2}{#3}{#4}}%
-\def\XINT_expr_func_ifsgn #1#2#3%
+\def\XINT_expr_func_len #1#2#3%
{%
- \expandafter #1\expandafter #2\csname
- .=\expandafter\xintifSgn:\romannumeral`&&@\XINT_expr_unlock #3,\endcsname
+ \expandafter#1\expandafter#2\csname.=%
+ \XINT:NEhook:csv\xintLength:f:csv{\XINT_expr_unlock#3}\endcsname
}%
-\let\XINT_flexpr_func_ifsgn\XINT_expr_func_ifsgn
-\let\XINT_iiexpr_func_ifsgn\XINT_expr_func_ifsgn
-\def\XINT_expr_func_len #1#2#3%
- {\expandafter#1\expandafter#2%
- \csname.=\xintLength:f:csv {\XINT_expr_unlock#3}\endcsname }%
\let\XINT_flexpr_func_len \XINT_expr_func_len
\let\XINT_iiexpr_func_len \XINT_expr_func_len
\def\XINT_expr_func_first #1#2#3%
- {\expandafter #1\expandafter #2\csname.=%
- \xintFirstItem:f:csv{\XINT_expr_unlock #3}\endcsname}%
+{%
+ \expandafter #1\expandafter #2\csname.=%
+ \XINT:NEhook:csv\xintFirstItem:f:csv{\XINT_expr_unlock #3}\endcsname
+}%
\let\XINT_flexpr_func_first\XINT_expr_func_first
\let\XINT_iiexpr_func_first\XINT_expr_func_first
\def\XINT_expr_func_last #1#2#3%
- {\expandafter #1\expandafter #2\csname.=%
- \xintLastItem:f:csv{\XINT_expr_unlock #3}\endcsname}%
+{%
+ \expandafter #1\expandafter #2\csname.=%
+ \XINT:NEhook:csv\xintLastItem:f:csv{\XINT_expr_unlock #3}\endcsname
+}%
\let\XINT_flexpr_func_last\XINT_expr_func_last
\let\XINT_iiexpr_func_last\XINT_expr_func_last
-\def\XINT_expr_func_odd #1#2#3%
- {\expandafter #1\expandafter #2\csname.=\xintOdd{\XINT_expr_unlock #3}\endcsname}%
-\let\XINT_flexpr_func_odd\XINT_expr_func_odd
-\def\XINT_iiexpr_func_odd #1#2#3%
- {\expandafter #1\expandafter #2\csname.=\xintiiOdd{\XINT_expr_unlock #3}\endcsname}%
-\def\XINT_expr_func_even #1#2#3%
- {\expandafter #1\expandafter #2\csname.=\xintEven{\XINT_expr_unlock #3}\endcsname}%
-\let\XINT_flexpr_func_even\XINT_expr_func_even
-\def\XINT_iiexpr_func_even #1#2#3%
- {\expandafter #1\expandafter #2\csname.=\xintiiEven{\XINT_expr_unlock #3}\endcsname}%
-\def\XINT_expr_func_nuple #1#2#3%
- {\expandafter #1\expandafter #2\csname .=\XINT_expr_unlock #3\endcsname }%
-\let\XINT_flexpr_func_nuple\XINT_expr_func_nuple
-\let\XINT_iiexpr_func_nuple\XINT_expr_func_nuple
\def\XINT_expr_func_reversed #1#2#3%
- {\expandafter #1\expandafter #2\csname .=%
- \xintReverse:f:csv {\XINT_expr_unlock #3}\endcsname }%
+{%
+ \expandafter #1\expandafter #2\csname.=%
+ \XINT:NEhook:csv\xintReverse:f:csv{\XINT_expr_unlock #3}\endcsname
+}%
\let\XINT_flexpr_func_reversed\XINT_expr_func_reversed
\let\XINT_iiexpr_func_reversed\XINT_expr_func_reversed
+\def\xintifNotZero: #1,#2,#3,{\xintiiifNotZero{#1}{#2}{#3}}%
+\def\XINT_expr_func_if #1#2#3%
+{%
+ \expandafter #1\expandafter #2\csname.=%
+ \expandafter\xintifNotZero:%
+ \romannumeral`&&@\XINT_expr_unlock #3,\endcsname
+}%
+\let\XINT_flexpr_func_if\XINT_expr_func_if
+\let\XINT_iiexpr_func_if\XINT_expr_func_if
+\def\xintifSgn: #1,#2,#3,#4,{\xintiiifSgn{#1}{#2}{#3}{#4}}%
+\def\XINT_expr_func_ifsgn #1#2#3%
+{%
+ \expandafter #1\expandafter #2\csname.=%
+ \expandafter\xintifSgn:%
+ \romannumeral`&&@\XINT_expr_unlock #3,\endcsname
+}%
+\let\XINT_flexpr_func_ifsgn\XINT_expr_func_ifsgn
+\let\XINT_iiexpr_func_ifsgn\XINT_expr_func_ifsgn
\def\xintSeqB:f:csv #1#2%
{\expandafter\XINT_seqb:f:csv \expandafter{\romannumeral0\xintraw{#2}}{#1}}%
\def\XINT_seqb:f:csv #1#2{\expandafter\XINT_seqb:f:csv_a\romannumeral`&&@#2#1!}%
@@ -2486,6 +2647,7 @@
\XINT_seqb:f:csv_nc\XINT_seqb:f:csv_nb\XINT_flseqb:f:csv_na {#1}{#2}%
}%
\catcode`: 12
+\catcode`~ 12
\def\XINT_tmpa #1#2#3#4%
{%
\def #1##1(##2)##3=##4;{%
@@ -2498,11 +2660,11 @@
\edef\XINT_expr_tmpc {subs(\unexpanded\expandafter{\XINT_expr_tmpc},%
####1=################\XINT_expr_tmpb)}%
}%
- \expandafter#3\csname XINT_#2_userfunc_\XINT_expr_tmpa\endcsname
- [\XINT_expr_tmpb]{\XINT_expr_tmpc}%
\expandafter\XINT_expr_defuserfunc
\csname XINT_#2_func_\XINT_expr_tmpa\expandafter\endcsname
- \csname XINT_#2_userfunc_\XINT_expr_tmpa\endcsname
+ \expandafter{\XINT_expr_tmpa}{#2}%
+ \expandafter#3\csname XINT_#2_userfunc_\XINT_expr_tmpa\endcsname
+ [\XINT_expr_tmpb]{\XINT_expr_tmpc}%
\ifxintverbose\xintMessage {xintexpr}{Info}
{Function \XINT_expr_tmpa\space for \string\xint #4 parser
associated to \string\XINT_#2_userfunc_\XINT_expr_tmpa\space
@@ -2515,11 +2677,17 @@
\XINT_tmpa\xintdeffunc {expr} \XINT_NewFunc {expr}%
\XINT_tmpa\xintdefiifunc {iiexpr}\XINT_NewIIFunc {iiexpr}%
\XINT_tmpa\xintdeffloatfunc{flexpr}\XINT_NewFloatFunc{floatexpr}%
-\def\XINT_expr_defuserfunc #1#2{%
+\def\XINT_expr_defuserfunc #1#2#3%
+{%
\def #1##1##2##3{\expandafter ##1\expandafter ##2%
- \csname .=\expandafter #2\romannumeral`&&@\XINT_expr_unlock ##3,\endcsname
+ \csname .=\XINT:expr:userfunc{#3}{#2}{\XINT_expr_unlock ##3}\endcsname
}%
}%
+\def\XINT:expr:userfunc #1#2#3%
+ {\csname XINT_#1_userfunc_#2\expandafter\endcsname
+ \romannumeral0\xintcsvtolistnonstripped{#3}}%
+\def\XINT:newexpr:userfunc #1#2#3%
+ {~csname XINT_#1_userfunc_#2~endcsname\xintCSVtoListNonStripped{#3}}%
\def\XINT_expr_wrapit #1{\expandafter\XINT_expr_wrap\csname.=#1\endcsname}%
\def\xintNewFunction #1#2[#3]#4%
{%
@@ -2528,16 +2696,16 @@
\def\XINT_expr_tmpb ##1##2##3##4##5##6##7##8##9{#4}%
\begingroup
\ifcase #3\relax
- \toks0{,}%
- \or \toks0{##1,}%
- \or \toks0{##1,##2,}%
- \or \toks0{##1,##2,##3,}%
- \or \toks0{##1,##2,##3,##4,}%
- \or \toks0{##1,##2,##3,##4,##5,}%
- \or \toks0{##1,##2,##3,##4,##5,##6,}%
- \or \toks0{##1,##2,##3,##4,##5,##6,##7,}%
- \or \toks0{##1,##2,##3,##4,##5,##6,##7,##8,}%
- \else \toks0{##1,##2,##3,##4,##5,##6,##7,##8,##9,}%
+ \toks0{}%
+ \or \toks0{##1}%
+ \or \toks0{##1##2}%
+ \or \toks0{##1##2##3}%
+ \or \toks0{##1##2##3##4}%
+ \or \toks0{##1##2##3##4##5}%
+ \or \toks0{##1##2##3##4##5##6}%
+ \or \toks0{##1##2##3##4##5##6##7}%
+ \or \toks0{##1##2##3##4##5##6##7##8}%
+ \else \toks0{##1##2##3##4##5##6##7##8##9}%
\fi
\expandafter
\endgroup
@@ -2549,13 +2717,13 @@
{\XINT_expr_wrapit{##7}}{\XINT_expr_wrapit{##8}}{\XINT_expr_wrapit{##9}}}%
\expandafter\XINT_expr_newfunction
\csname XINT_expr_func_\XINT_expr_tmpa\expandafter\endcsname
- \csname XINT_expr_macrofunc_\XINT_expr_tmpa\endcsname\xintbareeval
+ \expandafter{\XINT_expr_tmpa}{eval}\xintbareeval
\expandafter\XINT_expr_newfunction
\csname XINT_iiexpr_func_\XINT_expr_tmpa\expandafter\endcsname
- \csname XINT_expr_macrofunc_\XINT_expr_tmpa\endcsname\xintbareiieval
+ \expandafter{\XINT_expr_tmpa}{iieval}\xintbareiieval
\expandafter\XINT_expr_newfunction
\csname XINT_flexpr_func_\XINT_expr_tmpa\expandafter\endcsname
- \csname XINT_expr_macrofunc_\XINT_expr_tmpa\endcsname\xintbarefloateval
+ \expandafter{\XINT_expr_tmpa}{floateval}\xintbarefloateval
\ifxintverbose
\xintMessage {xintexpr}{Info}
{Function \XINT_expr_tmpa\space for the expression parsers is
@@ -2564,10 +2732,27 @@
\csname XINT_expr_macrofunc_\XINT_expr_tmpa\endcsname}%
\fi
}%
-\def\XINT_expr_newfunction #1#2#3%
+\def\XINT_expr_newfunction #1#2#3#4%
+{%
+ \def#1##1##2##3{\expandafter ##1\expandafter ##2\romannumeral0%
+ \XINT:expr:macrofunc{#4}{#3}{#2}{\XINT_expr_unlock##3}}%
+}%
+\def\XINT:expr:macrofunc #1#2#3#4%
+{%
+ #1\csname XINT_expr_macrofunc_#3\expandafter\endcsname
+ \romannumeral0\xintcsvtolistnonstripped{#4}\relax
+}%
+\def\XINT:newexpr:macrofunc #1{%
+\def\XINT:newexpr:macrofunc ##1##2##3##4%
{%
- \def#1##1##2##3{\expandafter ##1\expandafter ##2\romannumeral`&&@%
- #3\expandafter#2\romannumeral`&&@\XINT_expr_unlock##3,\relax}%
+ \expandafter#1\csname.=~XINT:newexpr:macrofunc:a{##2}{##3}%
+ {\xintCSVtoListNonStripped{##4}}\endcsname
+}%
+}\XINT:newexpr:macrofunc { }%
+\def\XINT:newexpr:macrofunc:a #1#2#3%
+{%
+ \expandafter\XINT_expr_unlock\romannumeral0\csname xintbare#1\endcsname
+ \csname XINT_expr_macrofunc_#2\endcsname#3\relax
}%
\def\xintApply::csv #1#2%
{\expandafter\XINT_applyon::_a\expandafter {\romannumeral`&&@#2}{#1}}%
@@ -2591,141 +2776,144 @@
\def\XINT_applyon:::_e #1,#2#3#4{\XINT_applyon:::_b {#2}{#3}{#4, #1}}%
\def\XINT_applyon:::_end #1,#2#3#4{\xint_secondoftwo #4}%
\catcode`~ 12
-\def\XINT_expr_RApply::csv #1#2#3#4%
- {~xintApply::csv{~expandafter#1~xint_exchangetwo_keepbraces{#4}}{#3}}%
-\def\XINT_expr_LApply::csv #1#2#3#4{~xintApply::csv{#1{#3}}{#4}}%
-\def\XINT_expr_RLApply:::csv #1#2{~xintApply:::csv{#1}}%
\catcode`$ 12 % $
-\def\XINT_xptwo_getab_b #1#2!#3%
- {\expandafter\XINT_xptwo_getab_c\romannumeral`&&@#3!#1{#1#2}}%
-\def\XINT_xptwo_getab_c #1#2!#3#4#5#6{#1#3{#5}{#6}{#1#2}{#4}}%
\def\xint_ddfork #1$$#2#3\krof {#2}% $$
-\def\XINT_NEfork #1#2{\xint_ddfork
- #1#2\XINT_expr_RLApply:::csv
- #1$\XINT_expr_RApply::csv% $
- $#2\XINT_expr_LApply::csv% $
- $${\XINT_NEfork_nn #1#2}% $$
- \krof }%
-\def\XINT_NEfork_nn #1#2#3#4{%
- \if #1##\xint_dothis{#3}\fi
- \if #1~\xint_dothis{#3}\fi
- \if #2##\xint_dothis{#3}\fi
- \if #2~\xint_dothis{#3}\fi
- \xint_orthat {\csname #4NE\endcsname }%
- }%
-\def\XINT_NEfork_one #1#2!#3#4#5#6{%
- \if ###1\xint_dothis {#3}\fi
- \if ~#1\xint_dothis {#3}\fi
- \if $#1\xint_dothis {~xintApply::csv{#3#5}}\fi %$
- \xint_orthat {\csname #4NE\endcsname #6}{#1#2}%
-}%
-\toks0 {}%
-\xintFor #1 in
- {DivFloor,Mod,Round,Trunc,iRound,iTrunc,iQuo,iRem,
- iiDivFloor,iiDivRound,iiMod,iiQuo,iiRem,%
- Lt,Gt,Eq,LtorEq,GtorEq,NotEq,%
- iiLt,iiGt,iiEq,iiLtorEq,iiGtorEq,iiNotEq,%
- Add,Sub,Mul,Div,Pow,E,%
- iiAdd,iiSub,iiMul,iiPow,iiE,%
- AND,OR,XOR,%
- SeqA::csv,iiSeqA::csv}\do
- {\toks0
- \expandafter{\the\toks0% no space!
- \expandafter\let\csname xint#1NE\expandafter\endcsname\csname xint#1\expandafter
- \endcsname\expandafter\def\csname xint#1\endcsname ####1####2{%
- \expandafter\XINT_NEfork
- \romannumeral`&&@\expandafter\XINT_xptwo_getab_b
- \romannumeral`&&@####2!{####1}{~xint#1}{xint#1}}%
- }%
-}%
-\xintFor #1 in {Num,Irr,Abs,iiAbs,Sgn,iiSgn,TFrac,Floor,iFloor,Ceil,iCeil,%
- Sqr,iiSqr,iiSqrt,iiSqrtR,iiIsZero,iiIsNotZero,iiifNotZero,iiifSgn,%
- Odd,Even,iiOdd,iiEven,Opp,iiOpp,iiifZero,Fac,Binomial,%
- PFactorial,iiFac,iiBinomial,iiPFactorial,Bool,Toggle}\do
-{\toks0 \expandafter{\the\toks0%
- \expandafter\let\csname xint#1NE\expandafter\endcsname\csname
- xint#1\expandafter
- \endcsname\expandafter\def\csname xint#1\endcsname ####1{%
- \expandafter\XINT_NEfork_one\romannumeral`&&@####1!{~xint#1}{xint#1}{}{}}%
- }%
-}%
-\toks0
- \expandafter{\the\toks0
- \let\XINTinFloatFacNE\XINTinFloatFac
- \def\XINTinFloatFac ##1{%
- \expandafter\XINT_NEfork_one
- \romannumeral`&&@##1!{~XINTinFloatFac}{XINTinFloatFac}{}{}}%
- }%
-\xintFor #1 in {Add,Sub,Mul,Div,Binomial,PFactorial,PowerH,E,%
- Mod,DivFloor,DivMod,SeqA::csv}\do
-{\toks0
- \expandafter{\the\toks0%
- \expandafter\let\csname XINTinFloat#1NE\expandafter\endcsname
- \csname XINTinFloat#1\expandafter\endcsname
- \expandafter\def\csname XINTinFloat#1\endcsname ####1####2{%
- \expandafter\XINT_NEfork
- \romannumeral`&&@\expandafter\XINT_xptwo_getab_b
- \romannumeral`&&@####2!{####1}{~XINTinFloat#1}{XINTinFloat#1}}%
- }%
-}%
-\xintFor #1 in {XINTinFloatdigits,XINTinFloatFracdigits,XINTinFloatSqrtdigits,XINTinFloatFacdigits}\do
-{\toks0
- \expandafter{\the\toks0%
- \expandafter\let\csname #1NE\expandafter\endcsname\csname #1\expandafter
- \endcsname\expandafter\def\csname #1\endcsname ####1{\expandafter
- \XINT_NEfork_one\romannumeral`&&@####1!{~#1}{#1}{}{}}%
- }%
+\def\XINT:NE:RApply::csv #1#2#3#4%
+ {~xintApply::csv{~expandafter #2~xint_exchangetwo_keepbraces{#4}}{#3}}%
+\def\XINT:NE:LApply::csv #1#2#3{~xintApply::csv{#2{#3}}}%
+\def\XINT:NE:RLApply:::csv #1{~xintApply:::csv}%
+\def\XINT:NE:two#1{\XINT:NE:two_{#1}{\detokenize{#1}}}%
+\def\XINT:NE:two_#1#2#3#4%
+ {\expandafter\XINT:NE:two_a\romannumeral`&&@#4!{#3}{#1}{#2}}%
+\def\XINT:NE:two_a#1#2!#3#4#5%
+ {\expandafter\XINT:NE:two_b\romannumeral`&&@#3!#1{#4}{#5}{#1#2}}%
+\def\XINT:NE:two_b#1#2!#3#4#5{\XINT:NE:two_fork_dd#1#3{#4}{#5}{#1#2}}%
+\def\XINT:NE:two_fork_dd #1#2{%
+ \xint_ddfork
+ #1#2\XINT:NE:RLApply:::csv
+ #1$\XINT:NE:RApply::csv% $
+ $#2\XINT:NE:LApply::csv% $
+ $${\XINT:NE:two_fork_nn #1#2}% $$
+ \krof
+}%
+\def\XINT:NE:two_fork_nn #1#2#3#4{%
+ \if #1##\xint_dothis{#4}\fi
+ \if #1~\xint_dothis{#4}\fi
+ \if #2##\xint_dothis{#4}\fi
+ \if #2~\xint_dothis{#4}\fi
+ \xint_orthat{#3}%
+}%
+\def\XINT:NE:one#1#2{\expandafter\XINT:NE:one_a\romannumeral`&&@#2!#1}%
+\def\XINT:NE:one_a#1#2!#3{%
+ \if ###1\xint_dothis {\detokenize{#3}}\fi
+ \if ~#1\xint_dothis {\detokenize{#3}}\fi
+ \if $#1\xint_dothis {~xintApply::csv{\detokenize{#3}}}\fi %$
+ \xint_orthat #3{#1#2}%
+}%
+\def\XINT:NE:oneopt#1[#2]#3%
+ {\expandafter\XINT:NE:oneopt_a\romannumeral`&&@#3!{#2}#1}%
+\def\XINT:NE:oneopt_a#1#2!#3#4%
+ {\expandafter\XINT:NE:oneopt_b\romannumeral`&&@#3!#1#4{#1#2}}%
+\def\XINT:NE:oneopt_b#1#2!#3#4%
+ {\expandafter\XINT:NE:oneopt_fork#1#3#4{#1#2}}%
+\def\XINT:NE:oneopt_fork#1#2#3#4{%
+ \if1\if###11\else\if~#11\else\if###21\else\if~#21\else0\fi\fi\fi\fi
+ \xint_dothis {\detokenize{#3}[#4]}\fi
+ \if $#2\xint_dothis {~xintApply::csv{\detokenize{#3}[#4]}}\fi %$
+ \xint_orthat{#3[#4]}%
+}% pas complétement général, mais bon
+\def\XINT:NE:csv #1{\detokenize{#1}}% radicalement fainéant
+\def\XINT:newexpr:one:and:opt #1,#2,#3!#4#5%
+{%
+ \if\relax#3\relax\expandafter\xint_firstoftwo\else
+ \expandafter\xint_secondoftwo\fi
+ {\XINT:NE:one#4}{\XINT:NE:oneopt#5[\XINT:NE:one\xintNum{#2}]}{#1}%
}%
-\xintFor #1 in {xintSeq::csv,xintiiSeq::csv,XINTinFloatSeq::csv}\do
- {\toks0
- \expandafter{\the\toks0% no space
- \expandafter\let\csname #1NE\expandafter\endcsname\csname #1\expandafter
- \endcsname\expandafter\def\csname #1\endcsname ####1####2{%
- \expandafter\XINT_NEfork
- \romannumeral`&&@\expandafter\XINT_xptwo_getab_b
- \romannumeral`&&@####2!{####1}{$noexpand$#1}{#1}}%
- }%
+\def\XINT:newexpr:one:or:two #1,#2,#3!#4#5%
+{%
+ \if\relax#3\relax\expandafter\xint_firstoftwo\else
+ \expandafter\xint_secondoftwo\fi
+ {\XINT:NE:two#4{0}}{\XINT:NE:two#5{\XINT:NE:one\xintNum{#2}}}{#1}%
}%
-\xintFor #1 in {xintSeqB,xintiiSeqB,XINTinFloatSeqB}\do
- {\toks0
- \expandafter{\the\toks0% no space
- \expandafter\let\csname #1::csvNE\expandafter\endcsname\csname #1::csv\expandafter
- \endcsname\expandafter\def\csname #1::csv\endcsname ####1####2{%
- \expandafter\XINT_NEfork
- \romannumeral`&&@\expandafter\XINT_xptwo_getab_b
- \romannumeral`&&@####2!{####1}{$noexpand$#1:f:csv}{#1::csv}}%
- }%
+\def\XINT:newiiexpr:one:or:two #1,#2,#3!#4%
+{%
+ \if\relax#3\relax\expandafter\xint_firstoftwo\else
+ \expandafter\xint_secondoftwo\fi
+ {\XINT:NE:two#4{0}}{\XINT:NE:two#4{#2}}{#1}%
+}%
+\def\XINT:newexpr:insertdollar~{$noexpand$}%
+\def\XINT:newexpr:two:to:two #1,#2,!#3%
+{%
+ \XINT:NE:two_
+ {\expandafter\XINT:expr:totwo\romannumeral`&&@#3}%
+ {$noexpand$expandafter~XINT:expr:totwo~romannumeral-`0\detokenize{#3}}%
+ {#1}{#2}%
+}%
+\def\XINT:newflexpr:two:to:two #1,#2,!#3%
+{%
+ \XINT:NE:two_
+ {#3}%
+ {\expandafter\XINT:newexpr:insertdollar\detokenize{#3}}%
+ {#1}{#2}%
+}%
+\def\XINT:newexpr:two:to:one #1,#2,!#3%
+{%
+ \XINT:NE:two#3{#1}{#2}%
+}%
+\let\XINT:newflexpr:two:to:one\XINT:newexpr:two:to:one
+\def\xintifNotZeroNE:#1#2,#3,#4,%
+{%
+ \if1\if###11\else\if~#11\else\if$#11\else0%$
+ \fi\fi\fi
+ \xint_dothis{~xintifNotZero}\fi
+ \xint_orthat\xintifNotZero
+ {#1#2}{#3}{#4}%
+}%
+\def\xintifSgnNE:#1#2,#3,#4,#5,%
+{%
+ \if1\if###11\else\if~#11\else\if$#11\else0%$
+ \fi\fi\fi
+ \xint_dothis{~xintifSgn}\fi
+ \xint_orthat\xintifSgn
+ {#1#2}{#3}{#4}{#5}%
+}%
+\def\XINT_expr_redefinemacros {%
+ \let\XINT:NEhook:one\XINT:NE:one
+ \let\XINT:NEhook:two\XINT:NE:two
+ \let\XINT:NEhook:csv\XINT:NE:csv
+ \let\XINT:expr:one:and:opt \XINT:newexpr:one:and:opt
+ \let\XINT:expr:one:or:two \XINT:newexpr:one:or:two
+ \let\XINT:iiexpr:one:or:two \XINT:newiiexpr:one:or:two
+ \let\XINT:expr:two:to:two \XINT:newexpr:two:to:two
+ \let\XINT:expr:two:to:one \XINT:newexpr:two:to:one
+ \let\XINT:flexpr:two:to:one \XINT:newflexpr:two:to:one
+ \let\XINT:expr:two:to:one \XINT:newexpr:two:to:one
+ \let\XINT:flexpr:two:to:two \XINT:newflexpr:two:to:two
+ \let\XINT:flexpr:two:to:one \XINT:newflexpr:two:to:one
+ \let\xintifNotZero: \xintifNotZeroNE:
+ \let\xintifSgn: \xintifSgnNE:
+ \let\xintSeqNumeric::csv \xintSeq::csv
+ \let\xintiiSeqNumeric::csv \xintiiSeq::csv
+ \let\XINTinFloatSeqNumeric::csv \XINTinFloatSeq::csv
+ \let\xintSeqBNumeric::csv \xintSeqB::csv
+ \let\xintiiSeqBNumeric::csv \xintiiSeqB::csv
+ \let\XINTinFloatSeqBNumeric::csv\XINTinFloatSeqB::csv
+ \def\xintSeq::csv
+ {\XINT:NE:two_\xintSeqNumeric::csv{$noexpand$xintSeq::csv}}%
+ \def\xintiiSeq::csv
+ {\XINT:NE:two_\xintiiSeqNumeric::csv{$noexpand$xintiiSeq::csv}}%
+ \def\XINTinFloatSeq::csv
+ {\XINT:NE:two_\XINTinFloatSeqNumeric::csv{$noexpand$XINTinFloatSeq::csv}}%
+ \def\xintSeqB::csv
+ {\XINT:NE:two_\xintSeqBNumeric::csv{$noexpand$xintSeqB:f:csv}}%
+ \def\xintiiSeqB::csv
+ {\XINT:NE:two_\xintiiSeqBNumeric::csv{$noexpand$xintiiSeqB:f:csv}}%
+ \def\XINTinFloatSeqB::csv
+ {\XINT:NE:two_\XINTinFloatSeqBNumeric::csv{$noexpand$XINTinFloatSeqB:f:csv}}%
+ \def\xintListSel:x:csv {~xintListSel:f:csv }%
+ \let\XINT:expr:userfunc \XINT:newexpr:userfunc
+ \let\XINT:expr:macrofunc\XINT:newexpr:macrofunc
}%
-\toks0
- \expandafter{\the\toks0
- \let\XINTinFloatNE\XINTinFloat
- \def\XINTinFloat [##1]##2{% not ultimately general, but got tired
- \expandafter\XINT_NEfork_one
- \romannumeral`&&@##2!{~XINTinFloat[##1]}{XINTinFloat}{}{[##1]}}%
- \let\XINTinFloatSqrtNE\XINTinFloatSqrt
- \def\XINTinFloatSqrt [##1]##2{%
- \expandafter\XINT_NEfork_one
- \romannumeral`&&@##2!{~XINTinFloatSqrt[##1]}{XINTinFloatSqrt}{}{[##1]}}%
- \let\XINTinFloatFacNE\XINTinFloatFac
- \def\XINTinFloatFac [##1]##2{%
- \expandafter\XINT_NEfork_one
- \romannumeral`&&@##2!{~XINTinFloatFac[##1]}{XINTinFloatFac}{}{[##1]}}%
-}%
-\xintFor #1 in {ANDof,ORof,XORof,iiMaxof,iiMinof,iiSum,iiPrd,
- GCDof,LCMof,Sum,Prd,Maxof,Minof,
- Reverse:f,FirstItem:f,LastItem:f}\do
-{\toks0
- \expandafter{\the\toks0\expandafter\def\csname xint#1:csv\endcsname {~xint#1:csv}}%
-}%
-\xintFor #1 in
- {XINTinFloatMaxof,XINTinFloatMinof,XINTinFloatSum,XINTinFloatPrd}\do
-{\toks0
- \expandafter{\the\toks0\expandafter\def\csname #1:csv\endcsname {~#1:csv}}%
-}%
-\toks0 \expandafter{\the\toks0
- \def\xintListSel:x:csv {~xintListSel:f:csv }%
-}%
-\odef\XINT_expr_redefinemacros {\the\toks0}%
\def\XINT_expr_redefineprints
{%
\def\XINT_flexpr_noopt
@@ -2735,56 +2923,58 @@
\def\XINT_expr_unlock_sp ##1.;##2##3.=##4!%
{\if -##2\expandafter\xint_firstoftwo\else\expandafter\xint_secondoftwo\fi
\XINTdigits{{##2##3}}{##4}}%
- \def\XINT_expr_print ##1{\expandafter\xintSPRaw::csv\expandafter
- {\romannumeral`&&@\XINT_expr_unlock ##1}}%
- \def\XINT_iiexpr_print ##1{\expandafter\xintCSV::csv\expandafter
- {\romannumeral`&&@\XINT_expr_unlock ##1}}%
- \def\XINT_boolexpr_print ##1{\expandafter\xintIsTrue::csv\expandafter
- {\romannumeral`&&@\XINT_expr_unlock ##1}}%
+ \def\XINT_expr_print ##1%
+ {\expandafter\xintSPRaw::csv\expandafter
+ {\romannumeral`&&@\XINT_expr_unlock ##1}}%
+ \def\XINT_iiexpr_print ##1%
+ {\expandafter\xintCSV::csv\expandafter
+ {\romannumeral`&&@\XINT_expr_unlock ##1}}%
+ \def\XINT_boolexpr_print ##1%
+ {\expandafter\xintIsTrue::csv\expandafter
+ {\romannumeral`&&@\XINT_expr_unlock ##1}}%
\def\xintCSV::csv {~xintCSV::csv }%
\def\xintSPRaw::csv {~xintSPRaw::csv }%
\def\xintPFloat::csv {~xintPFloat::csv }%
\def\xintIsTrue::csv {~xintIsTrue::csv }%
\def\xintRound::csv {~xintRound::csv }%
}%
-\toks0 {}%
-\def\xintNewExpr {\XINT_NewExpr{}\XINT_expr_redefineprints\xint_firstofone
+\def\xintNewExpr {\XINT_NewExpr\XINT_expr_redefineprints\xint_firstofone
\xinttheexpr\XINT_newexpr_clean}%
-\def\xintNewFloatExpr{\XINT_NewExpr{}\XINT_expr_redefineprints\xint_firstofone
+\def\xintNewFloatExpr{\XINT_NewExpr\XINT_expr_redefineprints\xint_firstofone
\xintthefloatexpr\XINT_newexpr_clean}%
-\def\xintNewIExpr {\XINT_NewExpr{}\XINT_expr_redefineprints\xint_firstofone
+\def\xintNewIExpr {\XINT_NewExpr\XINT_expr_redefineprints\xint_firstofone
\xinttheiexpr\XINT_newexpr_clean}%
-\def\xintNewIIExpr {\XINT_NewExpr{}\XINT_expr_redefineprints\xint_firstofone
+\def\xintNewIIExpr {\XINT_NewExpr\XINT_expr_redefineprints\xint_firstofone
\xinttheiiexpr\XINT_newexpr_clean}%
-\def\xintNewBoolExpr {\XINT_NewExpr{}\XINT_expr_redefineprints\xint_firstofone
+\def\xintNewBoolExpr {\XINT_NewExpr\XINT_expr_redefineprints\xint_firstofone
\xinttheboolexpr\XINT_newexpr_clean}%
\def\XINT_newexpr_clean #1>{\noexpand\romannumeral`&&@}%
\def\XINT_NewFunc
- {\XINT_NewExpr,{}\xint_gobble_i\xintthebareeval \XINT_newfunc_clean }%
+ {\XINT_NewExpr{}\xint_gobble_i\xintthebareeval\XINT_newfunc_clean}%
\def\XINT_NewFloatFunc
- {\XINT_NewExpr,{}\xint_gobble_i\xintthebarefloateval\XINT_newfunc_clean }%
+ {\XINT_NewExpr{}\xint_gobble_i\xintthebarefloateval\XINT_newfunc_clean}%
\def\XINT_NewIIFunc
- {\XINT_NewExpr,{}\xint_gobble_i\xintthebareiieval \XINT_newfunc_clean }%
+ {\XINT_NewExpr{}\xint_gobble_i\xintthebareiieval\XINT_newfunc_clean}%
\def\XINT_newfunc_clean #1>{}%
-\def\XINT_NewExpr #1#2#3#4#5#6#7[#8]%
+\def\XINT_NewExpr #1#2#3#4#5#6[#7]%
{%
\begingroup
- \ifcase #8\relax
- \toks0 {\endgroup\def#6}%
- \or \toks0 {\endgroup\def#6##1#1}%
- \or \toks0 {\endgroup\def#6##1#1##2#1}%
- \or \toks0 {\endgroup\def#6##1#1##2#1##3#1}%
- \or \toks0 {\endgroup\def#6##1#1##2#1##3#1##4#1}%
- \or \toks0 {\endgroup\def#6##1#1##2#1##3#1##4#1##5#1}%
- \or \toks0 {\endgroup\def#6##1#1##2#1##3#1##4#1##5#1##6#1}%
- \or \toks0 {\endgroup\def#6##1#1##2#1##3#1##4#1##5#1##6#1##7#1}%
- \or \toks0 {\endgroup\def#6##1#1##2#1##3#1##4#1##5#1##6#1##7#1##8#1}%
- \or \toks0 {\endgroup\def#6##1#1##2#1##3#1##4#1##5#1##6#1##7#1##8#1##9#1}%
+ \ifcase #7\relax
+ \toks0 {\endgroup\def#5}%
+ \or \toks0 {\endgroup\def#5##1}%
+ \or \toks0 {\endgroup\def#5##1##2}%
+ \or \toks0 {\endgroup\def#5##1##2##3}%
+ \or \toks0 {\endgroup\def#5##1##2##3##4}%
+ \or \toks0 {\endgroup\def#5##1##2##3##4##5}%
+ \or \toks0 {\endgroup\def#5##1##2##3##4##5##6}%
+ \or \toks0 {\endgroup\def#5##1##2##3##4##5##6##7}%
+ \or \toks0 {\endgroup\def#5##1##2##3##4##5##6##7##8}%
+ \or \toks0 {\endgroup\def#5##1##2##3##4##5##6##7##8##9}%
\fi
\xintexprSafeCatcodes
\XINT_expr_redefinemacros
- #2%
- \XINT_NewExpr_a #3#4#5#6%
+ #1%
+ \XINT_NewExpr_a #2#3#4#5%
}%
\catcode`~ 13 \catcode`@ 14 \catcode`\% 6 \catcode`# 12 \catcode`$ 11 @ $
\def\XINT_NewExpr_a %1%2%3%4%5@
@@ -2795,13 +2985,14 @@
\catcode`# 12 \catcode`~ 13 \escapechar 126
\endlinechar -1 \everyeof {\noexpand }@
\edef\XINT_tmpb
- {\scantokens\expandafter
- {\romannumeral`&&@\expandafter%2\XINT_tmpa {#1}{#2}{#3}{#4}{#5}{#6}{#7}{#8}{#9}\relax}@
+ {\scantokens\expandafter{\romannumeral`&&@\expandafter
+ %2\XINT_tmpa{#1}{#2}{#3}{#4}{#5}{#6}{#7}{#8}{#9}\relax}@
}@
\escapechar 92 \catcode`# 6 \catcode`$ 0 @ $
\edef\XINT_tmpa %%1%%2%%3%%4%%5%%6%%7%%8%%9@
- {\scantokens\expandafter{\expandafter%3\meaning\XINT_tmpb}}@
- \the\toks0\expandafter{\XINT_tmpa{%%1}{%%2}{%%3}{%%4}{%%5}{%%6}{%%7}{%%8}{%%9}}@
+ {\scantokens\expandafter{\expandafter%3\meaning\XINT_tmpb}}@
+ \the\toks0\expandafter
+ {\XINT_tmpa{%%1}{%%2}{%%3}{%%4}{%%5}{%%6}{%%7}{%%8}{%%9}}@
%1{\ifxintverbose
\xintMessage{xintexpr}{Info}@
{\string%4\space now with meaning \meaning%4}@
@@ -2834,6 +3025,7 @@
\catcode45=\the\catcode45 % -
\catcode44=\the\catcode44 % ,
\catcode61=\the\catcode61 % =
+ \catcode96=\the\catcode96 % `
\catcode32=\the\catcode32\relax % space
}%
\catcode59=12 % ;
@@ -2858,6 +3050,7 @@
\catcode45=12 % -
\catcode44=12 % ,
\catcode61=12 % =
+ \catcode96=12 % `
\catcode32=10 % space
}%
\let\XINT_tmpa\relax \let\XINT_tmpb\relax \let\XINT_tmpc\relax