[latex3-commits] [git/latex3] master: Move \__msg_show_wrap:Nn to l3candidates as \msg_show_eval:Nn (975792a)

Bruno Le Floch bruno at le-floch.fr
Mon Dec 4 19:24:50 CET 2017


Repository : https://github.com/latex3/latex3
On branch  : master
Link       : https://github.com/latex3/latex3/commit/975792a07db8ff48df1c4f2e0dbf83d747fc1501

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

commit 975792a07db8ff48df1c4f2e0dbf83d747fc1501
Author: Bruno Le Floch <bruno at le-floch.fr>
Date:   Mon Dec 4 13:24:50 2017 -0500

    Move \__msg_show_wrap:Nn to l3candidates as \msg_show_eval:Nn


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

975792a07db8ff48df1c4f2e0dbf83d747fc1501
 l3kernel/l3candidates.dtx     |   34 +++++++++++++++++++++++++++++++++-
 l3kernel/l3fp-assign.dtx      |    7 ++++---
 l3kernel/l3int.dtx            |    6 +++---
 l3kernel/l3msg.dtx            |   38 +-------------------------------------
 l3kernel/l3prg.dtx            |    4 ++--
 l3kernel/l3skip.dtx           |   12 ++++++------
 l3trial/l3bigint/l3bigint.dtx |    4 ++--
 7 files changed, 51 insertions(+), 54 deletions(-)

diff --git a/l3kernel/l3candidates.dtx b/l3kernel/l3candidates.dtx
index b9a3aa1..4cabe90 100644
--- a/l3kernel/l3candidates.dtx
+++ b/l3kernel/l3candidates.dtx
@@ -370,6 +370,17 @@
 %   space might be removed as well.
 % \end{function}
 %
+% \begin{function}[added = 2017-12-04]{\msg_show_eval:Nn, \msg_log_eval:Nn}
+%   \begin{syntax}
+%     \cs{msg_show_eval:Nn} \meta{function} \Arg{expression}
+%   \end{syntax}
+%   Shows or logs the \meta{expression} (turned into a string), an equal
+%   sign, and the result of applying the \meta{function} to the
+%   \Arg{expression} (with \texttt{f}-expansion).  For instance, if the
+%   \meta{function} is \cs{int_eval:n} and the \meta{expression} is
+%   |1+2| then this logs |> 1+2=3.|
+% \end{function}
+%
 % \section{Additions to \pkg{l3prg}}
 %
 % \begin{function}[added = 2017-11-28]{\bool_const:Nn, \bool_const:cn}
@@ -1939,7 +1950,7 @@
 %     \msg_expandable_error:nnff   ,
 %     \msg_expandable_error:nnf
 %   }
-% \begin{macro}{\__msg_expandable_error_module:nn}
+% \begin{macro}{\@@_expandable_error_module:nn}
 %   Pass to an auxiliary the message to display and the module name
 %    \begin{macrocode}
 \cs_new:Npn \msg_expandable_error:nnnnnn #1#2#3#4#5#6
@@ -1973,6 +1984,27 @@
 % \end{macro}
 % \end{macro}
 %
+% \begin{macro}{\msg_show_eval:Nn, \@@_show_eval:nn}
+%   A short-hand used for \cs{int_show:n} and similar functions that
+%   passes to \cs{@@_show_wrap:n} the result of applying |#1| (a
+%   function such as \cs{int_eval:n}) to the expression |#2|.  The
+%   leading |>~| is needed by \cs{@@_show_wrap:n}.  The use of
+%   \texttt{f}-expansion ensures that |#1| is expanded in the scope in which the
+%   show command is called, rather than in the group created by
+%   \cs{iow_wrap:nnnN}.  This is only important for expressions
+%   involving the \tn{currentgrouplevel} or \tn{currentgrouptype}.
+%   On the other hand we want the expression to be converted to a string
+%   with the usual escape character, hence within the wrapping code.
+%    \begin{macrocode}
+\cs_new_protected:Npn \msg_show_eval:Nn #1#2
+  { \exp_args:Nf \@@_show_eval:nn { #1 {#2} } {#2} }
+\cs_new_protected:Npn \msg_log_eval:Nn
+  { \@@_log_next: \msg_show_eval:Nn }
+\cs_new_protected:Npn \@@_show_eval:nn #1#2
+  { \@@_show_wrap:n { \tl_to_str:n { > ~ #2 = #1 } } }
+%    \end{macrocode}
+% \end{macro}
+%
 % \subsection{Additions to \pkg{l3prg}}
 %
 % \begin{macro}[added = 2017-11-28]{\bool_const:Nn, \bool_const:cn}
diff --git a/l3kernel/l3fp-assign.dtx b/l3kernel/l3fp-assign.dtx
index 51b7644..9e686be 100644
--- a/l3kernel/l3fp-assign.dtx
+++ b/l3kernel/l3fp-assign.dtx
@@ -172,18 +172,19 @@
       { > ~ \token_to_str:N #1 = \fp_to_tl:N #1 }
   }
 \cs_new_protected:Npn \fp_show:n
-  { \__msg_show_wrap:Nn \fp_to_tl:n }
+  { \msg_show_eval:Nn \fp_to_tl:n }
 \cs_generate_variant:Nn \fp_show:N { c }
 %    \end{macrocode}
 % \end{macro}
 %
 % \begin{macro}{\fp_log:N, \fp_log:c, \fp_log:n}
-%   Redirect output of \cs{fp_show:N} and \cs{fp_show:n} to the log.
+%   Redirect output of \cs{fp_show:N} to the log.
+%   Similar to \cs{fp_show:n}.
 %    \begin{macrocode}
 \cs_new_protected:Npn \fp_log:N
   { \__msg_log_next: \fp_show:N }
 \cs_new_protected:Npn \fp_log:n
-  { \__msg_log_next: \fp_show:n }
+  { \msg_log_eval:Nn \fp_to_tl:n }
 \cs_generate_variant:Nn \fp_log:N { c }
 %    \end{macrocode}
 % \end{macro}
diff --git a/l3kernel/l3int.dtx b/l3kernel/l3int.dtx
index ca3fbb2..8299e81 100644
--- a/l3kernel/l3int.dtx
+++ b/l3kernel/l3int.dtx
@@ -2461,7 +2461,7 @@
 %   expressions: this gives a more unified output.
 %    \begin{macrocode}
 \cs_new_protected:Npn \int_show:n
-  { \__msg_show_wrap:Nn \int_eval:n }
+  { \msg_show_eval:Nn \int_eval:n }
 %    \end{macrocode}
 % \end{macro}
 %
@@ -2474,10 +2474,10 @@
 % \end{macro}
 %
 % \begin{macro}{\int_log:n}
-%   Redirect output of \cs{int_show:n} to the log.
+%   Similar to \cs{int_show:n}.
 %    \begin{macrocode}
 \cs_new_protected:Npn \int_log:n
-  { \__msg_log_next: \int_show:n }
+  { \msg_log_eval:Nn \int_eval:n }
 %    \end{macrocode}
 % \end{macro}
 %
diff --git a/l3kernel/l3msg.dtx b/l3kernel/l3msg.dtx
index 5be0c78..ab3b20b 100644
--- a/l3kernel/l3msg.dtx
+++ b/l3kernel/l3msg.dtx
@@ -693,7 +693,7 @@
 %   file instead of the terminal.  This allows for instance
 %   \cs{cs_log:N} to be defined as \cs{__msg_log_next:} \cs{cs_show:N}.
 %   The effect of this command lasts until the next use of
-%   \cs{__msg_show_wrap:Nn} or \cs{__msg_show_wrap:n} or
+%   \cs{msg_show_eval:Nn} or \cs{__msg_show_wrap:n} or
 %   \cs{__msg_show_variable:NNNnn}, in other words until the next time
 %   the \eTeX{} primitive \tn{showtokens} would have been used for
 %   showing to the terminal or until the next
@@ -729,19 +729,6 @@
 %   \cs{__msg_show_wrap:n}.
 % \end{function}
 %
-% \begin{function}[added = 2015-08-03, updated = 2015-08-07]{\__msg_show_wrap:Nn}
-%   \begin{syntax}
-%     \cs{__msg_show_wrap:Nn} \meta{function} \Arg{expression}
-%   \end{syntax}
-%   Shows or logs the \meta{expression} (turned into a string), an
-%   equal sign, and the result of applying the \meta{function} to the
-%   \Arg{expression}.  For instance, if the \meta{function} is
-%   \cs{int_eval:n} and the \meta{expression} is |1+2| then this
-%   logs |> 1+2=3.| The case where the \meta{function} is
-%   \cs{tl_to_str:n} is special: then the string representation of the
-%   \meta{expression} is only logged once.
-% \end{function}
-%
 % \begin{function}[added = 2015-08-03]{\__msg_show_wrap:n}
 %   \begin{syntax}
 %     \cs{__msg_show_wrap:n} \Arg{formatted text}
@@ -2239,29 +2226,6 @@
 %    \end{macrocode}
 % \end{macro}
 %
-% \begin{macro}{\@@_show_wrap:Nn}
-%   A short-hand used for \cs{int_show:n} and many other functions that
-%   passes to \cs{@@_show_wrap:n} the result of applying |#1| (a
-%   function such as \cs{int_eval:n}) to the expression |#2|.  The
-%   leading |>~| is needed by \cs{@@_show_wrap:n}.  The use of
-%   \texttt{x}-expansion ensures that |#1| is expanded in the scope in which the
-%   show command is called, rather than in the group created by
-%   \cs{iow_wrap:nnnN}.  This is only important for expressions
-%   involving the \tn{currentgrouplevel} or \tn{currentgrouptype}.
-%   On the other hand we want the expression to be converted to a string
-%   with the usual escape character, hence within the wrapping code.
-%    \begin{macrocode}
-\cs_new_protected:Npn \@@_show_wrap:Nn #1#2
-  {
-    \exp_args:Nx \@@_show_wrap:n
-      {
-        > ~ \exp_not:n { \tl_to_str:n {#2} } =
-        \exp_not:N \tl_to_str:n { #1 {#2} }
-      }
-  }
-%    \end{macrocode}
-% \end{macro}
-%
 % \begin{macro}{\@@_show_wrap:n}
 % \begin{macro}{\@@_show_wrap_aux:n}
 % \begin{macro}[EXP]{\@@_show_wrap_aux:w}
diff --git a/l3kernel/l3prg.dtx b/l3kernel/l3prg.dtx
index 6342602..7eb28d9 100644
--- a/l3kernel/l3prg.dtx
+++ b/l3kernel/l3prg.dtx
@@ -898,7 +898,7 @@
       { > ~ \token_to_str:N #1 = \@@_to_str:n {#1} }
   }
 \cs_new_protected:Npn \bool_show:n
-  { \__msg_show_wrap:Nn \@@_to_str:n }
+  { \msg_show_eval:Nn \@@_to_str:n }
 \cs_new:Npn \@@_to_str:n #1
   { \bool_if:nTF {#1} { true } { false } }
 \cs_generate_variant:Nn \bool_show:N { c }
@@ -912,7 +912,7 @@
 \cs_new_protected:Npn \bool_log:N
   { \__msg_log_next: \bool_show:N }
 \cs_new_protected:Npn \bool_log:n
-  { \__msg_log_next: \bool_show:n }
+  { \msg_log_eval:Nn \@@_to_str:n }
 \cs_generate_variant:Nn \bool_log:N { c }
 %    \end{macrocode}
 % \end{macro}
diff --git a/l3kernel/l3skip.dtx b/l3kernel/l3skip.dtx
index 492fbc3..724e166 100644
--- a/l3kernel/l3skip.dtx
+++ b/l3kernel/l3skip.dtx
@@ -1619,7 +1619,7 @@
 %   dimension expressions: this gives a more unified output.
 %    \begin{macrocode}
 \cs_new_protected:Npn \dim_show:n
-  { \__msg_show_wrap:Nn \dim_eval:n }
+  { \msg_show_eval:Nn \dim_eval:n }
 %    \end{macrocode}
 %  \end{macro}
 %
@@ -1629,7 +1629,7 @@
 \cs_new_eq:NN \dim_log:N \__kernel_register_log:N
 \cs_new_eq:NN \dim_log:c \__kernel_register_log:c
 \cs_new_protected:Npn \dim_log:n
-  { \__msg_log_next: \dim_show:n }
+  { \msg_log_eval:Nn \dim_eval:n }
 %    \end{macrocode}
 % \end{macro}
 %
@@ -1912,7 +1912,7 @@
 %   skip expressions: this gives a more unified output.
 %    \begin{macrocode}
 \cs_new_protected:Npn \skip_show:n
-  { \__msg_show_wrap:Nn \skip_eval:n }
+  { \msg_show_eval:Nn \skip_eval:n }
 %    \end{macrocode}
 % \end{macro}
 %
@@ -1922,7 +1922,7 @@
 \cs_new_eq:NN \skip_log:N \__kernel_register_log:N
 \cs_new_eq:NN \skip_log:c \__kernel_register_log:c
 \cs_new_protected:Npn \skip_log:n
-  { \__msg_log_next: \skip_show:n }
+  { \msg_log_eval:Nn \skip_eval:n }
 %    \end{macrocode}
 % \end{macro}
 %
@@ -2151,7 +2151,7 @@
 %   muskip expressions: this gives a more unified output.
 %    \begin{macrocode}
 \cs_new_protected:Npn \muskip_show:n
-  { \__msg_show_wrap:Nn \muskip_eval:n }
+  { \msg_show_eval:Nn \muskip_eval:n }
 %    \end{macrocode}
 % \end{macro}
 %
@@ -2161,7 +2161,7 @@
 \cs_new_eq:NN \muskip_log:N \__kernel_register_log:N
 \cs_new_eq:NN \muskip_log:c \__kernel_register_log:c
 \cs_new_protected:Npn \muskip_log:n
-  { \__msg_log_next: \muskip_show:n }
+  { \msg_log_eval:Nn \muskip_eval:n }
 %    \end{macrocode}
 % \end{macro}
 %
diff --git a/l3trial/l3bigint/l3bigint.dtx b/l3trial/l3bigint/l3bigint.dtx
index d13203a..f25fb1f 100644
--- a/l3trial/l3bigint/l3bigint.dtx
+++ b/l3trial/l3bigint/l3bigint.dtx
@@ -2786,12 +2786,12 @@
       { > ~ \token_to_str:N #1 = \bigint_use:N #1 }
   }
 \cs_new_protected:Npn \bigint_show:n
-  { \__msg_show_wrap:Nn \bigint_eval:n }
+  { \msg_show_eval:Nn \bigint_eval:n }
 \cs_generate_variant:Nn \bigint_show:N { c }
 \cs_new_protected:Npn \bigint_log:N
   { \__msg_log_next: \bigint_show:N }
 \cs_new_protected:Npn \bigint_log:n
-  { \__msg_log_next: \bigint_show:n }
+  { \msg_log_eval:Nn \bigint_eval:n }
 \cs_generate_variant:Nn \bigint_log:N { c }
 %    \end{macrocode}
 % \end{macro}





More information about the latex3-commits mailing list