diff options
Diffstat (limited to 'Master/texmf-dist/source/latex/l3kernel/l3int.dtx')
-rw-r--r-- | Master/texmf-dist/source/latex/l3kernel/l3int.dtx | 47 |
1 files changed, 30 insertions, 17 deletions
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3int.dtx b/Master/texmf-dist/source/latex/l3kernel/l3int.dtx index 7ea0628b831..ad438e06a72 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3int.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3int.dtx @@ -37,7 +37,7 @@ \documentclass[full]{l3doc} %</driver> %<*driver|package> -\GetIdInfo$Id: l3int.dtx 5659 2015-07-14 18:58:00Z joseph $ +\GetIdInfo$Id: l3int.dtx 5885 2015-08-24 13:29:14Z mittelba $ {L3 Integers} %</driver|package> %<*driver> @@ -142,7 +142,8 @@ % Evaluates the two \meta{integer expressions} as described earlier, % then divides the first value by the second, and rounds the result % towards zero. Note that division using |/| -% rounds the result. The result is left in the input stream as an +% rounds to the closest integer instead. +% The result is left in the input stream as an % \meta{integer denotation} after two expansions. % \end{function} % @@ -780,7 +781,7 @@ % Displays the value of the \meta{integer} on the terminal. % \end{function} % -% \begin{function}[added = 2011-11-22, updated = 2012-05-27]{\int_show:n} +% \begin{function}[added = 2011-11-22, updated = 2015-08-07]{\int_show:n} % \begin{syntax} % \cs{int_show:n} \Arg{integer expression} % \end{syntax} @@ -1230,10 +1231,10 @@ % \end{macrocode} % \end{macro} % -% \begin{macro}{\int_set_eq:NN,\int_set_eq:cN, \int_set_eq:Nc,\int_set_eq:cc} +% \begin{macro}{\int_set_eq:NN, \int_set_eq:cN, \int_set_eq:Nc, \int_set_eq:cc} % \UnitTested % \begin{macro} -% {\int_gset_eq:NN,\int_gset_eq:cN, \int_gset_eq:Nc,\int_gset_eq:cc} +% {\int_gset_eq:NN, \int_gset_eq:cN, \int_gset_eq:Nc, \int_gset_eq:cc} % \UnitTested % Setting equal means using one integer inside the set function of % another. @@ -1546,22 +1547,22 @@ % \begin{macrocode} \cs_new:Npn \int_case:nnTF #1 { - \tex_romannumeral:D + \exp:w \exp_args:Nf \@@_case:nnTF { \int_eval:n {#1} } } \cs_new:Npn \int_case:nnT #1#2#3 { - \tex_romannumeral:D + \exp:w \exp_args:Nf \@@_case:nnTF { \int_eval:n {#1} } {#2} {#3} { } } \cs_new:Npn \int_case:nnF #1#2 { - \tex_romannumeral:D + \exp:w \exp_args:Nf \@@_case:nnTF { \int_eval:n {#1} } {#2} { } } \cs_new:Npn \int_case:nn #1#2 { - \tex_romannumeral:D + \exp:w \exp_args:Nf \@@_case:nnTF { \int_eval:n {#1} } {#2} { } { } } \cs_new:Npn \@@_case:nnTF #1#2#3#4 @@ -1907,7 +1908,7 @@ % \begin{macro}{\int_to_base:nn, \int_to_Base:nn} % \UnitTested % \begin{macro}[aux]{\@@_to_base:nn, \@@_to_Base:nn, -% \@@_to_base:nnN,\@@_to_Base:nnN,\@@_to_base:nnnN,\@@_to_Base:nnnN} +% \@@_to_base:nnN, \@@_to_Base:nnN, \@@_to_base:nnnN, \@@_to_Base:nnnN} % \begin{macro}[aux]{\@@_to_letter:n, \@@_to_Letter:n} % \UnitTested % Converting from base ten (|#1|) to a second base (|#2|) starts with @@ -2326,22 +2327,34 @@ % % \subsection{Viewing integer} % -% \begin{macro}{\int_show:N,\int_show:c} +% \begin{macro}{\int_show:N, \int_show:c} % \UnitTested +% This is very similar to other registers done using +% \cs{__kernel_register_show:N}, but differs because the variable +% |#1| may be \tn{currentgrouplevel} or \tn{currentgrouptype}, in +% which case the value must be expanded in the current scope rather +% than when processing \cs{iow_wrap:nnnN}. % \begin{macrocode} -\cs_new_eq:NN \int_show:N \__kernel_register_show:N -\cs_new_eq:NN \int_show:c \__kernel_register_show:c +\cs_new_protected:Npn \int_show:N #1 + { + \use:x + { + \exp_not:n + { \__msg_show_variable:NNNnn #1 \cs_if_exist:NTF ? { } } + { > ~ \token_to_str:N #1 = \tex_the:D #1 } + } + } +\cs_generate_variant:Nn \int_show:N { c } % \end{macrocode} % \end{macro} % % \begin{macro}{\int_show:n} % \UnitTested % We don't use the \TeX{} primitive \tn{showthe} to show integer -% expressions: this gives a more unified output, since the closing -% brace is read by the integer expression in all cases. +% expressions: this gives a more unified output. % \begin{macrocode} -\cs_new_protected:Npn \int_show:n #1 - { \etex_showtokens:D \exp_after:wN { \int_use:N \@@_eval:w #1 } } +\cs_new_protected_nopar:Npn \int_show:n + { \__msg_show_wrap:Nn \int_eval:n } % \end{macrocode} % \end{macro} % |