[latex3-commits] [git/latex3] master: Define \__int_eval:n and \__dim_eval:n, they reduce the need for patching (80d2fb4)

Bruno Le Floch bruno at le-floch.fr
Wed Nov 29 09:59:13 CET 2017


Repository : https://github.com/latex3/latex3
On branch  : master
Link       : https://github.com/latex3/latex3/commit/80d2fb424dd87262f02a78a48e245bccd2934a44

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

commit 80d2fb424dd87262f02a78a48e245bccd2934a44
Author: Bruno Le Floch <bruno at le-floch.fr>
Date:   Wed Nov 29 03:59:13 2017 -0500

    Define \__int_eval:n and \__dim_eval:n, they reduce the need for patching
    
    These internal commands are \etex_numexpr:D #1 \tex_relax:D (and dimexpr
    analogue) when there is no debugging, and do the appropriate checks otherwise.
    They are also more compact than \__int_eval:w ... \__int_eval_end:.


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

80d2fb424dd87262f02a78a48e245bccd2934a44
 l3experimental/xcoffins/xcoffins.dtx        |    2 +-
 l3experimental/xgalley/l3galley.dtx         |   60 ++++++++---------
 l3kernel/expl3.dtx                          |   11 ++--
 l3kernel/l3basics.dtx                       |    2 +-
 l3kernel/l3box.dtx                          |   94 ++++++++-------------------
 l3kernel/l3candidates.dtx                   |   28 ++++----
 l3kernel/l3drivers.dtx                      |    2 +-
 l3kernel/l3int.dtx                          |   21 ++++++
 l3kernel/l3prg.dtx                          |    3 +-
 l3kernel/l3regex.dtx                        |   20 +++---
 l3kernel/l3skip.dtx                         |   22 +++++++
 l3kernel/l3str.dtx                          |    5 +-
 l3kernel/l3token.dtx                        |   47 ++++----------
 l3kernel/testfiles/m3expl001.luatex.tlg     |    2 +
 l3kernel/testfiles/m3expl001.ptex.tlg       |    2 +
 l3kernel/testfiles/m3expl001.tlg            |    2 +
 l3kernel/testfiles/m3expl001.uptex.tlg      |    2 +
 l3kernel/testfiles/m3expl001.xetex.tlg      |    2 +
 l3kernel/testfiles/m3expl003.luatex.tlg     |    2 +
 l3kernel/testfiles/m3expl003.ptex.tlg       |    2 +
 l3kernel/testfiles/m3expl003.tlg            |    2 +
 l3kernel/testfiles/m3expl003.uptex.tlg      |    2 +
 l3kernel/testfiles/m3expl003.xetex.tlg      |    2 +
 l3packages/xfrac/xfrac.dtx                  |   23 +++----
 l3trial/l3auxdata/l3auxdata.dtx             |    9 +--
 l3trial/l3check/l3check.dtx                 |    4 +-
 l3trial/l3kernel-extras/l3kernel-extras.dtx |   16 ++---
 l3trial/xbox/testfiles/xbox000.tlg          |    6 +-
 l3trial/xbox/xbox.dtx                       |   21 +++---
 l3trial/xfont/xfss.dtx                      |    6 +-
 30 files changed, 201 insertions(+), 221 deletions(-)

diff --git a/l3experimental/xcoffins/xcoffins.dtx b/l3experimental/xcoffins/xcoffins.dtx
index 8197c78..91fde4e 100644
--- a/l3experimental/xcoffins/xcoffins.dtx
+++ b/l3experimental/xcoffins/xcoffins.dtx
@@ -894,7 +894,7 @@
 \NewDocumentCommand \CoffinHeight { m }
   { \coffin_ht:N #1 }
 \NewDocumentCommand \CoffinTotalHeight { m }
-  { \__dim_eval:w \coffin_ht:N #1 + \coffin_dp:N #1 \__dim_eval_end: }
+  { \__dim_eval:n { \coffin_ht:N #1 + \coffin_dp:N #1 } }
 \NewDocumentCommand \CoffinWidth { m }
   { \coffin_wd:N #1 }
 %    \end{macrocode}
diff --git a/l3experimental/xgalley/l3galley.dtx b/l3experimental/xgalley/l3galley.dtx
index f0969d9..9be31f7 100644
--- a/l3experimental/xgalley/l3galley.dtx
+++ b/l3experimental/xgalley/l3galley.dtx
@@ -1584,7 +1584,7 @@
       }
       {
         \tex_penalty:D
-          \__int_eval:w \g_@@_interpar_penalty_user_tl \__int_eval_end:
+          \__int_eval:n { \g_@@_interpar_penalty_user_tl }
         \tl_gclear:N \g_@@_interpar_penalty_user_tl
       }
     \bool_gset_false:N \g_galley_no_break_next_bool
@@ -1863,18 +1863,15 @@
 \cs_new_protected:Npn \@@_parshape_set_indents:NN #1#2
   {
     \tex_parshape:D
-      \__int_eval:w
-        \int_min:nn { \seq_count:N #1 } { \seq_count:N #2 }
-      \__int_eval_end:
+      \__int_eval:n
+        { \int_min:nn { \seq_count:N #1 } { \seq_count:N #2 } }
       \seq_mapthread_function:NNN #1 #2
         \@@_parshape_set_indents:nn
   }
 \cs_new:Npn \@@_parshape_set_indents:nn #1#2
   {
-    \__dim_eval:w \l_galley_total_left_margin_dim + ( #1 ) \__dim_eval_end:
-    \__dim_eval:w
-      \l_galley_text_width_dim - ( ( #1 ) + ( #2 ) )
-    \__dim_eval_end:
+    \__dim_eval:n { \l_galley_total_left_margin_dim + #1 }
+    \__dim_eval:n { \l_galley_text_width_dim - ( #1 + #2 ) }
   }
 %    \end{macrocode}
 %   Calculating cutouts is by far the most complex operation here. The
@@ -2228,7 +2225,7 @@
 \cs_new_protected:Npn \galley_display_widow_penalties_set:n #1
   {
     \etex_displaywidowpenalties:D
-      \__int_eval:w \clist_count:n {#1} + 1 \__int_eval_end:
+      \__int_eval:n { \clist_count:n {#1} + 1 }
       \clist_map_function:nN {#1} \@@_set_aux:n
       0 \exp_stop_f:
   }
@@ -2236,7 +2233,7 @@
 \cs_new_protected:Npn \galley_widow_penalties_set:n #1
   {
     \etex_widowpenalties:D
-      \__int_eval:w \clist_count:n {#1} + 1 \__int_eval_end:
+      \__int_eval:n { \clist_count:n {#1} + 1 }
       \clist_map_function:nN {#1} \@@_set_aux:n
       0 \exp_stop_f:
   }
@@ -2287,7 +2284,7 @@
 \cs_new_protected:Npn \galley_display_club_penalties_set:n #1
   {
     \etex_clubpenalties:D
-      \__int_eval:w \clist_count:n {#1} + 1 \__int_eval_end:
+      \__int_eval:n { \clist_count:n {#1} + 1 }
       \clist_map_function:nN {#1} \@@_set_aux:n
       0 \exp_stop_f:
     \@@_calc_interline_penalties:
@@ -2314,17 +2311,18 @@
   {
     \int_compare:nNnTF { \etex_interlinepenalties:D 0 } = 0
       {
-        \etex_interlinepenalties:D 1 = \__int_eval:w (#1) \__int_eval_end:
+        \etex_interlinepenalties:D 1 = \__int_eval:n {#1}
         \@@_calc_interline_penalties:
       }
       {
         \cs_set:Npn \@@_set_interline_penalty_auxii:n ##1
           {
-            \__int_eval:w
-              \etex_interlinepenalties:D ##1
-               - \etex_interlinepenalties:D \etex_interlinepenalties:D 0
-               + (#1)
-            \__int_eval_end:
+            \__int_eval:n
+              {
+                \etex_interlinepenalties:D ##1
+                - \etex_interlinepenalties:D \etex_interlinepenalties:D 0
+                + #1
+              }
           }
         \exp_args:Nf \@@_set_interline_penalty:nn
           { \clist_count:N \l_galley_line_penalties_clist } {#1}
@@ -2339,10 +2337,10 @@
       \int_step_function:nnnN { #1 + 1 } { 1 }
         { \etex_interlinepenalties:D 0 - 1 }
         \@@_set_interline_penalty_auxii:n
-      \__int_eval:w (#2) \__int_eval_end:
+      \__int_eval:n {#2}
   }
 \cs_new:Npn \@@_set_interline_penalty_auxi:n #1
-  { \etex_interlinepenalties:D \__int_eval:w #1 \__int_eval_end: }
+  { \etex_interlinepenalties:D \__int_eval:n {#1} }
 \cs_new:Npn \@@_set_interline_penalty_auxii:n #1 { }
 %    \end{macrocode}
 % \end{macro}
@@ -2394,19 +2392,21 @@
   }
 \cs_new:Npn \@@_calc_interline_penalties_auxi:n #1
   {
-    \__int_eval:w
+    \__int_eval:n
+      {
         \clist_item:Nn \l_galley_line_penalties_clist {#1}
-      + 0 \clist_item:Nn \l_galley_club_penalties_clist {#1}
-      - \etex_clubpenalties:D #1 ~
-    \__int_eval_end:
+        + 0 \clist_item:Nn \l_galley_club_penalties_clist {#1}
+        - \etex_clubpenalties:D #1 ~
+      }
   }
 \cs_new:Npn \@@_calc_interline_penalties_auxii:n #1
   {
-    \__int_eval:w
+    \__int_eval:n
+      {
         \etex_interlinepenalties:D \etex_interlinepenalties:D 0 \exp_stop_f:
-      + 0 \clist_item:Nn \l_galley_club_penalties_clist {#1}
-      - \etex_clubpenalties:D #1 ~
-    \__int_eval_end:
+        + 0 \clist_item:Nn \l_galley_club_penalties_clist {#1}
+        - \etex_clubpenalties:D #1 ~
+      }
   }
 %    \end{macrocode}
 % \end{macro}
@@ -2449,7 +2449,7 @@
       }
   }
 \cs_new:Npn \@@_save_display_club_penalties:n #1
-  { \__int_value:w \etex_clubpenalties:D \__int_eval:w #1 \__int_eval_end: , }
+  { \__int_value:w \etex_clubpenalties:D \__int_eval:n {#1} , }
 \cs_new_protected:Npn \galley_save_display_widow_penalties:N #1
   {
     \clist_set:Nx #1
@@ -2462,7 +2462,7 @@
 \cs_new:Npn \@@_save_display_widow_penalties:n #1
   {
     \__int_value:w \etex_displaywidowpenalties:D
-      \__int_eval:w #1 \__int_eval_end: ,
+      \__int_eval:n {#1} ,
   }
 \cs_new_protected:Npn \galley_save_widow_penalties:N #1
   {
@@ -2474,7 +2474,7 @@
       }
   }
 \cs_new:Npn \@@_save_widow_penalties:n #1
-  { \__int_value:w \etex_widowpenalties:D \__int_eval:w #1 \__int_eval_end: , }
+  { \__int_value:w \etex_widowpenalties:D \__int_eval:n {#1} , }
 %    \end{macrocode}
 %   This one is not an array, but is stored in a primitive, so there is
 %   a simple conversion. The general interline penalty is always the
diff --git a/l3kernel/expl3.dtx b/l3kernel/expl3.dtx
index 886bb3c..bbb283d 100644
--- a/l3kernel/expl3.dtx
+++ b/l3kernel/expl3.dtx
@@ -1467,32 +1467,29 @@
       }
     \cs_set_protected:Npn \box_rotate:Nn #1#2
       { \hbox_set:Nn #1 { \rotatebox {#2} { \box_use:N #1 } } }
-    \__debug_patch_args:nNNpn { {#1} { (#2) } { (#3) } }
     \cs_set_protected:Npn \box_resize_to_wd_and_ht_plus_dp:Nnn #1#2#3
       {
         \hbox_set:Nn #1
           {
             \resizebox *
-              { \__dim_eval:w #2 \__dim_eval_end: }
-              { \__dim_eval:w #3 \__dim_eval_end: }
+              { \__dim_eval:n {#2} }
+              { \__dim_eval:n {#3} }
               { \box_use:N #1 }
           }
       }
-    \__debug_patch_args:nNNpn { {#1} { (#2) } }
     \cs_set_protected:Npn \box_resize_to_ht_plus_dp:Nn #1#2
       {
         \hbox_set:Nn #1
           {
-            \resizebox * { ! } { \__dim_eval:w #2 \__dim_eval_end: }
+            \resizebox * { ! } { \__dim_eval:n {#2} }
               { \box_use:N #1 }
           }
       }
-    \__debug_patch_args:nNNpn { {#1} { (#2) } }
     \cs_set_protected:Npn \box_resize_to_wd:Nn #1#2
       {
         \hbox_set:Nn #1
           {
-            \resizebox * { \__dim_eval:w #2 \__dim_eval_end: } { ! }
+            \resizebox * { \__dim_eval:n {#2} } { ! }
               { \box_use:N #1 }
           }
       }
diff --git a/l3kernel/l3basics.dtx b/l3kernel/l3basics.dtx
index c38a89d..0be9342 100644
--- a/l3kernel/l3basics.dtx
+++ b/l3kernel/l3basics.dtx
@@ -3149,7 +3149,7 @@
     \exp_args:Nx \@@_parm_from_arg_count_test:nnF
       {
         \exp_after:wN \exp_not:n
-        \if_case:w \__int_eval:w (#2) \__int_eval_end:
+        \if_case:w \__int_eval:n {#2}
              { }
         \or: { ##1 }
         \or: { ##1##2 }
diff --git a/l3kernel/l3box.dtx b/l3kernel/l3box.dtx
index e8e19f8..099d1b5 100644
--- a/l3kernel/l3box.dtx
+++ b/l3kernel/l3box.dtx
@@ -977,15 +977,12 @@
 %   When debugging, the dimension expression |#2| is surrounded by
 %   parentheses to catch early termination.
 %    \begin{macrocode}
-\__debug_patch_args:nNNpn { {#1} { (#2) } }
 \cs_new_protected:Npn \box_set_dp:Nn #1#2
-  { \box_dp:N #1 \__dim_eval:w #2 \__dim_eval_end: }
-\__debug_patch_args:nNNpn { {#1} { (#2) } }
+  { \box_dp:N #1 \__dim_eval:n {#2} }
 \cs_new_protected:Npn \box_set_ht:Nn #1#2
-  { \box_ht:N #1 \__dim_eval:w #2 \__dim_eval_end: }
-\__debug_patch_args:nNNpn { {#1} { (#2) } }
+  { \box_ht:N #1 \__dim_eval:n {#2} }
 \cs_new_protected:Npn \box_set_wd:Nn #1#2
-  { \box_wd:N #1 \__dim_eval:w #2 \__dim_eval_end: }
+  { \box_wd:N #1 \__dim_eval:n {#2} }
 \cs_generate_variant:Nn \box_set_ht:Nn { c }
 \cs_generate_variant:Nn \box_set_dp:Nn { c }
 \cs_generate_variant:Nn \box_set_wd:Nn { c }
@@ -1016,18 +1013,14 @@
 %   When debugging, the dimension expression |#1| is surrounded by
 %   parentheses to catch early termination.
 %    \begin{macrocode}
-\__debug_patch_args:nNNpn { { (#1) } {#2} }
 \cs_new_protected:Npn \box_move_left:nn #1#2
-  { \tex_moveleft:D \__dim_eval:w #1 \__dim_eval_end: #2 }
-\__debug_patch_args:nNNpn { { (#1) } {#2} }
+  { \tex_moveleft:D \__dim_eval:n {#1} #2 }
 \cs_new_protected:Npn \box_move_right:nn #1#2
-  { \tex_moveright:D \__dim_eval:w #1 \__dim_eval_end: #2 }
-\__debug_patch_args:nNNpn { { (#1) } {#2} }
+  { \tex_moveright:D \__dim_eval:n {#1} #2 }
 \cs_new_protected:Npn \box_move_up:nn #1#2
-  { \tex_raise:D \__dim_eval:w #1 \__dim_eval_end: #2 }
-\__debug_patch_args:nNNpn { { (#1) } {#2} }
+  { \tex_raise:D \__dim_eval:n {#1} #2 }
 \cs_new_protected:Npn \box_move_down:nn #1#2
-  { \tex_lower:D \__dim_eval:w #1 \__dim_eval_end: #2 }
+  { \tex_lower:D \__dim_eval:n {#1} #2 }
 %    \end{macrocode}
 % \end{macro}
 % \end{macro}
@@ -1229,23 +1222,16 @@
 %   Storing material in a horizontal box with a specified width.
 %   Again, put the dimension expression in parentheses when debugging.
 %    \begin{macrocode}
-\__debug_patch_args:nnnNNpn
-  { \__debug_chk_var_local:N #1 }
-  { }
-  { {#1} { (#2) } {#3} }
+\__debug_patch:nnNNpn { \__debug_chk_var_local:N #1 } { }
 \cs_new_protected:Npn \hbox_set_to_wd:Nnn #1#2#3
   {
-    \tex_setbox:D #1 \tex_hbox:D to \__dim_eval:w #2 \__dim_eval_end:
+    \tex_setbox:D #1 \tex_hbox:D to \__dim_eval:n {#2}
       { \group_begin: #3 \group_end: }
   }
-\__debug_patch_args:nnnNNpn
-  { \__debug_chk_var_global:N #1 }
-  { }
-  { {#1} { (#2) } {#3} }
+\__debug_patch:nnNNpn { \__debug_chk_var_global:N #1 } { }
 \cs_new_protected:Npn \hbox_gset_to_wd:Nnn #1#2#3
   {
-    \tex_global:D \tex_setbox:D #1 \tex_hbox:D
-      to \__dim_eval:w #2 \__dim_eval_end:
+    \tex_global:D \tex_setbox:D #1 \tex_hbox:D to \__dim_eval:n {#2}
       { \group_begin: #3 \group_end: }
   }
 \cs_generate_variant:Nn \hbox_set_to_wd:Nnn { c }
@@ -1292,24 +1278,17 @@
 % \begin{macro}{\hbox_gset_to_wd:Nnw, \hbox_gset_to_wd:cnw}
 %   Combining the above ideas.
 %    \begin{macrocode}
-\__debug_patch_args:nnnNNpn
-  { \__debug_chk_var_local:N #1 }
-  { }
-  { {#1} { (#2) } }
+\__debug_patch:nnNNpn { \__debug_chk_var_local:N #1 } { }
 \cs_new_protected:Npn \hbox_set_to_wd:Nnw #1#2
   {
-    \tex_setbox:D #1 \tex_hbox:D to \__dim_eval:w #2 \__dim_eval_end:
+    \tex_setbox:D #1 \tex_hbox:D to \__dim_eval:n {#2}
       \c_group_begin_token
         \group_begin:
   }
-\__debug_patch_args:nnnNNpn
-  { \__debug_chk_var_global:N #1 }
-  { }
-  { {#1} { (#2) } }
+\__debug_patch:nnNNpn { \__debug_chk_var_global:N #1 } { }
 \cs_new_protected:Npn \hbox_gset_to_wd:Nnw #1#2
   {
-    \tex_global:D \tex_setbox:D #1 \tex_hbox:D
-      to \__dim_eval:w #2 \__dim_eval_end:
+    \tex_global:D \tex_setbox:D #1 \tex_hbox:D to \__dim_eval:n {#2}
       \c_group_begin_token
         \group_begin:
   }
@@ -1324,10 +1303,9 @@
 %  \testfile*
 %   Put a horizontal box directly into the input stream.
 %    \begin{macrocode}
-\__debug_patch_args:nNNpn { { (#1) } {#2} }
 \cs_new_protected:Npn \hbox_to_wd:nn #1#2
    {
-     \tex_hbox:D to \__dim_eval:w #1 \__dim_eval_end:
+     \tex_hbox:D to \__dim_eval:n {#1}
        { \group_begin: #2 \group_end: }
    }
 \cs_new_protected:Npn \hbox_to_zero:n #1
@@ -1385,10 +1363,9 @@
 % \testfile*
 %   Put a vertical box directly into the input stream.
 %    \begin{macrocode}
-\__debug_patch_args:nNNpn { { (#1) } {#2} }
 \cs_new_protected:Npn \vbox_to_ht:nn #1#2
   {
-    \tex_vbox:D to \__dim_eval:w #1 \__dim_eval_end:
+    \tex_vbox:D to \__dim_eval:n {#1}
       { \group_begin: #2 \par \group_end: }
   }
 \cs_new_protected:Npn \vbox_to_zero:n #1
@@ -1452,23 +1429,16 @@
 %  \testfile*
 %  Storing material in a vertical box with a specified height.
 %    \begin{macrocode}
-\__debug_patch_args:nnnNNpn
-  { \__debug_chk_var_local:N #1 }
-  { }
-  { {#1} { (#2) } {#3} }
+\__debug_patch:nnNNpn { \__debug_chk_var_local:N #1 } { }
 \cs_new_protected:Npn \vbox_set_to_ht:Nnn #1#2#3
   {
-    \tex_setbox:D #1 \tex_vbox:D to \__dim_eval:w #2 \__dim_eval_end:
+    \tex_setbox:D #1 \tex_vbox:D to \__dim_eval:n {#2}
       { \group_begin: #3 \par \group_end: }
   }
-\__debug_patch_args:nnnNNpn
-  { \__debug_chk_var_global:N #1 }
-  { }
-  { {#1} { (#2) } {#3} }
+\__debug_patch:nnNNpn { \__debug_chk_var_global:N #1 } { }
 \cs_new_protected:Npn \vbox_gset_to_ht:Nnn #1#2#3
   {
-    \tex_global:D \tex_setbox:D #1 \tex_vbox:D
-      to \__dim_eval:w #2 \__dim_eval_end:
+    \tex_global:D \tex_setbox:D #1 \tex_vbox:D to \__dim_eval:n {#2}
       { \group_begin: #3 \par \group_end: }
   }
 \cs_generate_variant:Nn \vbox_set_to_ht:Nnn  { c }
@@ -1516,24 +1486,17 @@
 % \begin{macro}{\vbox_gset_to_ht:Nnw, \vbox_gset_to_ht:cnw}
 %   A combination of the above ideas.
 %    \begin{macrocode}
-\__debug_patch_args:nnnNNpn
-  { \__debug_chk_var_local:N #1 }
-  { }
-  { {#1} { (#2) } }
+\__debug_patch:nnNNpn { \__debug_chk_var_local:N #1 } { }
 \cs_new_protected:Npn \vbox_set_to_ht:Nnw #1#2
   {
-    \tex_setbox:D #1 \tex_vbox:D to \__dim_eval:w #2 \__dim_eval_end:
+    \tex_setbox:D #1 \tex_vbox:D to \__dim_eval:n {#2}
       \c_group_begin_token
         \group_begin:
   }
-\__debug_patch_args:nnnNNpn
-  { \__debug_chk_var_global:N #1 }
-  { }
-  { {#1} { (#2) } }
+\__debug_patch:nnNNpn { \__debug_chk_var_global:N #1 } { }
 \cs_new_protected:Npn \vbox_gset_to_ht:Nnw #1#2
   {
-    \tex_global:D \tex_setbox:D #1 \tex_vbox:D
-      to \__dim_eval:w #2 \__dim_eval_end:
+    \tex_global:D \tex_setbox:D #1 \tex_vbox:D to \__dim_eval:n {#2}
       \c_group_begin_token
         \group_begin:
   }
@@ -1560,12 +1523,9 @@
 % \testfile*
 %   Splitting a vertical box in two.
 %    \begin{macrocode}
-\__debug_patch_args:nnnNNpn
-  { \__debug_chk_var_local:N #1 }
-  { }
-  { {#1} {#2} { (#3) } }
+\__debug_patch:nnNNpn { \__debug_chk_var_local:N #1 } { }
 \cs_new_protected:Npn \vbox_set_split_to_ht:NNn #1#2#3
-  { \tex_setbox:D #1 \tex_vsplit:D #2 to \__dim_eval:w #3 \__dim_eval_end: }
+  { \tex_setbox:D #1 \tex_vsplit:D #2 to \__dim_eval:n {#3} }
 %    \end{macrocode}
 % \end{macro}
 %
diff --git a/l3kernel/l3candidates.dtx b/l3kernel/l3candidates.dtx
index fb2bbfb..6a52f2c 100644
--- a/l3kernel/l3candidates.dtx
+++ b/l3kernel/l3candidates.dtx
@@ -1091,14 +1091,13 @@
 %   Trimming from the left- and right-hand edges of the box is easy: kern the
 %   appropriate parts off each side.
 %    \begin{macrocode}
-\__debug_patch_args:nNNpn { {#1} { (#2) } {#3} { (#4) } {#5} }
 \cs_new_protected:Npn \box_trim:Nnnnn #1#2#3#4#5
   {
     \hbox_set:Nn \l_@@_internal_box
       {
-        \tex_kern:D -\__dim_eval:w #2 \__dim_eval_end:
+        \tex_kern:D - \__dim_eval:n {#2}
         \box_use:N #1
-        \tex_kern:D -\__dim_eval:w #4 \__dim_eval_end:
+        \tex_kern:D - \__dim_eval:n {#4}
       }
 %    \end{macrocode}
 %   For the height and depth, there is a need to watch the baseline is
@@ -1158,14 +1157,13 @@
 %   dimensions. As a result, there are some things to watch out for in the
 %   vertical direction.
 %    \begin{macrocode}
-\__debug_patch_args:nNNpn { {#1} { (#2) } {#3} { (#4) } {#5} }
 \cs_new_protected:Npn \box_viewport:Nnnnn #1#2#3#4#5
   {
     \hbox_set:Nn \l_@@_internal_box
       {
-        \tex_kern:D -\__dim_eval:w #2 \__dim_eval_end:
+        \tex_kern:D - \__dim_eval:n {#2}
         \box_use:N #1
-        \tex_kern:D \__dim_eval:w #4 - \box_wd:N #1 \__dim_eval_end:
+        \tex_kern:D \__dim_eval:n { #4 - \box_wd:N #1 }
       }
     \dim_compare:nNnTF {#3} < \c_zero_dim
       {
@@ -1174,7 +1172,7 @@
             \box_move_down:nn \c_zero_dim
               { \box_use:N \l_@@_internal_box }
           }
-        \box_set_dp:Nn \l_@@_internal_box { -\dim_eval:n {#3} }
+        \box_set_dp:Nn \l_@@_internal_box { - \__dim_eval:n {#3} }
       }
       {
         \hbox_set:Nn \l_@@_internal_box
@@ -1198,7 +1196,7 @@
       {
         \hbox_set:Nn \l_@@_internal_box
           {
-            \box_move_up:nn { -\dim_eval:n {#5} }
+            \box_move_up:nn { - \__dim_eval:n {#5} }
               { \box_use:N \l_@@_internal_box }
           }
         \box_set_ht:Nn \l_@@_internal_box \c_zero_dim
@@ -1338,9 +1336,8 @@
     \hbox_set:Nn \l_@@_internal_box
       {
         \tex_kern:D
-          \__dim_eval:w
-            \l_@@_bounding_shift_dim - \l_@@_left_corner_dim
-          \__dim_eval_end:
+          \__dim_eval:n
+            { \l_@@_bounding_shift_dim - \l_@@_left_corner_dim }
         \box_move_down:nn { \l_@@_bottom_corner_dim }
           { \box_use:N #1 }
       }
@@ -1857,7 +1854,11 @@
 %    \begin{macrocode}
 \cs_if_exist:NTF \pdftex_uniformdeviate:D
   {
-    \__debug_patch_args:nNNpn { { (#1) } { (#2) } }
+    \__debug_patch_args:nNNpn
+      {
+        { \__debug_chk_expr:nNnN {#1} \@@_eval:w { } \int_rand:nn }
+        { \__debug_chk_expr:nNnN {#2} \@@_eval:w { } \int_rand:nn }
+      }
     \cs_new:Npn \int_rand:nn #1#2
       {
         \exp_after:wN \@@_rand:ww
@@ -2261,9 +2262,8 @@
 % \begin{macro}{\sys_gset_rand_seed:n}
 %   The primitive always assigns the seed globally.
 %    \begin{macrocode}
-\__debug_patch_args:nNNpn { { (#1) } }
 \cs_new_protected:Npn \sys_gset_rand_seed:n #1
-  { \pdftex_setrandomseed:D \__int_eval:w #1 \__int_eval_end: }
+  { \pdftex_setrandomseed:D \__int_eval:n {#1} }
 %    \end{macrocode}
 % \end{macro}
 %
diff --git a/l3kernel/l3drivers.dtx b/l3kernel/l3drivers.dtx
index 7c8e431..017f8f6 100644
--- a/l3kernel/l3drivers.dtx
+++ b/l3kernel/l3drivers.dtx
@@ -2239,7 +2239,7 @@
   {
     \hbox_set:Nn \l_@@_tmp_box
       {
-        \tex_kern:D \__dim_eval:w #6 \__dim_eval_end:
+        \tex_kern:D \__dim_eval:n {#6}
         \@@_scope_begin:
         \@@_draw_transformcm:nnnnnn {#2} {#3} {#4} {#5}
           { 0pt } { 0pt }
diff --git a/l3kernel/l3int.dtx b/l3kernel/l3int.dtx
index 755c673..ab18ac0 100644
--- a/l3kernel/l3int.dtx
+++ b/l3kernel/l3int.dtx
@@ -958,6 +958,16 @@
 %   \end{texnote}
 % \end{function}
 %
+% \begin{function}[EXP]{\__int_eval:n}
+%   \begin{syntax}
+%     \cs{__int_eval:n} \Arg{intexpr}
+%   \end{syntax}
+%   By default this expands to \cs{__int_eval:w} \meta{intexpr}
+%   \cs{__int_eval_end:} but when debugging is enabled this expands to a
+%   more complicated construction that evaluates \meta{intexpr} with
+%   parentheses and within a brace group to detect early termination.
+% \end{function}
+%
 % \begin{function}{\__prg_compare_error:, \__prg_compare_error:Nw}
 %   \begin{syntax}
 %     \cs{__prg_compare_error:}
@@ -1032,6 +1042,17 @@
 %    \end{macrocode}
 % \end{macro}
 %
+% \begin{macro}{\@@_eval:n}
+%   Only differ from \cs{int_eval:n} by the absence of \cs{@@_value:w},
+%   so as to produce an internal integer rather than expanding into
+%   characters.  This is for use in other modules.
+%    \begin{macrocode}
+\__debug_patch_args:nNNpn
+  { { \__debug_chk_expr:nNnN {#1} \@@_eval:w { } \@@_eval:n } }
+\cs_new:Npn \@@_eval:n #1 { \@@_eval:w #1 \@@_eval_end: }
+%    \end{macrocode}
+% \end{macro}
+%
 % \begin{macro}[EXP]{\int_abs:n}
 % \begin{macro}[aux, EXP]{\@@_abs:N}
 % \UnitTested
diff --git a/l3kernel/l3prg.dtx b/l3kernel/l3prg.dtx
index ab3fce8..348de86 100644
--- a/l3kernel/l3prg.dtx
+++ b/l3kernel/l3prg.dtx
@@ -1384,12 +1384,11 @@
 %   pool. Also, it is considerably slower than what we use here so the
 %   few extra csnames are well spent I would say.
 %    \begin{macrocode}
-\__debug_patch_args:nNNpn { { (#1) } }
 \cs_new:Npn \prg_replicate:nn #1
   {
     \exp:w
       \exp_after:wN \@@_replicate_first:N
-        \__int_value:w \__int_eval:w #1 \__int_eval_end:
+        \__int_value:w \__int_eval:n {#1}
       \cs_end:
   }
 \cs_new:Npn \@@_replicate:N #1
diff --git a/l3kernel/l3regex.dtx b/l3kernel/l3regex.dtx
index 1d9b421..10cc96f 100644
--- a/l3kernel/l3regex.dtx
+++ b/l3kernel/l3regex.dtx
@@ -1227,7 +1227,7 @@
   }
 \cs_new_protected:Npn \@@_item_catcode:nT #1
   {
-    \if_int_odd:w \__int_eval:w #1 / \@@_item_catcode: \__int_eval_end:
+    \if_int_odd:w \__int_eval:n { #1 / \@@_item_catcode: }
       \exp_after:wN \use:n
     \else:
       \exp_after:wN \use_none:n
@@ -1665,9 +1665,8 @@
     \if_int_compare:w 1 < "1 \token_to_str:N #1 \exp_stop_f:
       #1 \prg_return_true:
     \else:
-      \if_case:w \__int_eval:w
-          \exp_after:wN ` \token_to_str:N #1 - `a
-        \__int_eval_end:
+      \if_case:w
+        \__int_eval:n { \exp_after:wN ` \token_to_str:N #1 - `a }
            A
       \or: B
       \or: C
@@ -3097,7 +3096,7 @@
   }
 \cs_new_protected:Npn \@@_compile_c_lbrack_add:N #1
   {
-    \if_int_odd:w \__int_eval:w \l_@@_catcodes_int / #1 \__int_eval_end:
+    \if_int_odd:w \__int_eval:n { \l_@@_catcodes_int / #1 }
     \else:
       \int_add:Nn \l_@@_catcodes_int {#1}
     \fi:
@@ -4095,7 +4094,7 @@
       \l_@@_right_state_int \l_@@_max_state_int
     \int_set_eq:NN \l_@@_internal_a_int \l_@@_left_state_int
     \int_set_eq:NN \l_@@_internal_b_int \l_@@_max_state_int
-    \if_int_compare:w \__int_eval:w #1 > 1 \exp_stop_f:
+    \if_int_compare:w \__int_eval:n {#1} > 1 \exp_stop_f:
       \int_set:Nn \l_@@_internal_c_int
         {
           ( #1 - 1 )
@@ -4825,7 +4824,7 @@
 \cs_new_protected:Npn \@@_action_cost:n #1
   {
     \exp_args:No \@@_store_state:n
-      { \__int_value:w \__int_eval:w \l_@@_curr_state_int + #1 }
+      { \__int_value:w \__int_eval:n { \l_@@_curr_state_int + #1 } }
   }
 %    \end{macrocode}
 % \end{macro}
@@ -5047,7 +5046,8 @@
 %    \begin{macrocode}
 \cs_new_protected:Npn \@@_submatch_balance:n #1
   {
-    \__int_eval:w
+    \__int_eval:n
+     {
       \int_compare:nNnTF
         { \__intarray_item_fast:Nn \g_@@_submatch_end_intarray {#1} } = 0
         { 0 }
@@ -5063,7 +5063,7 @@
           \__intarray_item_fast:Nn \g_@@_balance_intarray
             { \__intarray_item_fast:Nn \g_@@_submatch_begin_intarray {#1} }
         }
-    \__int_eval_end:
+     }
   }
 %    \end{macrocode}
 % \end{macro}
@@ -5207,7 +5207,7 @@
       \__tl_build_one:n { \@@_query_submatch:n { #1 + ##1 } }
       \if_int_compare:w \l_@@_replacement_csnames_int = 0 \exp_stop_f:
         \tl_put_right:Nn \l_@@_balance_tl
-          { + \@@_submatch_balance:n { \__int_eval:w #1+##1 \__int_eval_end: } }
+          { + \@@_submatch_balance:n { \__int_eval:n { #1+##1 } } }
       \fi:
     \fi:
   }
diff --git a/l3kernel/l3skip.dtx b/l3kernel/l3skip.dtx
index 15b15d6..10a1592 100644
--- a/l3kernel/l3skip.dtx
+++ b/l3kernel/l3skip.dtx
@@ -1011,6 +1011,16 @@
 %   \end{texnote}
 % \end{function}
 %
+% \begin{function}[EXP]{\__dim_eval:n}
+%   \begin{syntax}
+%     \cs{__dim_eval:n} \Arg{dimexpr}
+%   \end{syntax}
+%   By default this expands to \cs{__dim_eval:w} \meta{dimexpr}
+%   \cs{__dim_eval_end:} but when debugging is enabled this expands to a
+%   more complicated construction that evaluates \meta{dimexpr} with
+%   parentheses and within a brace group to detect early termination.
+% \end{function}
+%
 % \end{documentation}
 %
 % \begin{implementation}
@@ -1500,6 +1510,18 @@
 %    \end{macrocode}
 % \end{macro}
 %
+% \begin{macro}{\@@_eval:n}
+%   Evaluating a dimension expression expandably.  This is for use in
+%   other modules, to avoid having to patch many commands.  The only
+%   difference with \cs{dim_eval:n} is the lack of \cs{dim_use:N}, to
+%   produce an internal dimension rather than expand it into characters.
+%    \begin{macrocode}
+\__debug_patch_args:nNNpn
+  { { \__debug_chk_expr:nNnN {#1} \@@_eval:w { } \@@_eval:n } }
+\cs_new:Npn \@@_eval:n #1 { \@@_eval:w #1 \@@_eval_end: }
+%    \end{macrocode}
+% \end{macro}
+%
 % \begin{macro}{\dim_use:N, \dim_use:c}
 %   Accessing a \meta{dim}.
 %    \begin{macrocode}
diff --git a/l3kernel/l3str.dtx b/l3kernel/l3str.dtx
index a8053af..c4dd39f 100644
--- a/l3kernel/l3str.dtx
+++ b/l3kernel/l3str.dtx
@@ -1500,7 +1500,7 @@
   }
 \cs_new:Npn \str_item_ignore_spaces:nn #1
   { \exp_args:No \@@_item:nn { \tl_to_str:n {#1} } }
-\__debug_patch_args:nNNpn { {#1} { (#2) } }
+\__debug_patch_args:nNNpn { {#1} { \__int_eval:n {#2} } }
 \cs_new:Npn \@@_item:nn #1#2
   {
     \exp_after:wN \@@_item:w
@@ -1597,7 +1597,8 @@
   }
 \cs_new:Npn \str_range_ignore_spaces:nnn #1
   { \exp_args:No \@@_range:nnn { \tl_to_str:n {#1} } }
-\__debug_patch_args:nNNpn { {#1} { (#2) } { (#3) } }
+\__debug_patch_args:nNNpn
+  { {#1} { \__int_eval:n {#2} } { \__int_eval:n {#3} } }
 \cs_new:Npn \@@_range:nnn #1#2#3
   {
     \exp_after:wN \@@_range:w
diff --git a/l3kernel/l3token.dtx b/l3kernel/l3token.dtx
index 34c0312..db27cf8 100644
--- a/l3kernel/l3token.dtx
+++ b/l3kernel/l3token.dtx
@@ -1136,15 +1136,10 @@
 % \begin{macro}{\char_show_value_catcode:n}
 %   Simple wrappers around the primitives.
 %    \begin{macrocode}
-\__debug_patch_args:nNNpn { { (#1) } { (#2) } }
 \cs_new_protected:Npn \char_set_catcode:nn #1#2
-  {
-    \tex_catcode:D \__int_eval:w #1 \__int_eval_end:
-      = \__int_eval:w #2 \__int_eval_end:
-  }
-\__debug_patch_args:nNNpn { { (#1) } }
+  { \tex_catcode:D \__int_eval:n {#1} = \__int_eval:n {#2} }
 \cs_new:Npn \char_value_catcode:n #1
-  { \tex_the:D \tex_catcode:D \__int_eval:w #1 \__int_eval_end: }
+  { \tex_the:D \tex_catcode:D \__int_eval:n {#1} }
 \cs_new_protected:Npn \char_show_value_catcode:n #1
   { \__msg_show_wrap:n { > ~ \char_value_catcode:n {#1} } }
 %    \end{macrocode}
@@ -1276,48 +1271,28 @@
 % \begin{macro}{\char_show_value_sfcode:n}
 %   Pretty repetitive, but necessary!
 %    \begin{macrocode}
-\__debug_patch_args:nNNpn { { (#1) } { (#2) } }
 \cs_new_protected:Npn \char_set_mathcode:nn #1#2
-  {
-    \tex_mathcode:D \__int_eval:w #1 \__int_eval_end:
-    = \__int_eval:w #2 \__int_eval_end:
-  }
-\__debug_patch_args:nNNpn { { (#1) } }
+  { \tex_mathcode:D \__int_eval:n {#1} = \__int_eval:n {#2} }
 \cs_new:Npn \char_value_mathcode:n #1
-  { \tex_the:D \tex_mathcode:D \__int_eval:w #1 \__int_eval_end: }
+  { \tex_the:D \tex_mathcode:D \__int_eval:n {#1} }
 \cs_new_protected:Npn \char_show_value_mathcode:n #1
   { \__msg_show_wrap:n { > ~ \char_value_mathcode:n {#1} } }
-\__debug_patch_args:nNNpn { { (#1) } { (#2) } }
 \cs_new_protected:Npn \char_set_lccode:nn #1#2
-  {
-    \tex_lccode:D \__int_eval:w #1 \__int_eval_end:
-    = \__int_eval:w #2 \__int_eval_end:
-  }
-\__debug_patch_args:nNNpn { { (#1) } }
+  { \tex_lccode:D \__int_eval:n {#1} = \__int_eval:n {#2} }
 \cs_new:Npn \char_value_lccode:n #1
-  { \tex_the:D \tex_lccode:D \__int_eval:w #1 \__int_eval_end: }
+  { \tex_the:D \tex_lccode:D \__int_eval:n {#1} }
 \cs_new_protected:Npn \char_show_value_lccode:n #1
   { \__msg_show_wrap:n { > ~ \char_value_lccode:n {#1} } }
-\__debug_patch_args:nNNpn { { (#1) } { (#2) } }
 \cs_new_protected:Npn \char_set_uccode:nn #1#2
-  {
-    \tex_uccode:D \__int_eval:w #1 \__int_eval_end:
-    = \__int_eval:w #2 \__int_eval_end:
-  }
-\__debug_patch_args:nNNpn { { (#1) } }
+  { \tex_uccode:D \__int_eval:n {#1} = \__int_eval:n {#2} }
 \cs_new:Npn \char_value_uccode:n #1
-  { \tex_the:D \tex_uccode:D \__int_eval:w #1 \__int_eval_end: }
+  { \tex_the:D \tex_uccode:D \__int_eval:n {#1} }
 \cs_new_protected:Npn \char_show_value_uccode:n #1
   { \__msg_show_wrap:n { > ~ \char_value_uccode:n {#1} } }
-\__debug_patch_args:nNNpn { { (#1) } { (#2) } }
 \cs_new_protected:Npn \char_set_sfcode:nn #1#2
-  {
-    \tex_sfcode:D \__int_eval:w #1 \__int_eval_end:
-    = \__int_eval:w #2 \__int_eval_end:
-  }
-\__debug_patch_args:nNNpn { { (#1) } }
+  { \tex_sfcode:D \__int_eval:n {#1} = \__int_eval:n {#2} }
 \cs_new:Npn \char_value_sfcode:n #1
-  { \tex_the:D \tex_sfcode:D \__int_eval:w #1 \__int_eval_end: }
+  { \tex_the:D \tex_sfcode:D \__int_eval:n {#1} }
 \cs_new_protected:Npn \char_show_value_sfcode:n #1
   { \__msg_show_wrap:n { > ~ \char_value_sfcode:n {#1} } }
 %    \end{macrocode}
@@ -1400,7 +1375,7 @@
 %   the interface layer, turn the two arguments into integers up-front so
 %   this is only done once.
 %    \begin{macrocode}
-\__debug_patch_args:nNNpn { { (#1) } { (#2) } }
+\__debug_patch_args:nNNpn { { \__int_eval:n {#1} } { \__int_eval:n {#2} } }
 \cs_new:Npn \char_generate:nn #1#2
   {
     \exp:w \exp_after:wN \@@_generate_aux:w
diff --git a/l3kernel/testfiles/m3expl001.luatex.tlg b/l3kernel/testfiles/m3expl001.luatex.tlg
index b160a68..a6426c0 100644
--- a/l3kernel/testfiles/m3expl001.luatex.tlg
+++ b/l3kernel/testfiles/m3expl001.luatex.tlg
@@ -1516,6 +1516,7 @@ Defining \__int_eval_end: on line ...
 Defining \if_int_odd:w on line ...
 Defining \if_case:w on line ...
 Defining \int_eval:n on line ...
+Defining \__int_eval:n on line ...
 Defining \int_abs:n on line ...
 Defining \__int_abs:N on line ...
 Defining \__int_maxmin:wwN on line ...
@@ -3166,6 +3167,7 @@ Defining \dim_until_do:nNnn on line ...
 Defining \dim_do_while:nNnn on line ...
 Defining \dim_do_until:nNnn on line ...
 Defining \dim_eval:n on line ...
+Defining \__dim_eval:n on line ...
 Defining \dim_use:N on line ...
 Defining \dim_use:c on line ...
 Defining \dim_to_decimal:n on line ...
diff --git a/l3kernel/testfiles/m3expl001.ptex.tlg b/l3kernel/testfiles/m3expl001.ptex.tlg
index e0cf785..38a6e6b 100644
--- a/l3kernel/testfiles/m3expl001.ptex.tlg
+++ b/l3kernel/testfiles/m3expl001.ptex.tlg
@@ -1248,6 +1248,7 @@ Defining \__int_eval_end: on line ...
 Defining \if_int_odd:w on line ...
 Defining \if_case:w on line ...
 Defining \int_eval:n on line ...
+Defining \__int_eval:n on line ...
 Defining \int_abs:n on line ...
 Defining \__int_abs:N on line ...
 Defining \__int_maxmin:wwN on line ...
@@ -3154,6 +3155,7 @@ Defining \dim_until_do:nNnn on line ...
 Defining \dim_do_while:nNnn on line ...
 Defining \dim_do_until:nNnn on line ...
 Defining \dim_eval:n on line ...
+Defining \__dim_eval:n on line ...
 Defining \dim_use:N on line ...
 Defining \dim_use:c on line ...
 Defining \dim_to_decimal:n on line ...
diff --git a/l3kernel/testfiles/m3expl001.tlg b/l3kernel/testfiles/m3expl001.tlg
index ceb472f..feee5e3 100644
--- a/l3kernel/testfiles/m3expl001.tlg
+++ b/l3kernel/testfiles/m3expl001.tlg
@@ -1248,6 +1248,7 @@ Defining \__int_eval_end: on line ...
 Defining \if_int_odd:w on line ...
 Defining \if_case:w on line ...
 Defining \int_eval:n on line ...
+Defining \__int_eval:n on line ...
 Defining \int_abs:n on line ...
 Defining \__int_abs:N on line ...
 Defining \__int_maxmin:wwN on line ...
@@ -3154,6 +3155,7 @@ Defining \dim_until_do:nNnn on line ...
 Defining \dim_do_while:nNnn on line ...
 Defining \dim_do_until:nNnn on line ...
 Defining \dim_eval:n on line ...
+Defining \__dim_eval:n on line ...
 Defining \dim_use:N on line ...
 Defining \dim_use:c on line ...
 Defining \dim_to_decimal:n on line ...
diff --git a/l3kernel/testfiles/m3expl001.uptex.tlg b/l3kernel/testfiles/m3expl001.uptex.tlg
index f21ed1a..4ed2909 100644
--- a/l3kernel/testfiles/m3expl001.uptex.tlg
+++ b/l3kernel/testfiles/m3expl001.uptex.tlg
@@ -1248,6 +1248,7 @@ Defining \__int_eval_end: on line ...
 Defining \if_int_odd:w on line ...
 Defining \if_case:w on line ...
 Defining \int_eval:n on line ...
+Defining \__int_eval:n on line ...
 Defining \int_abs:n on line ...
 Defining \__int_abs:N on line ...
 Defining \__int_maxmin:wwN on line ...
@@ -3154,6 +3155,7 @@ Defining \dim_until_do:nNnn on line ...
 Defining \dim_do_while:nNnn on line ...
 Defining \dim_do_until:nNnn on line ...
 Defining \dim_eval:n on line ...
+Defining \__dim_eval:n on line ...
 Defining \dim_use:N on line ...
 Defining \dim_use:c on line ...
 Defining \dim_to_decimal:n on line ...
diff --git a/l3kernel/testfiles/m3expl001.xetex.tlg b/l3kernel/testfiles/m3expl001.xetex.tlg
index 4497478..8d859a3 100644
--- a/l3kernel/testfiles/m3expl001.xetex.tlg
+++ b/l3kernel/testfiles/m3expl001.xetex.tlg
@@ -1514,6 +1514,7 @@ Defining \__int_eval_end: on line ...
 Defining \if_int_odd:w on line ...
 Defining \if_case:w on line ...
 Defining \int_eval:n on line ...
+Defining \__int_eval:n on line ...
 Defining \int_abs:n on line ...
 Defining \__int_abs:N on line ...
 Defining \__int_maxmin:wwN on line ...
@@ -3164,6 +3165,7 @@ Defining \dim_until_do:nNnn on line ...
 Defining \dim_do_while:nNnn on line ...
 Defining \dim_do_until:nNnn on line ...
 Defining \dim_eval:n on line ...
+Defining \__dim_eval:n on line ...
 Defining \dim_use:N on line ...
 Defining \dim_use:c on line ...
 Defining \dim_to_decimal:n on line ...
diff --git a/l3kernel/testfiles/m3expl003.luatex.tlg b/l3kernel/testfiles/m3expl003.luatex.tlg
index b160a68..a6426c0 100644
--- a/l3kernel/testfiles/m3expl003.luatex.tlg
+++ b/l3kernel/testfiles/m3expl003.luatex.tlg
@@ -1516,6 +1516,7 @@ Defining \__int_eval_end: on line ...
 Defining \if_int_odd:w on line ...
 Defining \if_case:w on line ...
 Defining \int_eval:n on line ...
+Defining \__int_eval:n on line ...
 Defining \int_abs:n on line ...
 Defining \__int_abs:N on line ...
 Defining \__int_maxmin:wwN on line ...
@@ -3166,6 +3167,7 @@ Defining \dim_until_do:nNnn on line ...
 Defining \dim_do_while:nNnn on line ...
 Defining \dim_do_until:nNnn on line ...
 Defining \dim_eval:n on line ...
+Defining \__dim_eval:n on line ...
 Defining \dim_use:N on line ...
 Defining \dim_use:c on line ...
 Defining \dim_to_decimal:n on line ...
diff --git a/l3kernel/testfiles/m3expl003.ptex.tlg b/l3kernel/testfiles/m3expl003.ptex.tlg
index e0cf785..38a6e6b 100644
--- a/l3kernel/testfiles/m3expl003.ptex.tlg
+++ b/l3kernel/testfiles/m3expl003.ptex.tlg
@@ -1248,6 +1248,7 @@ Defining \__int_eval_end: on line ...
 Defining \if_int_odd:w on line ...
 Defining \if_case:w on line ...
 Defining \int_eval:n on line ...
+Defining \__int_eval:n on line ...
 Defining \int_abs:n on line ...
 Defining \__int_abs:N on line ...
 Defining \__int_maxmin:wwN on line ...
@@ -3154,6 +3155,7 @@ Defining \dim_until_do:nNnn on line ...
 Defining \dim_do_while:nNnn on line ...
 Defining \dim_do_until:nNnn on line ...
 Defining \dim_eval:n on line ...
+Defining \__dim_eval:n on line ...
 Defining \dim_use:N on line ...
 Defining \dim_use:c on line ...
 Defining \dim_to_decimal:n on line ...
diff --git a/l3kernel/testfiles/m3expl003.tlg b/l3kernel/testfiles/m3expl003.tlg
index ceb472f..feee5e3 100644
--- a/l3kernel/testfiles/m3expl003.tlg
+++ b/l3kernel/testfiles/m3expl003.tlg
@@ -1248,6 +1248,7 @@ Defining \__int_eval_end: on line ...
 Defining \if_int_odd:w on line ...
 Defining \if_case:w on line ...
 Defining \int_eval:n on line ...
+Defining \__int_eval:n on line ...
 Defining \int_abs:n on line ...
 Defining \__int_abs:N on line ...
 Defining \__int_maxmin:wwN on line ...
@@ -3154,6 +3155,7 @@ Defining \dim_until_do:nNnn on line ...
 Defining \dim_do_while:nNnn on line ...
 Defining \dim_do_until:nNnn on line ...
 Defining \dim_eval:n on line ...
+Defining \__dim_eval:n on line ...
 Defining \dim_use:N on line ...
 Defining \dim_use:c on line ...
 Defining \dim_to_decimal:n on line ...
diff --git a/l3kernel/testfiles/m3expl003.uptex.tlg b/l3kernel/testfiles/m3expl003.uptex.tlg
index f21ed1a..4ed2909 100644
--- a/l3kernel/testfiles/m3expl003.uptex.tlg
+++ b/l3kernel/testfiles/m3expl003.uptex.tlg
@@ -1248,6 +1248,7 @@ Defining \__int_eval_end: on line ...
 Defining \if_int_odd:w on line ...
 Defining \if_case:w on line ...
 Defining \int_eval:n on line ...
+Defining \__int_eval:n on line ...
 Defining \int_abs:n on line ...
 Defining \__int_abs:N on line ...
 Defining \__int_maxmin:wwN on line ...
@@ -3154,6 +3155,7 @@ Defining \dim_until_do:nNnn on line ...
 Defining \dim_do_while:nNnn on line ...
 Defining \dim_do_until:nNnn on line ...
 Defining \dim_eval:n on line ...
+Defining \__dim_eval:n on line ...
 Defining \dim_use:N on line ...
 Defining \dim_use:c on line ...
 Defining \dim_to_decimal:n on line ...
diff --git a/l3kernel/testfiles/m3expl003.xetex.tlg b/l3kernel/testfiles/m3expl003.xetex.tlg
index 4497478..8d859a3 100644
--- a/l3kernel/testfiles/m3expl003.xetex.tlg
+++ b/l3kernel/testfiles/m3expl003.xetex.tlg
@@ -1514,6 +1514,7 @@ Defining \__int_eval_end: on line ...
 Defining \if_int_odd:w on line ...
 Defining \if_case:w on line ...
 Defining \int_eval:n on line ...
+Defining \__int_eval:n on line ...
 Defining \int_abs:n on line ...
 Defining \__int_abs:N on line ...
 Defining \__int_maxmin:wwN on line ...
@@ -3164,6 +3165,7 @@ Defining \dim_until_do:nNnn on line ...
 Defining \dim_do_while:nNnn on line ...
 Defining \dim_do_until:nNnn on line ...
 Defining \dim_eval:n on line ...
+Defining \__dim_eval:n on line ...
 Defining \dim_use:N on line ...
 Defining \dim_use:c on line ...
 Defining \dim_to_decimal:n on line ...
diff --git a/l3packages/xfrac/xfrac.dtx b/l3packages/xfrac/xfrac.dtx
index f93ccd1..54a89b1 100644
--- a/l3packages/xfrac/xfrac.dtx
+++ b/l3packages/xfrac/xfrac.dtx
@@ -745,9 +745,8 @@
         false =
           \cs_set:Npn \@@_relscale:
             {
-              \__dim_eval:w
-                \box_ht:N \l_@@_tmp_box + \box_dp:N \l_@@_tmp_box
-              \__dim_eval_end:
+              \__dim_eval:n
+                { \box_ht:N \l_@@_tmp_box + \box_dp:N \l_@@_tmp_box }
             },
         true  =
           \cs_set:Npn \@@_relscale:
@@ -843,11 +842,12 @@
           {
             \raisebox
               {
-                \__dim_eval:w
+                \__dim_eval:n
+                  {
                     \box_ht:N \l_@@_slash_box
-                  - \box_dp:N \l_@@_slash_box
-                  - \height
-                \__dim_eval_end:
+                    - \box_dp:N \l_@@_slash_box
+                    - \height
+                  }
               }
           }
         \dim_compare:nNnTF
@@ -871,11 +871,12 @@
                     {
                       \raisebox
                         {
-                          \__dim_eval:w
+                          \__dim_eval:n
+                            {
                               \box_ht:N \l_@@_slash_box
-                            - \dim_use:N \l_@@_numerator_top_sep_dim
-                            - \height
-                          \__dim_eval_end:
+                              - \dim_use:N \l_@@_numerator_top_sep_dim
+                              - \height
+                            }
                         }
                     }
                 }
diff --git a/l3trial/l3auxdata/l3auxdata.dtx b/l3trial/l3auxdata/l3auxdata.dtx
index f3952a8..68ceed2 100644
--- a/l3trial/l3auxdata/l3auxdata.dtx
+++ b/l3trial/l3auxdata/l3auxdata.dtx
@@ -728,14 +728,12 @@ Don't~ look~ here:~ check~ your~ console~ output!
 \prop_new:N \l_@@_catcodes_prop
 \cs_new:Nn \@@_catcodes_pushing:
   {
-    \__debug_patch_args:nNNpn { {##1} { (##2) } }
     \cs_set_protected:Npn \char_set_catcode:nn ##1 ##2
       {
         \prop_put:Nxx \l_@@_catcodes_prop
           { \int_eval:n {##1} }
           { \tex_the:D \tex_catcode:D \int_eval:n {##1} }
-
-        \tex_catcode:D \int_eval:n {##1} = \__int_eval:w ##2 \__int_eval_end:
+        \tex_catcode:D \int_eval:n {##1} = \__int_eval:n {##2}
       }
   }
 %    \end{macrocode}
@@ -743,11 +741,8 @@ Don't~ look~ here:~ check~ your~ console~ output!
 %    \begin{macrocode}
 \cs_new:Nn \@@_catcodes_pop:
   {
-    \__debug_patch_args:nNNpn { {##1} { (##2) } }
     \cs_set_protected:Npn \char_set_catcode:nn ##1 ##2
-      {
-        \tex_catcode:D \int_eval:n {##1} = \__int_eval:w ##2 \__int_eval_end:
-      }
+      { \tex_catcode:D \int_eval:n {##1} = \__int_eval:n {##2} }
     \prop_map_inline:Nn \l_@@_catcodes_prop
       { \char_set_catcode:nn {##1} {##2} }
     \prop_clear:N \l_@@_catcodes_prop
diff --git a/l3trial/l3check/l3check.dtx b/l3trial/l3check/l3check.dtx
index c35bd81..33f6a4f 100644
--- a/l3trial/l3check/l3check.dtx
+++ b/l3trial/l3check/l3check.dtx
@@ -1679,7 +1679,7 @@
         { \@@_error:nn { internal } { Cannot~patch~\__cs_generate_variant_loop_end:nwwwNNnn } }
       \cs_set_protected:Npn \check_tmp:w #1#2#3#4#5
         {
-          \tex_catcode:D `#1 = \__int_eval:w (#2) \__int_eval_end:
+          \tex_catcode:D `#1 = \__int_eval:n {#2}
           #3 { \tex_catcode:D `#1 / 2 } = { 6 }
             {
               \group_begin: \exp_args:NNc \group_end:
@@ -1690,7 +1690,7 @@
         {
           \cs_gset_protected:Npn \__char_set_catcode:NnNNN #1#2#3#4#5
             {
-              \tex_catcode:D `#1 = \__int_eval:w (#2) \__int_eval_end:
+              \tex_catcode:D `#1 = \__int_eval:n {#2}
               #3 { \tex_catcode:D `#1 / 2 } = { 6 }
                 {
                   \group_begin: \exp_after:wN \group_end:
diff --git a/l3trial/l3kernel-extras/l3kernel-extras.dtx b/l3trial/l3kernel-extras/l3kernel-extras.dtx
index 1f52dae..be6b3ef 100644
--- a/l3trial/l3kernel-extras/l3kernel-extras.dtx
+++ b/l3trial/l3kernel-extras/l3kernel-extras.dtx
@@ -932,13 +932,11 @@
 %   \texttt{sp}, we must define |#1| to be the integer expression to be
 %   multiplied, and |#2| to be the (real) scaling factor.
 %    \begin{macrocode}
-\__debug_patch_args:nNNpn { { (#1) } {#2} }
 \cs_new:Npn \int_mul_truncate:nn #1 #2
   {
     \__int_value:w
-      \__dim_eval:w
-        #2 \__dim_eval:w \__int_eval:w #1 \__int_eval_end: sp \__dim_eval_end:
-      \__dim_eval_end:
+      \__dim_eval:n
+        { #2 \__dim_eval:n { \__int_eval:n {#1} sp } }
   }
 %    \end{macrocode}
 % \end{macro}
@@ -1139,7 +1137,7 @@
   }
 \prg_new_conditional:Npnn \__char_if_in_font:nN #1#2 { TF }
   {
-    \etex_iffontchar:D #2 \__int_eval:w #1 \__int_eval_end:
+    \etex_iffontchar:D #2 \__int_eval:n {#1}
       \prg_return_true:
     \else:
       \prg_return_false:
@@ -1170,12 +1168,10 @@
 %   overall \meta{skipexpr} is closed by \cs{scan_stop:} inserted by our
 %   auxiliary.
 %    \begin{macrocode}
-\__debug_patch_args:nNNpn { { (#1) } }
 \cs_new:Npn \skip_abs:n #1
   {
     \skip_use:N \etex_glueexpr:D
-      \exp_after:wN \skip_abs_aux:wwN
-      \skip_use:N \etex_glueexpr:D #1 \scan_stop:
+      \exp_last_unbraced:Nf \skip_abs_aux:wwN { \skip_eval:n {#1} }
       \use_none:nn \scan_stop: \skip_abs_aux:wwN
       - \scan_stop: { }
   }
@@ -1299,12 +1295,10 @@
 %   This relies on the same auxiliary as \cs{skip_abs:n}.  See this
 %   function for an explanation of the code.
 %    \begin{macrocode}
-\__debug_patch_args:nNNpn { { (#1) } }
 \cs_new:Npn \muskip_abs:n #1
   {
     \muskip_use:N \etex_muexpr:D
-      \exp_after:wN \skip_abs_aux:wwN
-      \muskip_use:N \etex_muexpr:D #1 \scan_stop:
+      \exp_last_unbraced:Nf \skip_abs_aux:wwN { \muskip_eval:n {#1} }
       \use_none:nn \scan_stop: \skip_abs_aux:wwN
       - \scan_stop: { }
   }
diff --git a/l3trial/xbox/testfiles/xbox000.tlg b/l3trial/xbox/testfiles/xbox000.tlg
index fd8e455..63d57c3 100644
--- a/l3trial/xbox/testfiles/xbox000.tlg
+++ b/l3trial/xbox/testfiles/xbox000.tlg
@@ -16,7 +16,7 @@ Author: Bruno Le Floch
 . LaTeX info: "xparse/define-command"
 . 
 . Defining command \makebox with sig. 'o>{\SplitArgument {1}{,}}d()O{c}+m' on
-. line 285.
+. line 280.
 .................................................
 .................................................
 . LaTeX info: "xparse/define-command"
@@ -27,7 +27,7 @@ Author: Bruno Le Floch
 . LaTeX info: "xparse/define-command"
 . 
 . Defining command \framebox with sig. 'o>{\SplitArgument {1}{,}}d()O{c}+m' on
-. line 305.
+. line 300.
 .................................................
 .................................................
 . LaTeX info: "xparse/define-command"
@@ -48,7 +48,7 @@ Author: Bruno Le Floch
 . LaTeX info: "xparse/define-command"
 . 
 . Defining command \savebox with sig. 'mo>{\SplitArgument {1}{,}}d()O{c}+m' on
-. line 332.
+. line 327.
 .................................................
 .................................................
 . LaTeX info: "xparse/define-environment"
diff --git a/l3trial/xbox/xbox.dtx b/l3trial/xbox/xbox.dtx
index 0dc9e35..23b6816 100644
--- a/l3trial/xbox/xbox.dtx
+++ b/l3trial/xbox/xbox.dtx
@@ -728,18 +728,16 @@
 %   As we want skips and kerns to have similar behaviour, we try to get similar
 %   results.
 %    \begin{macrocode}
-\__debug_patch_args:nNNpn { { (#1) } }
 \cs_new_protected:Npn \kern_horizontal:n #1
   {
     \mode_leave_vertical:
-    \tex_kern:D \__dim_eval:w #1 \__dim_eval_end:
+    \tex_kern:D \__dim_eval:n {#1}
   }
-\__debug_patch_args:nNNpn { { (#1) } }
 \cs_new_protected:Npn \kern_vertical:n #1
   {
     \mode_if_vertical:F
       { \par }
-    \tex_kern:D \__dim_eval:w #1 \__dim_eval_end:
+    \tex_kern:D \__dim_eval:n {#1}
   }
 %    \end{macrocode}
 % \end{macro}
@@ -751,27 +749,24 @@
 %   dimension expression support. The non-expanding rule is set up in
 %   horizontal mode as that is usually the best plan.
 %    \begin{macrocode}
-\__debug_patch_args:nNNpn { { (#1) } { (#2) } { (#3) } }
 \cs_new_protected:Npn \rule:nnn #1#2#3
   {
     \hbox:n
       {
         \tex_vrule:D
-          height \__dim_eval:w #1 \__dim_eval_end:
-          depth  \__dim_eval:w #2 \__dim_eval_end:
-          width  \__dim_eval:w #3 \__dim_eval_end:
+          height \__dim_eval:n {#1}
+          depth  \__dim_eval:n {#2}
+          width  \__dim_eval:n {#3}
       }
   }
-\__debug_patch_args:nNNpn { { (#1) } { (#2) } }
 \cs_new_protected:Npn \rule_horizontal:nn #1#2
   {
     \tex_hrule:D
-      height \__dim_eval:w #1 \__dim_eval_end:
-      depth  \__dim_eval:w #2 \__dim_eval_end:
+      height \__dim_eval:n {#1}
+      depth  \__dim_eval:n {#2}
   }
-\__debug_patch_args:nNNpn { { (#1) } }
 \cs_new_protected:Npn \rule_vertical:n #1
-  { \tex_vrule:D width \__dim_eval:w #1 \__dim_eval_end: }
+  { \tex_vrule:D width \__dim_eval:n {#1} }
 %    \end{macrocode}
 % \end{macro}
 % \end{macro}
diff --git a/l3trial/xfont/xfss.dtx b/l3trial/xfont/xfss.dtx
index f4cf930..5421881 100644
--- a/l3trial/xfont/xfss.dtx
+++ b/l3trial/xfont/xfss.dtx
@@ -205,7 +205,7 @@
 %    \begin{macrocode}
 \cs_new_eq:NN \mathgroup_use:N \tex_fam:D
 \cs_new:Npn \mathgroup_use:n #1
-  { \tex_fam:D \__int_eval:w (#1) \__int_eval_end: }
+  { \tex_fam:D \__int_eval:n {#1} }
 %    \end{macrocode}
 % \end{macro}
 %
@@ -505,7 +505,7 @@
 \cs_new:Npn \xfss_dim_strip_pt:n #1
   {
     \exp_after:wN \xfss_dim_strip_pt:w
-    \dim_use:N \__dim_eval:w (#1 pt) \__dim_eval_end: \q_stop
+    \dim_use:N \__dim_eval:n { #1 pt } \q_stop
   }
 \use:x
   {
@@ -2179,7 +2179,7 @@
 %   of the current font.
 %    \begin{macrocode}
 \DeclareDocumentCommand \symbol {m}
-  { \tex_char:D \__int_eval:w (#1) \__int_eval_end: }
+  { \tex_char:D \__int_eval:n {#1} }
 %    \end{macrocode}
 % \end{macro}
 %





More information about the latex3-commits mailing list