[latex3-commits] [latex3/latex3] main: New `fp_clear_variable` internal that skips checking (5c85da7b7)

github at latex-project.org github at latex-project.org
Thu Oct 26 18:05:45 CEST 2023


Repository : https://github.com/latex3/latex3
On branch  : main
Link       : https://github.com/latex3/latex3/commit/5c85da7b7fd53e6634b2ae80cf8a3e53545663ba

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

commit 5c85da7b7fd53e6634b2ae80cf8a3e53545663ba
Author: Yukai Chou <muzimuzhi at gmail.com>
Date:   Thu Oct 26 07:58:05 2023 +0800

    New `fp_clear_variable` internal that skips checking


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

5c85da7b7fd53e6634b2ae80cf8a3e53545663ba
 l3kernel/l3fp-functions.dtx |  6 ++++--
 l3kernel/l3fp-symbolic.dtx  | 20 +++++++++++++-------
 2 files changed, 17 insertions(+), 9 deletions(-)

diff --git a/l3kernel/l3fp-functions.dtx b/l3kernel/l3fp-functions.dtx
index 77ea0134c..7578bf7c7 100644
--- a/l3kernel/l3fp-functions.dtx
+++ b/l3kernel/l3fp-functions.dtx
@@ -180,8 +180,10 @@
           \exp_args:No \clist_map_inline:nn { \tl_to_str:n {#3} }
             {
               \int_incr:N \l_@@_function_arg_int
-              \exp_args:Ne \@@_clear_variable:n
-                { _ \tex_romannumeral:D \l_@@_function_arg_int }
+              \exp_args:Ne \@@_clear_variable_aux:n
+                {
+                  \c_underscore_str \tex_romannumeral:D \l_@@_function_arg_int
+                }
               \fp_clear_variable:n {##1}
               \cs_set_nopar:cpe { l_@@_variable_##1_fp }
                 {
diff --git a/l3kernel/l3fp-symbolic.dtx b/l3kernel/l3fp-symbolic.dtx
index 0a87ddae4..3cd91a48c 100644
--- a/l3kernel/l3fp-symbolic.dtx
+++ b/l3kernel/l3fp-symbolic.dtx
@@ -542,9 +542,14 @@
 %    \end{macrocode}
 % \end{macro}
 %
-% \begin{macro}{\fp_clear_variable:n}
-% \begin{macro}{\@@_clear_variable:n}
+% \begin{macro}
+%   {
+%     \fp_clear_variable:n, \@@_clear_variable:n, 
+%     \@@_clear_variable_aux:n
+%   }
 %   We need local undefining, so have to do it low-level.
+%   \cs{@@_clear_variable_aux:n} is needed by \cs{@@_set_function:Nnnn}
+%   to skip \cs{@@_id_if_invalid:nTF}.
 %    \begin{macrocode}
 \cs_new_protected:Npn \fp_clear_variable:n #1
   {
@@ -554,14 +559,15 @@
   {
     \@@_id_if_invalid:nTF {#1}
       { \msg_error:nnn { fp } { id-invalid } {#1} }
-      {
-        \cs_set_eq:cN { l_@@_variable_#1_fp } \tex_undefined:D
-        \@@_variable_set_parsing:Nn \cs_set_eq:NN {#1}
-      }
+      { \@@_clear_variable_aux:n {#1} }
+  }
+\cs_new_protected:Npn \@@_clear_variable_aux:n #1
+  {
+    \cs_set_eq:cN { l_@@_variable_#1_fp } \tex_undefined:D
+    \@@_variable_set_parsing:Nn \cs_set_eq:NN {#1}
   }
 %    \end{macrocode}
 % \end{macro}
-% \end{macro}
 %
 % \begin{macro}{\fp_new_variable:n}
 % \begin{macro}{\@@_new_variable:n}





More information about the latex3-commits mailing list.