summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/l3kernel/l3quark.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex/contrib/l3kernel/l3quark.dtx')
-rw-r--r--macros/latex/contrib/l3kernel/l3quark.dtx65
1 files changed, 34 insertions, 31 deletions
diff --git a/macros/latex/contrib/l3kernel/l3quark.dtx b/macros/latex/contrib/l3kernel/l3quark.dtx
index c465fa251c..000063bc00 100644
--- a/macros/latex/contrib/l3kernel/l3quark.dtx
+++ b/macros/latex/contrib/l3kernel/l3quark.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2024-02-20}
+% \date{Released 2024-03-14}
%
% \maketitle
%
@@ -820,43 +820,46 @@
% \begin{macro}{
% \@@_new_conditional_n:Nnnn,
% \@@_new_conditional_N:Nnnn,
+% \@@_new_conditional_n_aux:NNNn,
+% \@@_new_conditional_N_aux:NNNn
% }
% These macros implement the two possibilities for branching quark
-% conditionals, passing
-% the right arguments to \cs{@@_new_conditional_aux_do:NNnnn},
-% which defines some auxiliaries and defines the
-% main conditionals.
+% conditionals. To avoid constructing without defining the
+% \cs[no-index]{__\meta{type}_if_quark_\meta{name}:w} helper,
+% \texttt{N}-type function accepts a \cs{prg_do_nothing:} as
+% a placeholder.
% \begin{macrocode}
-\cs_new_protected:Npn \@@_new_conditional_n:Nnnn
- { \@@_new_conditional_aux_do:NNnnn \use_i:nn }
-\cs_new_protected:Npn \@@_new_conditional_N:Nnnn
- { \@@_new_conditional_aux_do:NNnnn \use_ii:nn }
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{
-% \@@_new_conditional_aux_do:NNnnn,
-% \@@_new_conditional_define:NNNNn,
-% }
-% Similar to the previous macros, but branching conditionals only
-% require one auxiliary, so we take a shortcut. In
-% \cs{@@_new_conditional_define:NNNNn}, |#4| is \cs{use_i:nn} to
-% define the \texttt{n}-type function (which needs an auxiliary) and
-% is \cs{use_ii:nn} to define the \texttt{N}-type function.
-% \begin{macrocode}
-\cs_new_protected:Npn \@@_new_conditional_aux_do:NNnnn #1 #2 #3 #4
+\cs_new_protected:Npn \@@_new_conditional_n:Nnnn #1 #2 #3
+ {
+ \exp_args:Ncc \@@_new_conditional_n_aux:NNNn
+ { __ #3 _if_quark_ #2 :w } { q__ #3 _ #2 } #1
+ }
+\cs_new_protected:Npn \@@_new_conditional_N:Nnnn #1 #2 #3
{
- \exp_args:Ncc \@@_new_conditional_define:NNNNn
- { __ #4 _if_quark_ #3 :w } { q__ #4 _ #3 } #2 #1
+ \exp_args:NNc \@@_new_conditional_N_aux:NNNn
+ \prg_do_nothing: { q__ #3 _ #2 } #1
}
-\cs_new_protected:Npn \@@_new_conditional_define:NNNNn #1 #2 #3 #4 #5
+\cs_new_protected:Npn \@@_new_conditional_n_aux:NNNn #1 #2 #3 #4
{
- #4 { \cs_gset:Npn #1 ##1 #2 ##2 ? ##3 ?! { ##1 ##2 } } { }
- \exp_args:Nno \use:n { \prg_new_conditional:Npnn #3 ##1 {#5} }
+ \cs_gset:Npn #1 ##1 #2 ##2 ? ##3 ?! { ##1##2 }
+ \prg_new_conditional:Npnn #3 ##1 {#4}
{
- #4 { \@@_if_empty_if:o { #1 {} ##1 {} ?! #2 ??! } }
- { \if_meaning:w #2 ##1 }
- \prg_return_true: \else: \prg_return_false: \fi:
+ \@@_if_empty_if:o { #1 {} ##1 {} ?! #2 ??! }
+ \prg_return_true:
+ \else:
+ \prg_return_false:
+ \fi:
+ }
+ }
+\cs_new_protected:Npn \@@_new_conditional_N_aux:NNNn #1 #2 #3 #4
+ {
+ \prg_new_conditional:Npnn #3 ##1 {#4}
+ {
+ \if_meaning:w #2 ##1
+ \prg_return_true:
+ \else:
+ \prg_return_false:
+ \fi:
}
}
% \end{macrocode}