[latex3-commits] [git/latex3] master: Document why N to o and n to c are deprecated, say what to do (see #418) [ci skip] (72eb6d1)

Bruno Le Floch bruno at le-floch.fr
Mon Nov 27 23:20:51 CET 2017


Repository : https://github.com/latex3/latex3
On branch  : master
Link       : https://github.com/latex3/latex3/commit/72eb6d17c919509372c3492c50d4b72ac347bc4a

>---------------------------------------------------------------

commit 72eb6d17c919509372c3492c50d4b72ac347bc4a
Author: Bruno Le Floch <bruno at le-floch.fr>
Date:   Mon Nov 27 17:11:48 2017 -0500

    Document why N to o and n to c are deprecated, say what to do (see #418) [ci skip]


>---------------------------------------------------------------

72eb6d17c919509372c3492c50d4b72ac347bc4a
 l3kernel/l3expan.dtx |   19 ++++++++++++++-----
 1 file changed, 14 insertions(+), 5 deletions(-)

diff --git a/l3kernel/l3expan.dtx b/l3kernel/l3expan.dtx
index 7216ff4..c36176e 100644
--- a/l3kernel/l3expan.dtx
+++ b/l3kernel/l3expan.dtx
@@ -146,16 +146,25 @@
 %   \end{verbatim}
 %   generates the functions |\foo:NV| and |\foo:cV| in the same
 %   way. The \cs{cs_generate_variant:Nn} function can only be applied if
-%   the \meta{parent control sequence} is already defined. Only |n|~and
-%   |N| arguments can be changed to other types, and |N|~can only be
-%   changed to~|c| while |n|~can only be changed to |V|, |v|, |o|,
-%   |f|, or~|x|, so that it is unambiguous what the \meta{parent} of
-%   a \meta{variant} is. If the \meta{parent
+%   the \meta{parent control sequence} is already defined. If the \meta{parent
 %   control sequence} is protected or if the \meta{variant} involves
 %   |x|~arguments, then the \meta{variant control sequence} is also
 %   protected.  The \meta{variant} is created globally, as is any
 %   \cs[no-index]{exp_args:N\meta{variant}} function needed to carry out the
 %   expansion.
+%
+%   Only |n|~and |N| arguments can be changed to other types, and
+%   |N|~can only be changed to~|c| while |n|~can only be changed to |V|,
+%   |v|, |o|, |f|, or~|x|, so that it is unambiguous what the
+%   \meta{parent} of a \meta{variant} is.  For backwards-compatibility
+%   it is currently possible to make an |o|-type variant of an |N|-type
+%   argument or a |c|-type variant of an |n|-type argument.  Both are
+%   deprecated.  The first because an |o|-type argument may expand to
+%   more than one token.  The second because programmers who use that
+%   most often want to access the value of a variable given its name,
+%   hence should use a |v|-type variant instead of |c|-type.  In those
+%   cases, using the lower-level \cs{exp_args:No} or \cs{exp_args:Nc}
+%   functionns explicitly is preferred to defining confusing variants.
 % \end{function}
 %
 % \section{Introducing the variants}





More information about the latex3-commits mailing list