[latex3-commits] [git/LaTeX3-latex3-latex3] master: fix doc of tl_if_empty:n (3ac04ab56)

Bruno Le Floch blflatex at gmail.com
Tue Oct 27 09:11:58 CET 2020


Repository : https://github.com/latex3/latex3
On branch  : master
Link       : https://github.com/latex3/latex3/commit/3ac04ab5624f71d5437c34f574f63d72f9d82f1a

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

commit 3ac04ab5624f71d5437c34f574f63d72f9d82f1a
Author: Jonathan Spratte <jspratte at yahoo.de>
Date:   Fri Sep 18 18:52:33 2020 +0200

    fix doc of tl_if_empty:n


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

3ac04ab5624f71d5437c34f574f63d72f9d82f1a
 l3kernel/l3tl.dtx | 17 ++++++-----------
 1 file changed, 6 insertions(+), 11 deletions(-)

diff --git a/l3kernel/l3tl.dtx b/l3kernel/l3tl.dtx
index 042338511..adce01fa3 100644
--- a/l3kernel/l3tl.dtx
+++ b/l3kernel/l3tl.dtx
@@ -2111,18 +2111,13 @@
 % \end{macro}
 %
 % \begin{macro}[pTF]{\tl_if_empty:n, \tl_if_empty:V}
-%   Convert the argument to a string: this is empty if and only if
-%   the argument is.  Then |\if:w \scan_stop: ... \scan_stop:| is
-%   \texttt{true} if and only if the string |...| is empty.
+%   The \cs{if:w} triggers the expansion of \cs{tl_to_str:n} which converts the
+%   argument to a string: this is empty if and only if the argument is.  Then
+%   |\if:w \scan_stop: ... \scan_stop:| is \texttt{true} if and only if the
+%   string |...| is empty.
 %   It could be tempting to use |\if:w \scan_stop: #1 \scan_stop:| directly.
-%   This fails on a token
-%   list starting with \cs{scan_stop:} of course but more troubling is the
-%   case where argument is a complete conditional such as \cs{if_true:}
-%   a \cs{else:} b \cs{fi:} because then \cs{if_true:} is used by
-%   \cs{if:w}, the test turns out \texttt{false}, the \cs{else:}
-%   executes the \texttt{false} branch, the \cs{fi:} ends it and the
-%   \cs{scan_stop:} at the end stays in the input stream as well as the now
-%   unbalanced |\else:| and |\fi:|.
+%   But this fails on a token list expanding to anything starting with
+%   \cs{scan_stop:} leaving everything that follows in the input stream.
 %    \begin{macrocode}
 \prg_new_conditional:Npnn \tl_if_empty:n #1 { p , TF , T , F }
   {





More information about the latex3-commits mailing list.