diff options
author | Karl Berry <karl@freefriends.org> | 2018-05-13 21:56:47 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2018-05-13 21:56:47 +0000 |
commit | e6d38f40f0132914020c723840be3489c4b692f0 (patch) | |
tree | dac2c281e93cba461b3ff2c1e4b8e34aad401716 /Master/texmf-dist/source/latex | |
parent | 55be422dc01e60cfae781a9a4a310a96c9e99256 (diff) |
l3 (13may18)
git-svn-id: svn://tug.org/texlive/trunk@47705 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex')
73 files changed, 3629 insertions, 1592 deletions
diff --git a/Master/texmf-dist/source/latex/l3experimental/l3color/l3color.dtx b/Master/texmf-dist/source/latex/l3experimental/l3color/l3color.dtx index 3654c315ac5..83f70fbf56d 100644 --- a/Master/texmf-dist/source/latex/l3experimental/l3color/l3color.dtx +++ b/Master/texmf-dist/source/latex/l3experimental/l3color/l3color.dtx @@ -44,7 +44,7 @@ % }^^A % } % -% \date{Released 2018-04-30} +% \date{Released 2018-05-12} % % \maketitle % @@ -263,7 +263,7 @@ % % \begin{macrocode} %<*package> -\ProvidesExplPackage{l3color}{2018-04-30}{} +\ProvidesExplPackage{l3color}{2018-05-12}{} {L3 Experimental color support} %</package> % \end{macrocode} diff --git a/Master/texmf-dist/source/latex/l3experimental/l3draw/l3draw-boxes.dtx b/Master/texmf-dist/source/latex/l3experimental/l3draw/l3draw-boxes.dtx index a1086818891..57117b09282 100644 --- a/Master/texmf-dist/source/latex/l3experimental/l3draw/l3draw-boxes.dtx +++ b/Master/texmf-dist/source/latex/l3experimental/l3draw/l3draw-boxes.dtx @@ -42,7 +42,7 @@ % }^^A % } % -% \date{Released 2018-04-30} +% \date{Released 2018-05-12} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3experimental/l3draw/l3draw-paths.dtx b/Master/texmf-dist/source/latex/l3experimental/l3draw/l3draw-paths.dtx index d6b152be155..2e77000cff1 100644 --- a/Master/texmf-dist/source/latex/l3experimental/l3draw/l3draw-paths.dtx +++ b/Master/texmf-dist/source/latex/l3experimental/l3draw/l3draw-paths.dtx @@ -42,7 +42,7 @@ % }^^A % } % -% \date{Released 2018-04-30} +% \date{Released 2018-05-12} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3experimental/l3draw/l3draw-points.dtx b/Master/texmf-dist/source/latex/l3experimental/l3draw/l3draw-points.dtx index 9e713f30464..0c0444a19a2 100644 --- a/Master/texmf-dist/source/latex/l3experimental/l3draw/l3draw-points.dtx +++ b/Master/texmf-dist/source/latex/l3experimental/l3draw/l3draw-points.dtx @@ -42,7 +42,7 @@ % }^^A % } % -% \date{Released 2018-04-30} +% \date{Released 2018-05-12} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3experimental/l3draw/l3draw-scopes.dtx b/Master/texmf-dist/source/latex/l3experimental/l3draw/l3draw-scopes.dtx index 6f4a94b0220..aa2d19e1ae2 100644 --- a/Master/texmf-dist/source/latex/l3experimental/l3draw/l3draw-scopes.dtx +++ b/Master/texmf-dist/source/latex/l3experimental/l3draw/l3draw-scopes.dtx @@ -42,7 +42,7 @@ % }^^A % } % -% \date{Released 2018-04-30} +% \date{Released 2018-05-12} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3experimental/l3draw/l3draw-softpath.dtx b/Master/texmf-dist/source/latex/l3experimental/l3draw/l3draw-softpath.dtx index 558b559ff92..69ad970d71e 100644 --- a/Master/texmf-dist/source/latex/l3experimental/l3draw/l3draw-softpath.dtx +++ b/Master/texmf-dist/source/latex/l3experimental/l3draw/l3draw-softpath.dtx @@ -42,7 +42,7 @@ % }^^A % } % -% \date{Released 2018-04-30} +% \date{Released 2018-05-12} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3experimental/l3draw/l3draw-state.dtx b/Master/texmf-dist/source/latex/l3experimental/l3draw/l3draw-state.dtx index 7e02a505cd9..844e488406d 100644 --- a/Master/texmf-dist/source/latex/l3experimental/l3draw/l3draw-state.dtx +++ b/Master/texmf-dist/source/latex/l3experimental/l3draw/l3draw-state.dtx @@ -42,7 +42,7 @@ % }^^A % } % -% \date{Released 2018-04-30} +% \date{Released 2018-05-12} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3experimental/l3draw/l3draw-transforms.dtx b/Master/texmf-dist/source/latex/l3experimental/l3draw/l3draw-transforms.dtx index 9153c7ff38d..17ac6474804 100644 --- a/Master/texmf-dist/source/latex/l3experimental/l3draw/l3draw-transforms.dtx +++ b/Master/texmf-dist/source/latex/l3experimental/l3draw/l3draw-transforms.dtx @@ -42,7 +42,7 @@ % }^^A % } % -% \date{Released 2018-04-30} +% \date{Released 2018-05-12} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3experimental/l3draw/l3draw.dtx b/Master/texmf-dist/source/latex/l3experimental/l3draw/l3draw.dtx index 618860c7279..aa43879c0d7 100644 --- a/Master/texmf-dist/source/latex/l3experimental/l3draw/l3draw.dtx +++ b/Master/texmf-dist/source/latex/l3experimental/l3draw/l3draw.dtx @@ -109,7 +109,7 @@ % }^^A % } % -% \date{Released 2018-04-30} +% \date{Released 2018-05-12} % % \maketitle % @@ -1106,7 +1106,7 @@ % % \begin{macrocode} %<*package> -\ProvidesExplPackage{l3draw}{2018-04-30}{} +\ProvidesExplPackage{l3draw}{2018-05-12}{} {L3 Experimental core drawing support} %</package> % \end{macrocode} diff --git a/Master/texmf-dist/source/latex/l3experimental/l3str/l3str-convert.dtx b/Master/texmf-dist/source/latex/l3experimental/l3str/l3str-convert.dtx index 6fa42db903e..7c8baf1855e 100644 --- a/Master/texmf-dist/source/latex/l3experimental/l3str/l3str-convert.dtx +++ b/Master/texmf-dist/source/latex/l3experimental/l3str/l3str-convert.dtx @@ -46,7 +46,7 @@ % }^^A % } % -% \date{Released 2018-04-30} +% \date{Released 2018-05-12} % % \maketitle % @@ -234,7 +234,7 @@ % \end{macrocode} % % \begin{macrocode} -\ProvidesExplPackage{l3str-convert}{2018-04-30}{} +\ProvidesExplPackage{l3str-convert}{2018-05-12}{} {L3 Experimental string encoding conversions} % \end{macrocode} % diff --git a/Master/texmf-dist/source/latex/l3experimental/l3str/l3str-format.dtx b/Master/texmf-dist/source/latex/l3experimental/l3str/l3str-format.dtx index 4118358ac5c..469af8f1eab 100644 --- a/Master/texmf-dist/source/latex/l3experimental/l3str/l3str-format.dtx +++ b/Master/texmf-dist/source/latex/l3experimental/l3str/l3str-format.dtx @@ -46,7 +46,7 @@ % }^^A % } % -% \date{Released 2018-04-30} +% \date{Released 2018-05-12} % % \maketitle % @@ -162,7 +162,7 @@ % % \begin{macrocode} %<*package> -\ProvidesExplPackage{l3str-format}{2018-04-30}{} +\ProvidesExplPackage{l3str-format}{2018-05-12}{} {L3 Experimental string formatting} %</package> % \end{macrocode} diff --git a/Master/texmf-dist/source/latex/l3experimental/xcoffins/xcoffins.dtx b/Master/texmf-dist/source/latex/l3experimental/xcoffins/xcoffins.dtx index e5981dcb044..07091341102 100644 --- a/Master/texmf-dist/source/latex/l3experimental/xcoffins/xcoffins.dtx +++ b/Master/texmf-dist/source/latex/l3experimental/xcoffins/xcoffins.dtx @@ -54,7 +54,7 @@ % }^^A % } % -% \date{Released 2018-04-30} +% \date{Released 2018-05-12} % % \maketitle % @@ -673,7 +673,7 @@ % \end{macrocode} % % \begin{macrocode} -\ProvidesExplPackage{xcoffins}{2018-04-30}{} +\ProvidesExplPackage{xcoffins}{2018-05-12}{} {L3 Experimental design level coffins} % \end{macrocode} % diff --git a/Master/texmf-dist/source/latex/l3experimental/xgalley/l3galley.dtx b/Master/texmf-dist/source/latex/l3experimental/xgalley/l3galley.dtx index 1821ea5a0f8..12bde666f03 100644 --- a/Master/texmf-dist/source/latex/l3experimental/xgalley/l3galley.dtx +++ b/Master/texmf-dist/source/latex/l3experimental/xgalley/l3galley.dtx @@ -59,7 +59,7 @@ % }^^A % } % -% \date{Released 2018-04-30} +% \date{Released 2018-05-12} % % \maketitle % @@ -685,7 +685,7 @@ % % \begin{macrocode} %<*package> -\ProvidesExplPackage{l3galley}{2018-04-30}{} +\ProvidesExplPackage{l3galley}{2018-05-12}{} {L3 Experimental galley code} %</package> % \end{macrocode} @@ -993,7 +993,7 @@ % \begin{macrocode} \cs_new_protected:Npn \@@_initialise_variables: { - \int_set:Nn \l_@@_group_level_int { \etex_currentgrouplevel:D } + \int_set:Nn \l_@@_group_level_int { \tex_currentgrouplevel:D } \bool_gset_true:N \g_@@_begin_level_bool \bool_gset_false:N \g_@@_cutout_active_bool \seq_gclear:N \g_@@_cutout_left_seq @@ -1182,7 +1182,7 @@ % \end{macrocode} % No marker, so really insert a paragraph: the \cs{tex_par:D} is inside a % group to preserve some dynamic settings (for example -% \cs{etex_interlinepenalties:D}). In vertical mode, that means just +% \cs{tex_interlinepenalties:D}). In vertical mode, that means just % inserting the primitive. % \begin{macrocode} \cs_new_protected:Npn \@@_par_auxii: @@ -1264,7 +1264,7 @@ } \@@_parshape_set: } - \int_compare:nNnT \l_@@_group_level_int = \etex_currentgrouplevel:D + \int_compare:nNnT \l_@@_group_level_int = \tex_currentgrouplevel:D { \bool_lazy_and:nnT { \seq_if_empty_p:N \g_@@_cutout_left_seq } @@ -2014,8 +2014,8 @@ { \galley_vspace_set_single:n {#1} } { \dim_compare:nNnT - { \etex_glueexpr:D \g_@@_interpar_vspace_user_tl } - < { \etex_glueexpr:D (#1) \scan_stop: } + { \tex_glueexpr:D \g_@@_interpar_vspace_user_tl } + < { \tex_glueexpr:D (#1) \scan_stop: } { \galley_vspace_set_single:n {#1} } } } @@ -2063,7 +2063,7 @@ % \begin{variable}{\l_galley_last_line_fit_int} % One from \eTeX{}. % \begin{macrocode} -\cs_new_eq:NN \l_galley_last_line_fit_int \etex_lastlinefit:D +\cs_new_eq:NN \l_galley_last_line_fit_int \tex_lastlinefit:D % \end{macrocode} % \end{variable} % @@ -2224,7 +2224,7 @@ % \begin{macrocode} \cs_new_protected:Npn \galley_display_widow_penalties_set:n #1 { - \etex_displaywidowpenalties:D + \tex_displaywidowpenalties:D \int_eval:n { \clist_count:n {#1} + 1 } \exp_stop_f: \clist_map_function:nN {#1} \@@_set_aux:n 0 \exp_stop_f: @@ -2232,7 +2232,7 @@ \cs_generate_variant:Nn \galley_display_widow_penalties_set:n { V , v } \cs_new_protected:Npn \galley_widow_penalties_set:n #1 { - \etex_widowpenalties:D + \tex_widowpenalties:D \int_eval:n { \clist_count:n {#1} + 1 } \exp_stop_f: \clist_map_function:nN {#1} \@@_set_aux:n 0 \exp_stop_f: @@ -2283,7 +2283,7 @@ % \begin{macrocode} \cs_new_protected:Npn \galley_display_club_penalties_set:n #1 { - \etex_clubpenalties:D + \tex_clubpenalties:D \int_eval:n { \clist_count:n {#1} + 1 } \exp_stop_f: \clist_map_function:nN {#1} \@@_set_aux:n 0 \exp_stop_f: @@ -2305,13 +2305,13 @@ % penalty is removed and the new one is added. If there is currently % no shape set, then after adding the general interline value the % generic build system is invoked (in case the -% \cs{etex_interlinepenalties:D} has accidentally been cleared). +% \cs{tex_interlinepenalties:D} has accidentally been cleared). % \begin{macrocode} \cs_new_protected:Npn \galley_interline_penalty_set:n #1 { - \int_compare:nNnTF { \etex_interlinepenalties:D 0 } = 0 + \int_compare:nNnTF { \tex_interlinepenalties:D 0 } = 0 { - \etex_interlinepenalties:D 1 = \int_eval:n {#1} \exp_stop_f: + \tex_interlinepenalties:D 1 = \int_eval:n {#1} \exp_stop_f: \@@_calc_interline_penalties: } { @@ -2319,8 +2319,8 @@ { \int_eval:n { - \etex_interlinepenalties:D ##1 - - \etex_interlinepenalties:D \etex_interlinepenalties:D 0 + \tex_interlinepenalties:D ##1 + - \tex_interlinepenalties:D \tex_interlinepenalties:D 0 + #1 } \exp_stop_f: @@ -2331,16 +2331,16 @@ } \cs_new_protected:Npn \@@_set_interline_penalty:nn #1#2 { - \etex_interlinepenalties:D - \etex_interlinepenalties:D 0 \exp_stop_f: + \tex_interlinepenalties:D + \tex_interlinepenalties:D 0 \exp_stop_f: \int_step_function:nN {#1} \@@_set_interline_penalty_auxi:n - \int_step_function:nnN { #1 + 1 } { \etex_interlinepenalties:D 0 - 1 } + \int_step_function:nnN { #1 + 1 } { \tex_interlinepenalties:D 0 - 1 } \@@_set_interline_penalty_auxii:n \int_eval:n {#2} \exp_stop_f: } \cs_new:Npn \@@_set_interline_penalty_auxi:n #1 - { \etex_interlinepenalties:D \int_eval:n {#1} \exp_stop_f: } + { \tex_interlinepenalties:D \int_eval:n {#1} \exp_stop_f: } \cs_new:Npn \@@_set_interline_penalty_auxii:n #1 { } % \end{macrocode} % \end{macro} @@ -2370,7 +2370,7 @@ { \int_max:nn { \clist_count:N \l_galley_line_penalties_clist + 1 } - { \etex_clubpenalties:D 0 } + { \tex_clubpenalties:D 0 } } } { \clist_count:N \l_galley_line_penalties_clist } @@ -2383,12 +2383,12 @@ % \begin{macrocode} \cs_new_protected:Npn \@@_calc_interline_penalties:nn #1#2 { - \etex_interlinepenalties:D #1 ~ + \tex_interlinepenalties:D #1 ~ \int_step_function:nN {#2} \@@_calc_interline_penalties_auxi:n \int_step_function:nnN { #2 + 1 } { #1 - 1 } \@@_calc_interline_penalties_auxii:n - \etex_interlinepenalties:D \etex_interlinepenalties:D 0 \exp_stop_f: + \tex_interlinepenalties:D \tex_interlinepenalties:D 0 \exp_stop_f: } \cs_new:Npn \@@_calc_interline_penalties_auxi:n #1 { @@ -2396,7 +2396,7 @@ { \clist_item:Nn \l_galley_line_penalties_clist {#1} + 0 \clist_item:Nn \l_galley_club_penalties_clist {#1} - - \etex_clubpenalties:D #1 ~ + - \tex_clubpenalties:D #1 ~ } \exp_stop_f: } @@ -2404,9 +2404,9 @@ { \int_eval:n { - \etex_interlinepenalties:D \etex_interlinepenalties:D 0 \exp_stop_f: + \tex_interlinepenalties:D \tex_interlinepenalties:D 0 \exp_stop_f: + 0 \clist_item:Nn \l_galley_club_penalties_clist {#1} - - \etex_clubpenalties:D #1 ~ + - \tex_clubpenalties:D #1 ~ } \exp_stop_f: } @@ -2445,42 +2445,42 @@ { \clist_set:Nx #1 { - \int_step_function:nN { \etex_clubpenalties:D 0 - 1 } + \int_step_function:nN { \tex_clubpenalties:D 0 - 1 } \@@_save_display_club_penalties:n } } \cs_new:Npn \@@_save_display_club_penalties:n #1 - { \int_value:w \etex_clubpenalties:D \int_eval:n {#1} , } + { \int_value:w \tex_clubpenalties:D \int_eval:n {#1} , } \cs_new_protected:Npn \galley_save_display_widow_penalties:N #1 { \clist_set:Nx #1 { - \int_step_function:nN { \etex_displaywidowpenalties:D 0 - 1 } + \int_step_function:nN { \tex_displaywidowpenalties:D 0 - 1 } \@@_save_display_widow_penalties:n } } \cs_new:Npn \@@_save_display_widow_penalties:n #1 { - \int_value:w \etex_displaywidowpenalties:D + \int_value:w \tex_displaywidowpenalties:D \int_eval:n {#1} , } \cs_new_protected:Npn \galley_save_widow_penalties:N #1 { \clist_set:Nx #1 { - \int_step_function:nN { \etex_widowpenalties:D 0 - 1 } + \int_step_function:nN { \tex_widowpenalties:D 0 - 1 } \@@_save_widow_penalties:n } } \cs_new:Npn \@@_save_widow_penalties:n #1 - { \int_value:w \etex_widowpenalties:D \int_eval:n {#1} , } + { \int_value:w \tex_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 % last value in the primitive array. % \begin{macrocode} \cs_new_protected:Npn \galley_interline_penalty: - { \int_value:w \etex_interlinepenalties:D \etex_interlinepenalties:D 0 \exp_stop_f: } + { \int_value:w \tex_interlinepenalties:D \tex_interlinepenalties:D 0 \exp_stop_f: } % \end{macrocode} % \end{macro} % \end{macro} diff --git a/Master/texmf-dist/source/latex/l3experimental/xgalley/xgalley.dtx b/Master/texmf-dist/source/latex/l3experimental/xgalley/xgalley.dtx index 369d93f3b76..86d7b88b73f 100644 --- a/Master/texmf-dist/source/latex/l3experimental/xgalley/xgalley.dtx +++ b/Master/texmf-dist/source/latex/l3experimental/xgalley/xgalley.dtx @@ -45,7 +45,7 @@ % }^^A % } % -% \date{Released 2018-04-30} +% \date{Released 2018-05-12} % % \maketitle % @@ -732,7 +732,7 @@ % \end{macrocode} % % \begin{macrocode} -\ProvidesExplPackage{xgalley}{2018-04-30}{} +\ProvidesExplPackage{xgalley}{2018-05-12}{} {L3 Experimental galley} \RequirePackage{xparse,xtemplate,l3galley} % \end{macrocode} diff --git a/Master/texmf-dist/source/latex/l3kernel/expl3.dtx b/Master/texmf-dist/source/latex/l3kernel/expl3.dtx index 84f7141bb7c..694f616f01e 100644 --- a/Master/texmf-dist/source/latex/l3kernel/expl3.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/expl3.dtx @@ -49,7 +49,7 @@ % }^^A % } % -% \date{Released 2018-04-30} +% \date{Released 2018-05-12} % % \maketitle % @@ -921,16 +921,16 @@ % which are constructed using macros as the underlying storage system. The % \texttt{check-declarations} option enables checking for all variable % assignments, issuing an error if any variables are assigned without being -% initialised. -% See also \cs{debug_on:n} \texttt{\{check-declarations\}} for finer control. +% initialised. See also \cs{debug_on:n} \texttt{\{check-declarations\}} +% in \pkg{l3candidates} for finer control. % % \DescribeOption{log-functions} % The \texttt{log-functions} option is used to enable recording of every new % function name in the \texttt{.log} file. This is useful for debugging % purposes, as it means that there is a complete list of all functions % created by each module loaded (with the exceptions of a very small number -% required by the bootstrap code for \LaTeX3). -% See also \cs{debug_on:n} \texttt{\{log-functions\}} for finer control. +% required by the bootstrap code for \LaTeX3). See also \cs{debug_on:n} +% \texttt{\{log-functions\}} in \pkg{l3candidates} for finer control. % % \DescribeOption{enable-debug} % To allow more localized checking and logging than provided by @@ -993,13 +993,14 @@ % Any engine which defines |\pdfoutput| (\emph{i.e.}~allows direct production % of a PDF file without a DVI intermediate) must also provide |\pdfcolorstack|, % |\pdfliteral|, |\pdfmatrix|, |\pdfrestore| and |\pdfsave| or equivalent -% functionality. +% functionality. Fully Unicode engines must provide a method for producing +% character tokens in an expandable manner. % % Practically, these requirements are met by the engines % \begin{itemize} % \item \pdfTeX{} v1.40 or later. -% \item \XeTeX{} v0.9994 or later. -% \item \LuaTeX{} v0.70 or later. +% \item \XeTeX{} v0.99992 or later. +% \item \LuaTeX{} v0.76 or later. % \item e-(u)\pTeX{} mid-2012 or later. % \end{itemize} % @@ -1732,8 +1733,8 @@ { xdvipdfmx } { \bool_lazy_and:nnTF - { \cs_if_exist_p:N \pdftex_pdfoutput:D } - { \int_compare_p:nNn \pdftex_pdfoutput:D > 0 } + { \cs_if_exist_p:N \tex_pdfoutput:D } + { \int_compare_p:nNn \tex_pdfoutput:D > 0 } { pdfmode } { dvips } } diff --git a/Master/texmf-dist/source/latex/l3kernel/l3.ins b/Master/texmf-dist/source/latex/l3kernel/l3.ins index ad2b6330ecf..8a72417d1db 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3.ins +++ b/Master/texmf-dist/source/latex/l3kernel/l3.ins @@ -78,6 +78,7 @@ and all files in that bundle must be distributed together. \from{l3file.dtx} {package} \from{l3skip.dtx} {package} \from{l3keys.dtx} {package} + \from{l3intarray.dtx} {package} \from{l3fp.dtx} {package} \from{l3fp-aux.dtx} {package} \from{l3fp-traps.dtx} {package} @@ -91,7 +92,7 @@ and all files in that bundle must be distributed together. \from{l3fp-trig.dtx} {package} \from{l3fp-convert.dtx} {package} \from{l3fp-random.dtx} {package} - \from{l3intarray.dtx} {package} + \from{l3fparray.dtx} {package} \from{l3sort.dtx} {package} \from{l3tl-analysis.dtx}{package} \from{l3regex.dtx} {package} diff --git a/Master/texmf-dist/source/latex/l3kernel/l3alloc.dtx b/Master/texmf-dist/source/latex/l3kernel/l3alloc.dtx index 25a0f22d0b4..e90028fca56 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3alloc.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3alloc.dtx @@ -41,7 +41,7 @@ % }^^A % } % -% \date{Released 2018-04-30} +% \date{Released 2018-05-12} % % \maketitle % @@ -124,7 +124,7 @@ % At present there are no \pkg{expl3} allocators for these concepts so the % names and numbers of the tracking variables may change. % \begin{macrocode} -\etex_ifdefined:D \luatex_luatexversion:D +\tex_ifdefined:D \tex_luatexversion:D \tex_global:D \tex_countdef:D \g_@@_attribute_int = 21 ~ \tex_global:D \tex_countdef:D \g_@@_bytecode_int = 22 ~ \tex_global:D \tex_countdef:D \g_@@_chunkname_int = 23 ~ @@ -141,7 +141,7 @@ \cs_new_protected:Npx \box_new:N #1 { \exp_not:N \@@_reg:nNnN { box } - \cs_if_exist:NTF \luatex_luatexversion:D + \cs_if_exist:NTF \tex_luatexversion:D { \tex_chardef:D } { \tex_mathchardef:D } \c_max_register_int diff --git a/Master/texmf-dist/source/latex/l3kernel/l3basics.dtx b/Master/texmf-dist/source/latex/l3kernel/l3basics.dtx index c3517204991..debebd7cc60 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3basics.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3basics.dtx @@ -41,7 +41,7 @@ % }^^A % } % -% \date{Released 2018-04-30} +% \date{Released 2018-05-12} % % \maketitle % @@ -1203,7 +1203,7 @@ \tex_let:D \or: \tex_or:D \tex_let:D \else: \tex_else:D \tex_let:D \fi: \tex_fi:D -\tex_let:D \reverse_if:N \etex_unless:D +\tex_let:D \reverse_if:N \tex_unless:D \tex_let:D \if:w \tex_if:D \tex_let:D \if_charcode:w \tex_if:D \tex_let:D \if_catcode:w \tex_ifcat:D @@ -1230,8 +1230,8 @@ % \begin{macro}[EXP]{\if_cs_exist:N, \if_cs_exist:w, \cs:w, \cs_end:} % Building csnames and testing if control sequences exist. % \begin{macrocode} -\tex_let:D \if_cs_exist:N \etex_ifdefined:D -\tex_let:D \if_cs_exist:w \etex_ifcsname:D +\tex_let:D \if_cs_exist:N \tex_ifdefined:D +\tex_let:D \if_cs_exist:w \tex_ifcsname:D \tex_let:D \cs:w \tex_csname:D \tex_let:D \cs_end: \tex_endcsname:D % \end{macrocode} @@ -1243,7 +1243,7 @@ % \begin{macrocode} \tex_let:D \exp_after:wN \tex_expandafter:D \tex_let:D \exp_not:N \tex_noexpand:D -\tex_let:D \exp_not:n \etex_unexpanded:D +\tex_let:D \exp_not:n \tex_unexpanded:D \tex_let:D \exp:w \tex_romannumeral:D \tex_chardef:D \exp_end: = 0 ~ % \end{macrocode} @@ -1260,9 +1260,9 @@ % \begin{macro}[EXP]{\tl_to_str:n, \token_to_str:N, \__kernel_tl_to_str:w} % Making strings. % \begin{macrocode} -\tex_let:D \tl_to_str:n \etex_detokenize:D +\tex_let:D \tl_to_str:n \tex_detokenize:D \tex_let:D \token_to_str:N \tex_string:D -\tex_let:D \__kernel_tl_to_str:w \etex_detokenize:D +\tex_let:D \__kernel_tl_to_str:w \tex_detokenize:D % \end{macrocode} % \end{macro} % @@ -1332,8 +1332,8 @@ % % \subsection{Defining some constants} % -% \begin{variable}{\c_zero} -% We need the constant \cs{c_zero} +% \begin{variable}{\c_zero_int} +% We need the constant \cs{c_zero_int} % which is used by some functions in the \textsf{l3alloc} module. The % rest are defined in the \textsf{l3int} module -- at least for the % ones that can be defined with \cs{tex_chardef:D} or @@ -1341,7 +1341,7 @@ % required but it can't be used until the allocation has been set % up properly! % \begin{macrocode} -\tex_chardef:D \c_zero = 0 ~ +\tex_chardef:D \c_zero_int = 0 ~ % \end{macrocode} % \end{variable} % @@ -1349,7 +1349,7 @@ % This is here as this particular integer is needed both in package % mode and to bootstrap \pkg{l3alloc}, and is documented in \pkg{l3int}. % \begin{macrocode} -\etex_ifdefined:D \luatex_luatexversion:D +\tex_ifdefined:D \tex_luatexversion:D \tex_chardef:D \c_max_register_int = 65 535 ~ \tex_else:D \tex_mathchardef:D \c_max_register_int = 32 767 ~ @@ -1375,18 +1375,18 @@ % \begin{macrocode} \tex_let:D \cs_set_nopar:Npn \tex_def:D \tex_let:D \cs_set_nopar:Npx \tex_edef:D -\etex_protected:D \tex_long:D \tex_def:D \cs_set:Npn +\tex_protected:D \tex_long:D \tex_def:D \cs_set:Npn { \tex_long:D \tex_def:D } -\etex_protected:D \tex_long:D \tex_def:D \cs_set:Npx +\tex_protected:D \tex_long:D \tex_def:D \cs_set:Npx { \tex_long:D \tex_edef:D } -\etex_protected:D \tex_long:D \tex_def:D \cs_set_protected_nopar:Npn - { \etex_protected:D \tex_def:D } -\etex_protected:D \tex_long:D \tex_def:D \cs_set_protected_nopar:Npx - { \etex_protected:D \tex_edef:D } -\etex_protected:D \tex_long:D \tex_def:D \cs_set_protected:Npn - { \etex_protected:D \tex_long:D \tex_def:D } -\etex_protected:D \tex_long:D \tex_def:D \cs_set_protected:Npx - { \etex_protected:D \tex_long:D \tex_edef:D } +\tex_protected:D \tex_long:D \tex_def:D \cs_set_protected_nopar:Npn + { \tex_protected:D \tex_def:D } +\tex_protected:D \tex_long:D \tex_def:D \cs_set_protected_nopar:Npx + { \tex_protected:D \tex_edef:D } +\tex_protected:D \tex_long:D \tex_def:D \cs_set_protected:Npn + { \tex_protected:D \tex_long:D \tex_def:D } +\tex_protected:D \tex_long:D \tex_def:D \cs_set_protected:Npx + { \tex_protected:D \tex_long:D \tex_edef:D } % \end{macrocode} % \end{macro} % @@ -1406,13 +1406,13 @@ \cs_set_protected:Npn \cs_gset:Npx { \tex_long:D \tex_xdef:D } \cs_set_protected:Npn \cs_gset_protected_nopar:Npn - { \etex_protected:D \tex_gdef:D } + { \tex_protected:D \tex_gdef:D } \cs_set_protected:Npn \cs_gset_protected_nopar:Npx - { \etex_protected:D \tex_xdef:D } + { \tex_protected:D \tex_xdef:D } \cs_set_protected:Npn \cs_gset_protected:Npn - { \etex_protected:D \tex_long:D \tex_gdef:D } + { \tex_protected:D \tex_long:D \tex_gdef:D } \cs_set_protected:Npn \cs_gset_protected:Npx - { \etex_protected:D \tex_long:D \tex_xdef:D } + { \tex_protected:D \tex_long:D \tex_xdef:D } % \end{macrocode} % \end{macro} % @@ -1458,7 +1458,7 @@ % A candidate, but needed early as it links to string comparisons. % Currently \LuaTeX-only. % \begin{macrocode} -\cs_set:Npn \use_x:n #1 { \luatex_expanded:D {#1} } +\cs_set:Npn \use_x:n #1 { \tex_expanded:D {#1} } % \end{macrocode} % \end{macro} % @@ -1592,7 +1592,7 @@ % \end{macrocode} % \end{macro} % -% \begin{macro}{\debug_on:n, \debug_off:n} +% \begin{macro}{\debug_on:n, \debug_off:n, \@@_all_on:, \@@_all_off:} % % \begin{macrocode} \__kernel_if_debug:TF @@ -1613,6 +1613,26 @@ { \__kernel_msg_error:nnn { kernel } { debug } {##1} } } } + \cs_set_protected:Npn \@@_all_on: + { + \debug_on:n + { + check-declarations , + check-expressions , + deprecation , + log-functions , + } + } + \cs_set_protected:Npn \@@_all_off: + { + \debug_off:n + { + check-declarations , + check-expressions , + deprecation , + log-functions , + } + } } { \cs_set_protected:Npn \debug_on:n #1 @@ -1815,7 +1835,7 @@ % to convert to integer) before it encounters the final % \cs{tex_relax:D}. Since \cs{tex_romannumeral:D} does not absorb % \cs{tex_relax:D} the output will be nonempty. Note that |#3| is -% empty except for mu expressions for which it is \cs{etex_mutoglue:D} +% empty except for mu expressions for which it is \cs{tex_mutoglue:D} % to avoid an \enquote{incompatible glue units} error. Note also that % if we had omitted the first \cs{tex_relax:D} then for instance % |1+2\relax+3| would incorrectly be accepted as a valid integer @@ -2131,7 +2151,7 @@ % \prg_set_protected_conditional:Npnn , % \prg_new_protected_conditional:Npnn , % } -% \begin{macro}{\@@_generate_conditional_parm:nnNpnn} +% \begin{macro}{\@@_generate_conditional_parm:NNNpnn} % The user functions for the types using parameter text from the % programmer. The various functions only differ by which function is % used for the assignment. For those |Npnn| type functions, we must @@ -2141,23 +2161,24 @@ % \Arg{set~or~new} \Arg{maybe~protected} \Arg{parameters} |{TF,...}| % \Arg{code} to the auxiliary function responsible for defining all % conditionals. +% Note that |e| stands for expandable and |p| for protected. % \begin{macrocode} \cs_set_protected:Npn \prg_set_conditional:Npnn - { \@@_generate_conditional_parm:nnNpnn { set } { } } + { \@@_generate_conditional_parm:NNNpnn \cs_set:Npn e } \cs_set_protected:Npn \prg_new_conditional:Npnn - { \@@_generate_conditional_parm:nnNpnn { new } { } } + { \@@_generate_conditional_parm:NNNpnn \cs_new:Npn e } \cs_set_protected:Npn \prg_set_protected_conditional:Npnn - { \@@_generate_conditional_parm:nnNpnn { set } { _protected } } + { \@@_generate_conditional_parm:NNNpnn \cs_set_protected:Npn p } \cs_set_protected:Npn \prg_new_protected_conditional:Npnn - { \@@_generate_conditional_parm:nnNpnn { new } { _protected } } -\cs_set_protected:Npn \@@_generate_conditional_parm:nnNpnn #1#2#3#4# + { \@@_generate_conditional_parm:NNNpnn \cs_new_protected:Npn p } +\cs_set_protected:Npn \@@_generate_conditional_parm:NNNpnn #1#2#3#4# { \use:x { - \@@_generate_conditional:nnNnnnnn + \@@_generate_conditional:nnNNNnnn \cs_split_function:N #3 } - {#1} {#2} {#4} + #1 #2 {#4} } % \end{macrocode} % \end{macro} @@ -2172,8 +2193,8 @@ % } % \begin{macro} % { -% \@@_generate_conditional_count:nnNnn , -% \@@_generate_conditional_count:nnNnnnn +% \@@_generate_conditional_count:NNNnn , +% \@@_generate_conditional_count:nnNNNnn % } % The user functions for the types automatically inserting the correct % parameter text based on the signature. The various functions only @@ -2189,26 +2210,26 @@ % later. % \begin{macrocode} \cs_set_protected:Npn \prg_set_conditional:Nnn - { \@@_generate_conditional_count:nnNnn { set } { } } + { \@@_generate_conditional_count:NNNnn \cs_set:Npn e } \cs_set_protected:Npn \prg_new_conditional:Nnn - { \@@_generate_conditional_count:nnNnn { new } { } } + { \@@_generate_conditional_count:NNNnn \cs_new:Npn e } \cs_set_protected:Npn \prg_set_protected_conditional:Nnn - { \@@_generate_conditional_count:nnNnn { set } { _protected } } + { \@@_generate_conditional_count:NNNnn \cs_set_protected:Npn p } \cs_set_protected:Npn \prg_new_protected_conditional:Nnn - { \@@_generate_conditional_count:nnNnn { new } { _protected } } -\cs_set_protected:Npn \@@_generate_conditional_count:nnNnn #1#2#3 + { \@@_generate_conditional_count:NNNnn \cs_new_protected:Npn p } +\cs_set_protected:Npn \@@_generate_conditional_count:NNNnn #1#2#3 { \use:x { - \@@_generate_conditional_count:nnNnnnn + \@@_generate_conditional_count:nnNNNnn \cs_split_function:N #3 } - {#1} {#2} + #1 #2 } -\cs_set_protected:Npn \@@_generate_conditional_count:nnNnnnn #1#2#3#4#5 +\cs_set_protected:Npn \@@_generate_conditional_count:nnNNNnn #1#2#3#4#5 { \__kernel_cs_parm_from_arg_count:nnF - { \@@_generate_conditional:nnNnnnnn {#1} {#2} #3 {#4} {#5} } + { \@@_generate_conditional:nnNNNnnn {#1} {#2} #3 #4 #5 } { \tl_count:n {#2} } { \__kernel_msg_error:nnxx { kernel } { bad-number-of-arguments } @@ -2223,8 +2244,10 @@ % % \begin{macro} % { -% \@@_generate_conditional:nnNnnnnn, -% \@@_generate_conditional:nnnnnnw +% \@@_generate_conditional:nnNNNnnn, +% \@@_generate_conditional:NNnnnnNw, +% \@@_generate_conditional_test:w, +% \@@_generate_conditional_fast:nw, % } % The workhorse here is going through a list of desired forms, \emph{i.e.}, % |p|, |TF|, |T| and |F|. The first three arguments come from splitting up @@ -2236,8 +2259,15 @@ % empty), the seventh is the list of forms to define, the eighth is the % replacement text which we will augment when defining the forms. % The use of \cs{tl_to_str:n} makes the later loop more robust. +% +% A large number of our low-level conditionals look like \meta{code} +% \cs{prg_return_true:} \cs{else:} \cs{prg_return_false:} \cs{fi:} so +% we optimize this special case by calling +% \cs{@@_generate_conditional_fast:nw} \Arg{code}. This passes +% \cs{use_i:nn} instead of \cs{use_i_ii:nnn} to functions such as +% \cs{@@_generate_p_form:wNNnnnnN}. % \begin{macrocode} -\cs_set_protected:Npn \@@_generate_conditional:nnNnnnnn #1#2#3#4#5#6#7#8 +\cs_set_protected:Npn \@@_generate_conditional:nnNNNnnn #1#2#3#4#5#6#7#8 { \if_meaning:w \c_false_bool #3 \__kernel_msg_error:nnx { kernel } { missing-colon } @@ -2246,95 +2276,126 @@ \fi: \use:x { - \exp_not:N \@@_generate_conditional:nnnnnnw - \exp_not:n { {#4} {#5} {#1} {#2} {#6} {#8} } + \exp_not:N \@@_generate_conditional:NNnnnnNw + \exp_not:n { #4 #5 {#1} {#2} {#6} } + \@@_generate_conditional_test:w + #8 \q_mark + \@@_generate_conditional_fast:nw + \prg_return_true: \else: \prg_return_false: \fi: \q_mark + \use_none:n + \exp_not:n { {#8} \use_i_ii:nnn } \tl_to_str:n {#7} \exp_not:n { , \q_recursion_tail , \q_recursion_stop } } } +\cs_set:Npn \@@_generate_conditional_test:w + #1 \prg_return_true: \else: \prg_return_false: \fi: \q_mark #2 + { #2 {#1} } +\cs_set:Npn \@@_generate_conditional_fast:nw #1#2 \exp_not:n #3 + { \exp_not:n { {#1} \use_i:nn } } % \end{macrocode} % Looping through the list of desired forms. First are six arguments % and seventh is the form. Use the form to call the % correct type. If the form does not exist, the \cs{use:c} % construction results in \tn{relax}, and the error message is % displayed (unless the form is empty, to allow for |{T, , F}|), -% then \cs{use_none:nnnnnnn} cleans up. Otherwise, the +% then \cs{use_none:nnnnnnnn} cleans up. Otherwise, the % error message is removed by the variant form. % \begin{macrocode} -\cs_set_protected:Npn \@@_generate_conditional:nnnnnnw #1#2#3#4#5#6#7 , +\cs_set_protected:Npn \@@_generate_conditional:NNnnnnNw #1#2#3#4#5#6#7#8 , { - \if_meaning:w \q_recursion_tail #7 + \if_meaning:w \q_recursion_tail #8 \exp_after:wN \use_none_delimit_by_q_recursion_stop:w \fi: - \use:c { @@_generate_ #7 _form:wnnnnnn } - \tl_if_empty:nF {#7} + \use:c { @@_generate_ #8 _form:wNNnnnnN } + \tl_if_empty:nF {#8} { \__kernel_msg_error:nnxx { kernel } { conditional-form-unknown } - {#7} { \token_to_str:c { #3 : #4 } } + {#8} { \token_to_str:c { #3 : #4 } } } - \use_none:nnnnnnn + \use_none:nnnnnnnn \q_stop - {#1} {#2} {#3} {#4} {#5} {#6} - \@@_generate_conditional:nnnnnnw {#1} {#2} {#3} {#4} {#5} {#6} + #1 #2 {#3} {#4} {#5} {#6} #7 + \@@_generate_conditional:NNnnnnNw #1 #2 {#3} {#4} {#5} {#6} #7 } % \end{macrocode} % \end{macro} % % \begin{macro} % { -% \@@_generate_p_form:wnnnnnn, -% \@@_generate_TF_form:wnnnnnn, -% \@@_generate_T_form:wnnnnnn, -% \@@_generate_F_form:wnnnnnn +% \@@_generate_p_form:wNNnnnnN, +% \@@_generate_TF_form:wNNnnnnN, +% \@@_generate_T_form:wNNnnnnN, +% \@@_generate_F_form:wNNnnnnN % } +% \begin{macro}[EXP]{\@@_p_true:w} % How to generate the various forms. Those functions take the -% following arguments: 1: \texttt{set} or \texttt{new}, 2: empty or -% \texttt{\_protected}, 3: function name 4: signature, 5: parameter -% text (or empty), 6: replacement. Remember that the logic-returning -% functions expect two arguments to be present after \cs{exp_end:}: -% notice the construction of the different variants relies on this, -% and that the |TF| and |F| variants will be slightly faster than the |T| -% version. The |p| form is only valid for expandable tests, we check -% for that by making sure that the second argument is empty. -% \begin{macrocode} -\cs_set_protected:Npn \@@_generate_p_form:wnnnnnn - #1 \q_stop #2#3#4#5#6#7 +% following arguments: 1: junk, 2: \cs{cs_set:Npn} or similar, 3: |p| +% (for protected conditionals) or |e|, 4: function name, 5: signature, +% 6: parameter text, 7: replacement (possibly trimmed by +% \cs{@@_generate_conditional_fast:nw}), 8: \cs{use_i_ii:nnn} or +% \cs{use_i:nn} (for \enquote{fast} conditionals). Remember that the +% logic-returning functions expect two arguments to be present after +% \cs{exp_end:}: notice the construction of the different variants +% relies on this, and that the |TF| and |F| variants will be slightly +% faster than the |T| version. The |p| form is only valid for +% expandable tests, we check for that by making sure that the second +% argument is empty. For \enquote{fast} conditionals, |#7| has an +% extra \cs[no-index]{if_\ldots{}}. To optimize a bit further we +% could replace \cs{exp_after:wN} \cs{use_ii:nnn} and similar by a +% single macro similar to \cs{@@_p_true:w}. The drawback is that if +% the |T| or |F| arguments are actually missing, the recovery from +% the runaway argument would not insert \cs{fi:} back, messing up +% nesting of conditionals. +% \begin{macrocode} +\cs_set_protected:Npn \@@_generate_p_form:wNNnnnnN + #1 \q_stop #2#3#4#5#6#7#8 { - \if_meaning:w \scan_stop: #3 \scan_stop: + \if_meaning:w e #3 \exp_after:wN \use_i:nn \else: \exp_after:wN \use_ii:nn \fi: { - \exp_args:cc { cs_ #2 #3 :Npn } { #4 _p: #5 } #6 - { #7 \exp_end: \c_true_bool \c_false_bool } + #8 + { \exp_args:Nc #2 { #4 _p: #5 } #6 } + { { #7 \exp_end: \c_true_bool \c_false_bool } } + { #7 \@@_p_true:w \fi: \c_false_bool } } { \__kernel_msg_error:nnx { kernel } { protected-predicate } { \token_to_str:c { #4 _p: #5 } } } } -\cs_set_protected:Npn \@@_generate_T_form:wnnnnnn - #1 \q_stop #2#3#4#5#6#7 +\cs_set_protected:Npn \@@_generate_T_form:wNNnnnnN + #1 \q_stop #2#3#4#5#6#7#8 { - \exp_args:cc { cs_ #2 #3 :Npn } { #4 : #5 T } #6 - { #7 \exp_end: \use:n \use_none:n } + #8 + { \exp_args:Nc #2 { #4 : #5 T } #6 } + { { #7 \exp_end: \use:n \use_none:n } } + { #7 \exp_after:wN \use_ii:nn \fi: \use_none:n } } -\cs_set_protected:Npn \@@_generate_F_form:wnnnnnn - #1 \q_stop #2#3#4#5#6#7 +\cs_set_protected:Npn \@@_generate_F_form:wNNnnnnN + #1 \q_stop #2#3#4#5#6#7#8 { - \exp_args:cc { cs_ #2 #3 :Npn } { #4 : #5 F } #6 - { #7 \exp_end: { } } + #8 + { \exp_args:Nc #2 { #4 : #5 F } #6 } + { { #7 \exp_end: { } } } + { #7 \exp_after:wN \use_none:nn \fi: \use:n } } -\cs_set_protected:Npn \@@_generate_TF_form:wnnnnnn - #1 \q_stop #2#3#4#5#6#7 +\cs_set_protected:Npn \@@_generate_TF_form:wNNnnnnN + #1 \q_stop #2#3#4#5#6#7#8 { - \exp_args:cc { cs_ #2 #3 :Npn } { #4 : #5 TF } #6 - { #7 \exp_end: } + #8 + { \exp_args:Nc #2 { #4 : #5 TF } #6 } + { { #7 \exp_end: } } + { #7 \exp_after:wN \use_ii:nnn \fi: \use_ii:nn } } +\cs_set:Npn \@@_p_true:w \fi: \c_false_bool { \fi: \c_true_bool } % \end{macrocode} % \end{macro} +% \end{macro} % % \begin{macro}{\prg_set_eq_conditional:NNn, \prg_new_eq_conditional:NNn} % \begin{macro}{\@@_set_eq_conditional:NNNn} @@ -2530,10 +2591,10 @@ % \verb*|\token_to_str:N \ |, and the auxiliary \cs{@@_to_str:w} % is expanded, feeding |-| as a second character for the test; % the test is false, and \TeX{} skips to \cs{fi:}, then performs -% \cs{token_to_str:N}, and stops the \cs{tex_romannumeral:D} with \cs{c_zero}. +% \cs{token_to_str:N}, and stops the \cs{tex_romannumeral:D} with \cs{c_zero_int}. % The last case is that the escape character is itself a space. In this % case, the \cs{if:w} test is true, and the auxiliary \cs{@@_to_str:w} -% comes into play, inserting |-\int_value:w|, which expands \cs{c_zero} +% comes into play, inserting |-\int_value:w|, which expands \cs{c_zero_int} % to the character |0|. The initial \cs{tex_romannumeral:D} then sees % |0|, which is not a terminated number, followed by the escape character, % a space, which is removed, terminating the expansion of @@ -2545,18 +2606,18 @@ { % \end{macrocode} % We implement the expansion scheme using \cs{tex_romannumeral:D} -% terminating it with \cs{c_zero} rather than using \cs{exp:w} and +% terminating it with \cs{c_zero_int} rather than using \cs{exp:w} and % \cs{exp_end:} as we normally do. The reason is that the code -% heavily depends on terminating the expansion with \cs{c_zero} so +% heavily depends on terminating the expansion with \cs{c_zero_int} so % we make this dependency explicit. % \begin{macrocode} \tex_romannumeral:D \if:w \token_to_str:N \ \@@_to_str:w \fi: \exp_after:wN \@@_to_str:N \token_to_str:N } -\cs_set:Npn \@@_to_str:N #1 { \c_zero } +\cs_set:Npn \@@_to_str:N #1 { \c_zero_int } \cs_set:Npn \@@_to_str:w #1 \@@_to_str:N - { - \int_value:w \fi: \exp_after:wN \c_zero } + { - \int_value:w \fi: \exp_after:wN \c_zero_int } % \end{macrocode} % If speed is a concern we could use \tn{csstring} in \LuaTeX{}. For % the empty csname that primitive gives an empty result while the diff --git a/Master/texmf-dist/source/latex/l3kernel/l3bootstrap.dtx b/Master/texmf-dist/source/latex/l3kernel/l3bootstrap.dtx index 7d4e945dbfc..cdc368b575b 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3bootstrap.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3bootstrap.dtx @@ -138,7 +138,7 @@ % }^^A % } % -% \date{Released 2018-04-30} +% \date{Released 2018-05-12} % % \maketitle % @@ -363,8 +363,8 @@ \LineBreak These are available in the engines\LineBreak - pdfTeX v1.40\LineBreak - - XeTeX v0.9994\LineBreak - - LuaTeX v0.70\LineBreak + - XeTeX v0.99992\LineBreak + - LuaTeX v0.76\LineBreak - e-(u)pTeX mid-2012\LineBreak or later.\LineBreak \LineBreak @@ -373,14 +373,21 @@ \expandafter\ifx\csname pdfstrcmp\endcsname\relax \else \expandafter\ifx\csname pdftexversion\endcsname\relax - 1% + \expandafter\ifx\csname Ucharcat\endcsname\relax + \ifx\csname kanjiskip\endcsname\relax + \else + 1% + \fi + \else + 1% + \fi \else \ifnum\pdftexversion<140 \else 1\fi \fi \fi \expandafter\ifx\csname directlua\endcsname\relax \else - \ifnum\luatexversion<70 \else 1\fi + \ifnum\luatexversion<76 \else 1\fi \fi =0 % \newlinechar`\^^J % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3box.dtx b/Master/texmf-dist/source/latex/l3kernel/l3box.dtx index f7e6ad1f824..7e3648f5101 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3box.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3box.dtx @@ -41,7 +41,7 @@ % }^^A % } % -% \date{Released 2018-04-30} +% \date{Released 2018-05-12} % % \maketitle % @@ -850,7 +850,7 @@ % 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} -\cs_new_eq:NN \@@_dim_eval:w \etex_dimexpr:D +\cs_new_eq:NN \@@_dim_eval:w \tex_dimexpr:D \__kernel_patch_args:nNNpn { { @@ -1162,12 +1162,12 @@ { \box_log:Nnn #1 \c_max_int \c_max_int } \cs_generate_variant:Nn \box_log:N { c } \cs_new_protected:Npn \box_log:Nnn - { \exp_args:No \@@_log:nNnn { \tex_the:D \etex_interactionmode:D } } + { \exp_args:No \@@_log:nNnn { \tex_the:D \tex_interactionmode:D } } \cs_new_protected:Npn \@@_log:nNnn #1#2#3#4 { - \int_set:Nn \etex_interactionmode:D { 0 } + \int_set:Nn \tex_interactionmode:D { 0 } \@@_show:NNff 0 #2 { \int_eval:n {#3} } { \int_eval:n {#4} } - \int_set:Nn \etex_interactionmode:D {#1} + \int_set:Nn \tex_interactionmode:D {#1} } \cs_generate_variant:Nn \box_log:Nnn { c } % \end{macrocode} diff --git a/Master/texmf-dist/source/latex/l3kernel/l3candidates.dtx b/Master/texmf-dist/source/latex/l3kernel/l3candidates.dtx index cd1e06fd6c2..1463eba5ce8 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3candidates.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3candidates.dtx @@ -42,7 +42,7 @@ % }^^A % } % -% \date{Released 2018-04-30} +% \date{Released 2018-05-12} % % \maketitle % @@ -101,6 +101,7 @@ % skip, and muskip expressions are not terminated prematurely; % \item \texttt{deprecation} that makes soon-to-be-deprecated commands produce errors; % \item \texttt{log-functions} that logs function definitions; +% \item \texttt{all} that does all of the above. % \end{itemize} % Providing these as switches rather than options allows testing code % even if it relies on other packages: load all other packages, call @@ -281,6 +282,57 @@ % applicable. % \end{function} % +% \section{Additions to \pkg{l3fparray}} +% +% \begin{function}[added = 2018-05-05]{\fparray_new:Nn} +% \begin{syntax} +% \cs{fparray_new:Nn} \meta{fparray~var} \Arg{size} +% \end{syntax} +% Evaluates the integer expression \meta{size} and allocates an +% \meta{floating point array variable} with that number of (zero) +% entries. The variable name should start with |\g_| because +% assignments are always global. +% \end{function} +% +% \begin{function}[EXP, added = 2018-05-05]{\fparray_count:N} +% \begin{syntax} +% \cs{fparray_count:N} \meta{fparray~var} +% \end{syntax} +% Expands to the number of entries in the \meta{floating point array +% variable}. This is performed in constant time. +% \end{function} +% +% \begin{function}[added = 2018-05-05]{\fparray_gset:Nnn} +% \begin{syntax} +% \cs{fparray_gset:Nnn} \meta{fparray~var} \Arg{position} \Arg{value} +% \end{syntax} +% Stores the result of evaluating the floating point expression +% \meta{value} into the \meta{floating point array variable} at the +% (integer expression) \meta{position}. If the \meta{position} is not +% between $1$ and the \cs{fparray_count:N}, an error occurs. +% Assignments are always global. +% \end{function} +% +% \begin{function}[added = 2018-05-05]{\fparray_gzero:N} +% \begin{syntax} +% \cs{fparray_gzero:N} \meta{fparray~var} +% \end{syntax} +% Sets all entries of the \meta{floating point array variable} to +% $+0$. Assignments are always global. +% \end{function} +% +% \begin{function}[EXP, added = 2018-05-05] +% {\fparray_item:Nn, \fparray_item_to_tl:Nn} +% \begin{syntax} +% \cs{fparray_item:Nn} \meta{fparray~var} \Arg{position} +% \end{syntax} +% Applies \cs{fp_use:N} or \cs{fp_to_tl:N} (respectively) to the +% floating point entry stored at the (integer expression) +% \meta{position} in the \meta{floating point array variable}. If the +% \meta{position} is not between $1$ and the \cs{fparray_count:N}, an +% error occurs. +% \end{function} +% % \section{Additions to \pkg{l3file}} % % \begin{function}[added = 2017-07-11]{\file_get_mdfive_hash:nN} @@ -371,6 +423,75 @@ % locally. % \end{function} % +% \section{Additions to \pkg{l3int}} +% +% \begin{function}[EXP, added = 2018-05-05]{\int_rand:n} +% \begin{syntax} +% \cs{int_rand:n} \Arg{intexpr} +% \end{syntax} +% Evaluates the \meta{integer expression} then produces a +% pseudo-random number between $1$ and the \meta{intexpr} (included). +% This is not yet available in \XeTeX{}. +% \end{function} +% +% \section{Additions to \pkg{l3intarray}} +% +% \begin{function}[EXP, added = 2018-05-05]{\intarray_rand_item:N} +% \begin{syntax} +% \cs{intarray_rand_item:N} \meta{intarray~var} +% \end{syntax} +% Selects a pseudo-random item of the \meta{integer array}. If the +% \meta{integer array} is empty, produce an error. This is not yet +% available in \XeTeX{}. +% \end{function} +% +% \begin{function}[added = 2018-05-05]{\intarray_gset_rand:Nnn, \intarray_gset_rand:Nn} +% \begin{syntax} +% \cs{intarray_gset_rand:Nnn} \meta{intarray~var} \Arg{minimum} \Arg{maximum} +% \cs{intarray_gset_rand:Nn} \meta{intarray~var} \Arg{maximum} +% \end{syntax} +% Evaluates the integer expressions \meta{minimum} and \meta{maximum} +% then sets each entry (independently) of the \meta{integer array +% variable} to a pseudo-random number between the two (with bounds +% included). If the absolute value of either bound is bigger than +% $2^{30}-1$, an error occurs. Entries are generated in the same way +% as repeated calls to \cs{int_rand:nn} or \cs{int_rand:n} +% respectively, in particular for the second function the +% \meta{minimum} is $1$. This is not yet available in \XeTeX{}. +% Assignments are always global. +% \end{function} +% +% \subsection{Working with contents of integer arrays} +% +% \begin{function}[added = 2018-05-04, rEXP]{\intarray_const_from_clist:Nn} +% \begin{syntax} +% \cs{intarray_const_from_clist:Nn} \meta{intarray~var} \meta{intexpr clist} +% \end{syntax} +% Creates a new constant \meta{integer array variable} or raises an +% error if the name is already taken. The \meta{integer array +% variable} is set (globally) to contain as its items the results of +% evaluating each \meta{integer expression} in the \meta{comma list}. +% \end{function} +% +% \begin{function}[added = 2018-05-04, rEXP]{\intarray_to_clist:N} +% \begin{syntax} +% \cs{intarray_to_clist:N} \meta{intarray~var} +% \end{syntax} +% Converts the \meta{intarray} to integer denotations separated by +% commas. All tokens have category code other. If the +% \meta{intarray} has no entry the result is empty; otherwise the +% result has one fewer comma than the number of items. +% \end{function} +% +% \begin{function}[added = 2018-05-04]{\intarray_show:N, \intarray_log:N} +% \begin{syntax} +% \cs{intarray_show:N} \meta{intarray~var} +% \cs{intarray_log:N} \meta{intarray~var} +% \end{syntax} +% Displays the items in the \meta{integer array variable} in the +% terminal or writes them in the log file. +% \end{function} +% % \section{Additions to \pkg{l3msg}} % % In very rare cases it may be necessary to produce errors in an @@ -470,6 +591,18 @@ % the result of evaluating the \meta{boolexpr}. % \end{function} % +% \begin{function}[added = 2018-05-10] +% { +% \bool_set_inverse:N , \bool_set_inverse:c , +% \bool_gset_inverse:N, \bool_gset_inverse:c +% } +% \begin{syntax} +% \cs{bool_set_inverse:N} \meta{boolean} +% \end{syntax} +% Toggles the \meta{boolean} from \texttt{true} to \texttt{false} and +% conversely: sets it to the inverse of its current value. +% \end{function} +% % \section{Additions to \pkg{l3prop}} % % \begin{function}[EXP]{\prop_count:N, \prop_count:c} @@ -677,6 +810,26 @@ % \end{texnote} % \end{function} % +% \begin{function}[added = 2018-05-03]{\seq_indexed_map_function:NN} +% \begin{syntax} +% \cs{seq_indexed_map_function:NN} \meta{seq~var} \meta{function} +% \end{syntax} +% Applies \meta{function} to every entry in the \meta{sequence +% variable}. The \meta{function} should have signature |:nn|. It +% receives two arguments for each iteration: the \meta{index} (namely +% |1| for the first entry, then |2| and so on) and the \meta{item}. +% \end{function} +% +% \begin{function}[added = 2018-05-03]{\seq_indexed_map_inline:Nn} +% \begin{syntax} +% \cs{seq_indexed_map_inline:Nn} \meta{seq~var} \Arg{inline function} +% \end{syntax} +% Applies \meta{inline function} to every entry in the \meta{sequence +% variable}. The \meta{inline function} should consist of code which +% receives the \meta{index} (namely |1| for the first entry, then |2| +% and so on) as~|#1| and the \meta{item} as~|#2|. +% \end{function} +% % \section{Additions to \pkg{l3skip}} % % \begin{function}{\skip_split_finite_else_action:nnNN} @@ -695,6 +848,27 @@ % % \section{Additions to \pkg{l3sys}} % +% \begin{variable}[added = 2018-05-02]{\c_sys_engine_version_str} +% The version string of the current engine, in the same form as +% given in the banner issued when running a job. For \pdfTeX{} +% and \LuaTeX{} this is of the form +% \begin{quote} +% \meta{major}.\meta{minor}.\meta{revision} +% \end{quote} +% For \XeTeX{}, the form is +% \begin{quote} +% \meta{major}.\meta{minor} +% \end{quote} +% For \pTeX{} and \upTeX{}, only releases since \TeX{} Live 2018 +% make the data available, and the form is more complex, as it comprises +% the \pTeX{} version, the \upTeX{} version and the e-\pTeX{} version. +% \begin{quote} +% p\meta{major}.\meta{minor}.\meta{revision}-u\meta{major}.\meta{minor}^^A +% -\meta{epTeX} +% \end{quote} +% where the |u| part is only present for \upTeX{}. +% \end{variable} +% % \begin{function}[added = 2017-05-27, EXP, pTF]{\sys_if_rand_exist:} % \begin{syntax} % \cs{sys_if_rand_exist_p:} @@ -1297,8 +1471,8 @@ % \begin{macrocode} \cs_new_protected:Npx \mode_leave_vertical: { - \cs_if_exist:NTF \pdftex_quitvmode:D - { \pdftex_quitvmode:D } + \cs_if_exist:NTF \tex_quitvmode:D + { \tex_quitvmode:D } { \exp_not:n { @@ -1963,7 +2137,7 @@ % using \cs{file_get_full_name:nN} and so are non-expandable \texttt{get} % functions. Much of the code is repetitive but we need to branch for % \LuaTeX{} (emulation in Lua), for the slightly different syntax -% needed for \tn{pdftex_mdfivesum:D} and for the fact that primitive +% needed for \tn{tex_mdfivesum:D} and for the fact that primitive % coverage varies in other engines. % \begin{macrocode} \cs_new_protected:Npn \file_get_mdfive_hash:nN #1#2 @@ -1977,7 +2151,7 @@ \file_get_full_name:nN {#1} \l_@@_full_name_str \str_set:Nx #3 { - \use:c { pdftex_file #2 :D } \exp_after:wN + \use:c { tex_file #2 :D } \exp_after:wN { \l_@@_full_name_str } } } @@ -2002,7 +2176,7 @@ \file_get_full_name:nN {#1} \l_@@_full_name_str \tl_set:Nx #2 { - \pdftex_mdfivesum:D file \exp_after:wN + \tex_mdfivesum:D file \exp_after:wN { \l_@@_full_name_str } } } @@ -2197,6 +2371,19 @@ % \end{macrocode} % \end{macro} % +% \begin{macro}[added = 2018-05-10] +% {\bool_set_inverse:N, \bool_set_inverse:c, \bool_gset_inverse:N, \bool_gset_inverse:c} +% Set to \texttt{false} or \texttt{true} locally or globally. +% \begin{macrocode} +\cs_new_protected:Npn \bool_set_inverse:N #1 + { \bool_if:NTF #1 { \bool_set_false:N } { \bool_set_true:N } #1 } +\cs_generate_variant:Nn \bool_set_inverse:N { c } +\cs_new_protected:Npn \bool_gset_inverse:N #1 + { \bool_if:NTF #1 { \bool_gset_false:N } { \bool_gset_true:N } #1 } +\cs_generate_variant:Nn \bool_gset_inverse:N { c } +% \end{macrocode} +% \end{macro} +% % \subsection{Additions to \pkg{l3prop}} % % \begin{macrocode} @@ -2433,14 +2620,14 @@ % \begin{macro}{\seq_shuffle:N, \seq_gshuffle:N, \@@_shuffle:NN, \@@_shuffle_item:n} % \begin{variable}{\g_@@_internal_seq, \l_@@_internal_a_int, \l_@@_internal_b_int} % We apply the Fisher–Yates shuffle, storing items in \tn{toks} -% registers. We use the primitive \cs{pdftex_uniformdeviate:D} for +% registers. We use the primitive \cs{tex_uniformdeviate:D} for % speed reasons. Its non-uniformity is of order its argument divided % by $2^{28}$, not too bad for small lists. For sequences with more % than $13$ elements there are more possible permutations than % possible seeds ($13!>2^{28}$) so the question of uniformity is % somewhat moot. % \begin{macrocode} -\cs_if_exist:NTF \pdftex_uniformdeviate:D +\cs_if_exist:NTF \tex_uniformdeviate:D { \int_new:N \l_@@_internal_a_int \int_new:N \l_@@_internal_b_int @@ -2471,7 +2658,7 @@ { \int_incr:N \l_@@_internal_a_int \int_set:Nn \l_@@_internal_b_int - { 1 + \pdftex_uniformdeviate:D \l_@@_internal_a_int } + { 1 + \tex_uniformdeviate:D \l_@@_internal_a_int } \tex_toks:D \l_@@_internal_a_int = \tex_toks:D \l_@@_internal_b_int \tex_toks:D \l_@@_internal_b_int @@ -2487,13 +2674,60 @@ } { \cs_new_protected:Npn \seq_shuffle:N #1 - { \__kernel_msg_error:nn { kernel } { fp-no-random } } + { + \__kernel_msg_error:nnn { kernel } { fp-no-random } + { \seq_shuffle:N #1 } + } \cs_new_eq:NN \seq_gshuffle:N \seq_shuffle:N } % \end{macrocode} % \end{variable} % \end{macro} % +% \begin{macro} +% { +% \seq_indexed_map_function:NN, \seq_indexed_map_inline:Nn, +% \@@_indexed_map:nNN, \@@_indexed_map:Nw +% } +% Similar to \cs{seq_map_function:NN} but we keep track of the item +% index as a |;|-delimited argument of \cs{@@_indexed_map:Nw}. +% \begin{macrocode} +\cs_new:Npn \seq_indexed_map_function:NN #1#2 + { + \@@_indexed_map:NN #1#2 + \prg_break_point:Nn \seq_map_break: { } + } +\cs_new_protected:Npn \seq_indexed_map_inline:Nn #1#2 + { + \int_gincr:N \g__kernel_prg_map_int + \cs_gset_protected:cpn + { @@_map_ \int_use:N \g__kernel_prg_map_int :w } ##1##2 {#2} + \exp_args:NNc \@@_indexed_map:NN #1 + { @@_map_ \int_use:N \g__kernel_prg_map_int :w } + \prg_break_point:Nn \seq_map_break: + { \int_gdecr:N \g__kernel_prg_map_int } + } +\cs_new:Npn \@@_indexed_map:NN #1#2 + { + \exp_after:wN \@@_indexed_map:Nw + \exp_after:wN #2 + \int_value:w 1 + \exp_after:wN \use_i:nn + \exp_after:wN ; + #1 + \prg_break: \@@_item:n { } \prg_break_point: + } +\cs_new:Npn \@@_indexed_map:Nw #1#2 ; #3 \@@_item:n #4 + { + #3 + #1 {#2} {#4} + \exp_after:wN \@@_indexed_map:Nw + \exp_after:wN #1 + \int_value:w \int_eval:w 1 + #2 ; + } +% \end{macrocode} +% \end{macro} +% % \subsection{Additions to \pkg{l3skip}} % % \begin{macrocode} @@ -2512,8 +2746,8 @@ { \skip_if_finite:nTF {#1} { - #3 = \etex_gluestretch:D #1 \scan_stop: - #4 = \etex_glueshrink:D #1 \scan_stop: + #3 = \tex_gluestretch:D #1 \scan_stop: + #4 = \tex_glueshrink:D #1 \scan_stop: } { #3 = \c_zero_skip @@ -2530,28 +2764,99 @@ %<@@=sys> % \end{macrocode} % -% \begin{macro}[EXP, pTF]{\sys_if_rand_exist:} -% Currently, randomness exists under \pdfTeX{}, \LuaTeX{}, \pTeX{} and \upTeX{}. +% \begin{variable}{\c_sys_engine_version_str} +% Various different engines, various different ways to extract the +% data! % \begin{macrocode} -\@@_const:nn { sys_if_rand_exist } - { \cs_if_exist_p:N \pdftex_uniformdeviate:D } +\str_const:Nx \c_sys_engine_version_str + { + \str_case:on \c_sys_engine_str + { + { pdftex } + { + \fp_eval:n { round(\int_use:N \tex_pdftexversion:D / 100 , 2) } + . + \tex_pdftexrevision:D + } + { ptex } + { + \cs_if_exist:NT \tex_ptexversion:D + { + p + \int_use:N \tex_ptexversion:D + \int_use:N \tex_ptexminorversion:D + \tex_ptexrevision:D + - + \int_use:N \tex_epTeXversion:D + } + } + { luatex } + { + \fp_eval:n { round(\int_use:N \tex_luatexversion:D / 100, 2) } + . + \tex_luatexrevision:D + } + { uptex } + { + \cs_if_exist:NT \tex_ptexversion:D + { + p + \int_use:N \tex_ptexversion:D + \int_use:N \tex_ptexminorversion:D + \tex_ptexrevision:D + - + u + \int_use:N \tex_uptexversion:D + \tex_uptexrevision:D + - + \int_use:N \tex_epTeXversion:D + } + } + { xetex } + { + \int_use:N \tex_XeTeXversion:D + . + \tex_XeTeXrevision:D + } + } + } % \end{macrocode} -% \end{macro} +% \end{variable} % % \begin{macro}[EXP]{\sys_rand_seed:} -% Unpack the primitive. +% Unpack the primitive. When random numbers are not available, we +% return zero after an error (and incidentally make sure the number of +% expansions needed is the same as with random numbers available). % \begin{macrocode} -\cs_new:Npn \sys_rand_seed: { \tex_the:D \pdftex_randomseed:D } -\cs_if_exist:NF \pdftex_randomseed:D - { \cs_set:Npn \sys_rand_seed: { 0 } } +\sys_if_rand_exist:TF + { \cs_new:Npn \sys_rand_seed: { \tex_the:D \tex_randomseed:D } } + { + \cs_new:Npn \sys_rand_seed: + { + \int_value:w + \__kernel_msg_expandable_error:nnn { kernel } { fp-no-random } + { \sys_rand_seed: } + \c_zero_int + } + } % \end{macrocode} % \end{macro} % % \begin{macro}{\sys_gset_rand_seed:n} % The primitive always assigns the seed globally. % \begin{macrocode} -\cs_new_protected:Npn \sys_gset_rand_seed:n #1 - { \pdftex_setrandomseed:D \int_eval:n {#1} \exp_stop_f: } +\sys_if_rand_exist:TF + { + \cs_new_protected:Npn \sys_gset_rand_seed:n #1 + { \tex_setrandomseed:D \int_eval:n {#1} \exp_stop_f: } + } + { + \cs_new_protected:Npn \sys_gset_rand_seed:n #1 + { + \__kernel_msg_error:nnn { kernel } { fp-no-random } + { \sys_gset_rand_seed:n {#1} } + } + } % \end{macrocode} % \end{macro} % @@ -2562,11 +2867,11 @@ { \sys_if_engine_luatex:TF { - \luatex_directlua:D + \tex_directlua:D { tex.sprint(status.shell_escape~or~os.execute()) } } { - \pdftex_shellescape:D + \tex_shellescape:D } } % \end{macrocode} @@ -2652,12 +2957,16 @@ \prg_new_conditional:Npnn \tl_if_single_token:n #1 { p , T , F , TF } { \tl_if_head_is_N_type:nTF {#1} - { \@@_if_empty_return:o { \use_none:n #1 } } + { \@@_if_empty_if:o { \use_none:n #1 } } { \tl_if_empty:nTF {#1} - { \prg_return_false: } - { \@@_if_empty_return:o { \exp:w \exp_end_continue_f:w #1 } } + { \if_false: } + { \@@_if_empty_if:o { \exp:w \exp_end_continue_f:w #1 } } } + \prg_return_true: + \else: + \prg_return_false: + \fi: } % \end{macrocode} % \end{macro} @@ -2708,7 +3017,7 @@ % The token count is computed through an \cs{int_eval:n} construction. % Each \texttt{1+} is output to the \emph{left}, into the integer % expression, and the sum is ended by the \cs{exp_end:} inserted by -% \cs{@@_act_end:wn} (which is technically implemented as \cs{c_zero}). +% \cs{@@_act_end:wn} (which is technically implemented as \cs{c_zero_int}). % Somewhat a hack! % \begin{macrocode} \cs_new:Npn \tl_count_tokens:n #1 @@ -2757,7 +3066,7 @@ { \__kernel_file_missing:n {#4} } { \group_begin: - \exp_args:No \etex_everyeof:D + \exp_args:No \tex_everyeof:D { \c_@@_rescan_marker_tl \exp_not:N } #3 \scan_stop: \exp_after:wN \@@_from_file_do:w @@ -2801,7 +3110,7 @@ { \__kernel_file_missing:n {#4} } { \group_begin: - \etex_everyeof:D { \exp_not:N } + \tex_everyeof:D { \exp_not:N } #3 \scan_stop: \tl_set:Nx \l_@@_internal_a_tl { \tex_input:D \l_@@_file_name_str \c_space_token } diff --git a/Master/texmf-dist/source/latex/l3kernel/l3clist.dtx b/Master/texmf-dist/source/latex/l3kernel/l3clist.dtx index 8825e0c6dab..a89220df2eb 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3clist.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3clist.dtx @@ -43,17 +43,21 @@ % }^^A % } % -% \date{Released 2018-04-30} +% \date{Released 2018-05-12} % % \maketitle % % \begin{documentation} % % Comma lists contain ordered data where items can be added to the left -% or right end of the list. The features of this data type largely -% overlap with those of the sequence data type, for instance applying a -% function to every item, removing duplicate items, extracting a given -% item, using the comma list with specified separators, and so on. +% or right end of the list. This data type allows basic list +% manipulations such as adding/removing items, applying a function to +% every item, removing duplicate items, extracting a given item, using +% the comma list with specified separators, and so on. Sequences +% (defined in \pkg{l3seq}) are safer, faster, and provide more features, +% so they should often be preferred to comma lists. Comma lists are +% mostly useful when interfacing with \LaTeXe{} or other code that +% expects or provides comma list data. % % Several items can be added at once. To ease input of comma lists from % data provided by a user outside an \cs{ExplSyntaxOn} \ldots{} @@ -81,9 +85,7 @@ % or ends with a space, or is a single brace group), surround it with % braces. % -% Comma lists are particularly useful when implementing user interfaces, -% or when interfacing with \LaTeXe{} or other code that expects or -% provides comma list data. Almost all operations on comma lists are +% Almost all operations on comma lists are % noticeably slower than those on sequences so converting the data to % sequences using \cs{seq_set_from_clist:Nn} (see \pkg{l3seq}) may be % advisable if speed is important. The exception is that diff --git a/Master/texmf-dist/source/latex/l3kernel/l3coffins.dtx b/Master/texmf-dist/source/latex/l3kernel/l3coffins.dtx index 97f964fe7f7..c30fcdb5cfc 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3coffins.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3coffins.dtx @@ -41,7 +41,7 @@ % }^^A % } % -% \date{Released 2018-04-30} +% \date{Released 2018-05-12} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3color-base.dtx b/Master/texmf-dist/source/latex/l3kernel/l3color-base.dtx index 73d2b459aaf..a16e980550c 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3color-base.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3color-base.dtx @@ -41,7 +41,7 @@ % }^^A % } % -% \date{Released 2018-04-30} +% \date{Released 2018-05-12} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3deprecation.dtx b/Master/texmf-dist/source/latex/l3kernel/l3deprecation.dtx index ca8a79b3227..0630ede3626 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3deprecation.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3deprecation.dtx @@ -41,7 +41,7 @@ % }^^A % } % -% \date{Released 2018-04-30} +% \date{Released 2018-05-12} % % \maketitle % @@ -73,7 +73,7 @@ % \begin{macrocode} \cs_new_protected:Npn \__kernel_deprecation_error:Nnn #1#2#3 { - \etex_protected:D \tex_outer:D \tex_edef:D #1 + \tex_protected:D \tex_outer:D \tex_edef:D #1 { \exp_not:N \__kernel_msg_expandable_error:nnnnn { kernel } { deprecated-command } @@ -176,6 +176,71 @@ % \end{macrocode} % \end{macro} % +% \begin{macro}[deprecated = 2019-12-31]{\etex_beginL:D} +% \begin{macro}{\@@_primitive:NN, \@@_primitive:w} +% We renamed all primitives to \cs[no-index]{tex_\ldots{}:D} so all +% others are deprecated. In \pkg{l3names}, \cs{__kernel_primitives:} +% is defined to contain \cs{__kernel_primitive:NN} \cs{beginL} +% \cs{etex_beginL:D} and so on, one for each deprecated primitive. We +% apply \cs{exp_not:N} to the second argument of +% \cs{__kernel_primitive:NN} because it may be outer (both when doing +% and undoing deprecation actually), then \cs{@@_primitive:NN} uses +% \cs{tex_let:D} to change the meaning of this potentially outer +% token. Then, either turn it into an error or make it equal to the +% primitive~|#1|. To be more precise, |#1| may not be defined, so try +% a \cs[no-index]{tex_\ldots{}:D} command as well. +% \begin{macrocode} +\cs_new_protected:Npn \@@_primitive:NN #1#2 { } +\exp_last_unbraced:NNNNo + \cs_new:Npn \@@_primitive:w #1 { \token_to_str:N _ } { } +\__kernel_deprecation_code:nn + { + \cs_set_protected:Npn \__kernel_primitive:NN #1 + { + \exp_after:wN \@@_primitive:NN + \exp_after:wN #1 + \exp_not:N + } + \cs_set_protected:Npn \@@_primitive:NN #1#2 + { + \tex_let:D #2 \scan_stop: + \exp_args:NNx \__kernel_deprecation_error:Nnn #2 + { + \iow_char:N \\ + \cs_if_exist:NTF #1 + { \cs_to_str:N #1 } + { + tex_ + \exp_last_unbraced:Nf + \@@_primitive:w { \cs_to_str:N #2 } + } + } + { 2019-12-31 } + } + \__kernel_primitives: + } + { + \cs_set_protected:Npn \__kernel_primitive:NN #1 + { + \exp_after:wN \@@_primitive:NN + \exp_after:wN #1 + \exp_not:N + } + \cs_set_protected:Npn \@@_primitive:NN #1#2 + { + \tex_let:D #2 #1 + \cs_if_exist:cT { tex_ \cs_to_str:N #1 :D } + { + \exp_args:NNc \cs_set_eq:NN #2 + { tex_ \cs_to_str:N #1 :D } + } + } + \__kernel_primitives: + } +% \end{macrocode} +% \end{macro} +% \end{macro} +% % \begin{macrocode} %</initex|package> % \end{macrocode} diff --git a/Master/texmf-dist/source/latex/l3kernel/l3doc.dtx b/Master/texmf-dist/source/latex/l3kernel/l3doc.dtx index 16ccbe2bff8..fc625ac8e1b 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3doc.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3doc.dtx @@ -77,7 +77,7 @@ and all files in that bundle must be distributed together. % % \title{The \cls{l3doc} class} % \author{\Team} -% \date{Released 2018-04-30} +% \date{Released 2018-05-12} % \maketitle % \tableofcontents % @@ -3855,10 +3855,10 @@ and all files in that bundle must be distributed together. } \tl_if_empty:NF \l_@@_tmpa_tl { - \int_set:Nn \l_@@_tmpa_int { \etex_interactionmode:D } + \int_set:Nn \l_@@_tmpa_int { \tex_interactionmode:D } \errorstopmode \ClassError { l3doc } { \l_@@_tmpa_tl } { } - \int_set:Nn \etex_interactionmode:D { \l_@@_tmpa_int } + \int_set:Nn \tex_interactionmode:D { \l_@@_tmpa_int } } } } diff --git a/Master/texmf-dist/source/latex/l3kernel/l3docstrip.dtx b/Master/texmf-dist/source/latex/l3kernel/l3docstrip.dtx index 566457d6f5b..c61d696c5a3 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3docstrip.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3docstrip.dtx @@ -61,7 +61,7 @@ % }^^A % } % -% \date{Released 2018-04-30} +% \date{Released 2018-05-12} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3drivers.dtx b/Master/texmf-dist/source/latex/l3kernel/l3drivers.dtx index 1e830a52e62..00c271c91e9 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3drivers.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3drivers.dtx @@ -41,7 +41,7 @@ % }^^A % } % -% \date{Released 2018-04-30} +% \date{Released 2018-05-12} % % \maketitle % @@ -481,23 +481,23 @@ %<*package> \ProvidesExplFile %<*dvipdfmx> - {l3dvidpfmx.def}{2018-04-30}{} + {l3dvidpfmx.def}{2018-05-12}{} {L3 Experimental driver: dvipdfmx} %</dvipdfmx> %<*dvips> - {l3dvips.def}{2018-04-30}{} + {l3dvips.def}{2018-05-12}{} {L3 Experimental driver: dvips} %</dvips> %<*dvisvgm> - {l3dvisvgm.def}{2018-04-30}{} + {l3dvisvgm.def}{2018-05-12}{} {L3 Experimental driver: dvisvgm} %</dvisvgm> %<*pdfmode> - {l3pdfmode.def}{2018-04-30}{} + {l3pdfmode.def}{2018-05-12}{} {L3 Experimental driver: PDF mode} %</pdfmode> %<*xdvipdfmx> - {l3xdvidpfmx.def}{2018-04-30}{} + {l3xdvidpfmx.def}{2018-05-12}{} {L3 Experimental driver: xdvipdfmx} %</xdvipdfmx> %</package> @@ -738,18 +738,18 @@ { \@@_color_select:n { /#1 ~ cs ~ /#1 ~ CS ~ #2 ~ sc ~ #2 ~ SC } } \cs_new_protected:Npx \@@_color_select:n #1 { - \cs_if_exist:NTF \luatex_pdfextension:D - { \luatex_pdfextension:D colorstack } - { \pdftex_pdfcolorstack:D } + \cs_if_exist:NTF \tex_pdfextension:D + { \tex_pdfextension:D colorstack } + { \tex_pdfcolorstack:D } \exp_not:N \l_@@_color_stack_int push {#1} \group_insert_after:N \exp_not:N \@@_color_reset: } \cs_generate_variant:Nn \@@_color_select:n { x } \cs_new_protected:Npx \@@_color_reset: { - \cs_if_exist:NTF \luatex_pdfextension:D - { \luatex_pdfextension:D colorstack } - { \pdftex_pdfcolorstack:D } + \cs_if_exist:NTF \tex_pdfextension:D + { \tex_pdfextension:D colorstack } + { \tex_pdfcolorstack:D } \exp_not:N \l_@@_color_stack_int pop \scan_stop: } % \end{macrocode} @@ -1349,9 +1349,9 @@ % \begin{macrocode} \cs_new_protected:Npx \@@_literal_pdf:n #1 { - \cs_if_exist:NTF \luatex_pdfextension:D - { \luatex_pdfextension:D literal } - { \pdftex_pdfliteral:D } + \cs_if_exist:NTF \tex_pdfextension:D + { \tex_pdfextension:D literal } + { \tex_pdfliteral:D } { \exp_not:N \exp_not:n {#1} } } \cs_generate_variant:Nn \@@_literal_pdf:n { x } @@ -1363,15 +1363,15 @@ % \begin{macrocode} \cs_new_protected:Npx \@@_scope_begin: { - \cs_if_exist:NTF \luatex_pdfextension:D - { \luatex_pdfextension:D save \scan_stop: } - { \pdftex_pdfsave:D } + \cs_if_exist:NTF \tex_pdfextension:D + { \tex_pdfextension:D save \scan_stop: } + { \tex_pdfsave:D } } \cs_new_protected:Npx \@@_scope_end: { - \cs_if_exist:NTF \luatex_pdfextension:D - { \luatex_pdfextension:D restore \scan_stop: } - { \pdftex_pdfrestore:D } + \cs_if_exist:NTF \tex_pdfextension:D + { \tex_pdfextension:D restore \scan_stop: } + { \tex_pdfrestore:D } } % \end{macrocode} % \end{macro} @@ -1383,9 +1383,9 @@ % \begin{macrocode} \cs_new_protected:Npx \@@_matrix:n #1 { - \cs_if_exist:NTF \luatex_pdfextension:D - { \luatex_pdfextension:D setmatrix } - { \pdftex_pdfsetmatrix:D } + \cs_if_exist:NTF \tex_pdfextension:D + { \tex_pdfextension:D setmatrix } + { \tex_pdfsetmatrix:D } { \exp_not:N \exp_not:n {#1} } } \cs_generate_variant:Nn \@@_matrix:n { x } @@ -1542,13 +1542,13 @@ } % \begin{macrocode} % Measuring the image is done by boxing up: for PDF images we could -% use |\pdftex_pdfximagebbox:D|, but if doesn't work for other types. +% use |\tex_pdfximagebbox:D|, but if doesn't work for other types. % As the box always starts at $(0,0)$ there is no need to worry about % the lower-left position. % \begin{macrocode} \cs_new_protected:Npn \@@_image_getbb_auxii:n #1 { - \tex_immediate:D \pdftex_pdfximage:D + \tex_immediate:D \tex_pdfximage:D \bool_lazy_or:nnT { \l_image_interpolate_bool } { ! \tl_if_empty_p:N \l_image_decodearray_tl } @@ -1567,11 +1567,11 @@ { \l_image_pagebox_tl } {#1} \hbox_set:Nn \l_@@_tmp_box - { \pdftex_pdfrefximage:D \pdftex_pdflastximage:D } + { \tex_pdfrefximage:D \tex_pdflastximage:D } \dim_set:Nn \l_image_urx_dim { \box_wd:N \l_@@_tmp_box } \dim_set:Nn \l_image_ury_dim { \box_ht:N \l_@@_tmp_box } \int_const:cn { c_@@_image_ #1 \l_@@_image_attr_tl _int } - { \tex_the:D \pdftex_pdflastximage:D } + { \tex_the:D \tex_pdflastximage:D } \image_bb_save:x { #1 \l_@@_image_attr_tl } } % \end{macrocode} @@ -1586,7 +1586,7 @@ % \begin{macrocode} \cs_new_protected:Npn \@@_image_include_jpg:n #1 { - \pdftex_pdfrefximage:D + \tex_pdfrefximage:D \int_use:c { c_@@_image_ #1 \l_@@_image_attr_tl _int } } \cs_new_eq:NN \@@_image_include_pdf:n \@@_image_include_jpg:n @@ -1870,14 +1870,14 @@ { \int_zero:N \l_image_page_int \tl_clear:N \l_image_pagebox_tl - \@@_image_getbb_auxi:nN {#1} \xetex_picfile:D + \@@_image_getbb_auxi:nN {#1} \tex_XeTeXpicfile:D } \cs_new_eq:NN \@@_image_getbb_png:n \@@_image_getbb_jpg:n \cs_new_protected:Npn \@@_image_getbb_pdf:n #1 { \tl_clear:N \l_image_decode_tl \bool_set_false:N \l_image_interpolate_bool - \@@_image_getbb_auxi:nN {#1} \xetex_pdffile:D + \@@_image_getbb_auxi:nN {#1} \tex_XeTeXpdffile:D } \cs_new_protected:Npn \@@_image_getbb_auxi:nN #1#2 { @@ -1928,13 +1928,13 @@ % % \begin{macro}{\@@_image_include_pdf:n} % For PDF images, properly supporting the |pagebox| concept in \XeTeX{} -% is best done using the |\xetex_pdffile:D| primitive. The syntax here +% is best done using the |\tex_XeTeXpdffile:D| primitive. The syntax here % is the same as for the image measurement part, although we know at this % stage that there must be some valid setting for \cs{l_image_pagebox_tl}. % \begin{macrocode} \cs_new_protected:Npn \@@_image_include_pdf:n #1 { - \xetex_pdffile:D "#1" ~ + \tex_XeTeXpdffile:D "#1" ~ \int_compare:nNnT \l_image_page_int > 0 { page~ \int_use:N \l_image_page_int } \@@_image_getbb_auxiv:VnNnn \l_image_pagebox_tl diff --git a/Master/texmf-dist/source/latex/l3kernel/l3expan.dtx b/Master/texmf-dist/source/latex/l3kernel/l3expan.dtx index 46c4acf4cec..be337acfb7b 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3expan.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3expan.dtx @@ -41,7 +41,7 @@ % }^^A % } % -% \date{Released 2018-04-30} +% \date{Released 2018-05-12} % % \maketitle % @@ -521,6 +521,7 @@ % \exp_last_unbraced:Nf, % \exp_last_unbraced:NNo, % \exp_last_unbraced:NNV, +% \exp_last_unbraced:NNf, % \exp_last_unbraced:Nco, % \exp_last_unbraced:NcV, % \exp_last_unbraced:Nno, @@ -528,8 +529,10 @@ % \exp_last_unbraced:Nfo, % \exp_last_unbraced:NNNo, % \exp_last_unbraced:NNNV, +% \exp_last_unbraced:NNNf, % \exp_last_unbraced:NnNo, % \exp_last_unbraced:NNNNo, +% \exp_last_unbraced:NNNNf, % } % \begin{syntax} % \cs{exp_last_unbraced:Nno} \meta{token} \Arg{tokens_1} \Arg{tokens_2} @@ -1424,15 +1427,18 @@ % \exp_last_unbraced:Nf, % \exp_last_unbraced:NNo, % \exp_last_unbraced:NNV, +% \exp_last_unbraced:NNf, % \exp_last_unbraced:Nco, % \exp_last_unbraced:NcV, % \exp_last_unbraced:NNNo, % \exp_last_unbraced:NNNV, +% \exp_last_unbraced:NNNf, % \exp_last_unbraced:Nno, % \exp_last_unbraced:Noo, % \exp_last_unbraced:Nfo, % \exp_last_unbraced:NnNo, % \exp_last_unbraced:NNNNo, +% \exp_last_unbraced:NNNNf, % } % \begin{macro}{\exp_last_unbraced:Nx} % Now the business end: most of these are hand-tuned for speed, but the @@ -1453,6 +1459,12 @@ \exp_after:wN #2 \exp:w \@@_eval_register:N #3 } +\cs_new:Npn \exp_last_unbraced:NNf #1#2#3 + { + \exp_after:wN #1 + \exp_after:wN #2 + \exp:w \exp_end_continue_f:w #3 + } \cs_new:Npn \exp_last_unbraced:Nco #1#2#3 { \exp_after:wN #1 \cs:w #2 \exp_after:wN \cs_end: #3 } \cs_new:Npn \exp_last_unbraced:NcV #1#2#3 @@ -1470,12 +1482,27 @@ \exp_after:wN #3 \exp:w \@@_eval_register:N #4 } +\cs_new:Npn \exp_last_unbraced:NNNf #1#2#3#4 + { + \exp_after:wN #1 + \exp_after:wN #2 + \exp_after:wN #3 + \exp:w \exp_end_continue_f:w #4 + } \cs_new:Npn \exp_last_unbraced:Nno { \::n \::o_unbraced \::: } \cs_new:Npn \exp_last_unbraced:Noo { \::o \::o_unbraced \::: } \cs_new:Npn \exp_last_unbraced:Nfo { \::f \::o_unbraced \::: } \cs_new:Npn \exp_last_unbraced:NnNo { \::n \::N \::o_unbraced \::: } \cs_new:Npn \exp_last_unbraced:NNNNo #1#2#3#4#5 { \exp_after:wN #1 \exp_after:wN #2 \exp_after:wN #3 \exp_after:wN #4 #5 } +\cs_new:Npn \exp_last_unbraced:NNNNf #1#2#3#4#5 + { + \exp_after:wN #1 + \exp_after:wN #2 + \exp_after:wN #3 + \exp_after:wN #4 + \exp:w \exp_end_continue_f:w #5 + } \cs_new_protected:Npn \exp_last_unbraced:Nx { \::x_unbraced \::: } % \end{macrocode} % \end{macro} @@ -1505,7 +1532,7 @@ % At the kernel level, we need the primitive behaviour to allow expansion % \emph{before} the brace group. % \begin{macrocode} -\cs_new_eq:NN \__kernel_exp_not:w \etex_unexpanded:D +\cs_new_eq:NN \__kernel_exp_not:w \tex_unexpanded:D % \end{macrocode} % \end{macro} % @@ -1520,7 +1547,7 @@ \cs_new:Npn \exp_not:c #1 { \exp_after:wN \exp_not:N \cs:w #1 \cs_end: } \cs_new:Npn \exp_not:o #1 { \__kernel_exp_not:w \exp_after:wN {#1} } \cs_new:Npn \exp_not:f #1 - { \etex_unexpanded:D \exp_after:wN { \exp:w \exp_end_continue_f:w #1 } } + { \tex_unexpanded:D \exp_after:wN { \exp:w \exp_end_continue_f:w #1 } } \cs_new:Npn \exp_not:V #1 { \__kernel_exp_not:w \exp_after:wN diff --git a/Master/texmf-dist/source/latex/l3kernel/l3file.dtx b/Master/texmf-dist/source/latex/l3kernel/l3file.dtx index 25449f418c5..d535536a8c6 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3file.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3file.dtx @@ -42,7 +42,7 @@ % }^^A % } % -% \date{Released 2018-04-30} +% \date{Released 2018-05-12} % % \maketitle % @@ -934,7 +934,7 @@ \exp_args:Nno \use:n { \int_set:Nn \tex_endlinechar:D { -1 } - \etex_readline:D #1 to #2 + \tex_readline:D #1 to #2 \int_set:Nn \tex_endlinechar:D } { \int_use:N \tex_endlinechar:D } } @@ -1020,7 +1020,7 @@ { \bool_lazy_and:nnTF { \sys_if_engine_luatex_p: } - { \int_compare_p:nNn \luatex_luatexversion:D > { 80 } } + { \int_compare_p:nNn \tex_luatexversion:D > { 80 } } { 128 } { 16 } } @@ -2349,7 +2349,7 @@ % Contrarily to most other deprecated commands this is expandable % so we need to put code by hand in two token lists. We use % \cs{tex_def:D} directly because \cs{g_file_current_name_tl} is made -% outer by \cs{debug_deprecation_on:}. +% outer by \cs{debug_on:n} \texttt{\{deprecation\}}. % \begin{macrocode} \tl_new:N \g_file_current_name_tl \tl_gset:Nn \g_file_current_name_tl { \g_file_curr_name_str } diff --git a/Master/texmf-dist/source/latex/l3kernel/l3final.dtx b/Master/texmf-dist/source/latex/l3kernel/l3final.dtx index 1772a41914f..e7180952553 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3final.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3final.dtx @@ -41,7 +41,7 @@ % }^^A % } % -% \date{Released 2018-04-30} +% \date{Released 2018-05-12} % % \maketitle % @@ -122,7 +122,7 @@ % the set up is easier. % \begin{macrocode} \sys_if_engine_uptex:T - { \uptex_disablecjktoken:D } + { \tex_disablecjktoken:D } % \end{macrocode} % The actual mappings: these are kept low-level for performance reasons. % \begin{macrocode} @@ -335,8 +335,8 @@ % \begin{macrocode} \dim_set:Nn \tex_hsize:D { 345pt } \skip_set:Nn \tex_parfillskip:D { 0pt plus 1fil } -\cs_if_exist:NT \pdftex_pdfoutput:D - { \int_set:Nn \pdftex_pdfoutput:D { 1 } } +\cs_if_exist:NT \tex_pdfoutput:D + { \int_set:Nn \tex_pdfoutput:D { 1 } } % \end{macrocode} % % \begin{macro}{\stop} diff --git a/Master/texmf-dist/source/latex/l3kernel/l3flag.dtx b/Master/texmf-dist/source/latex/l3kernel/l3flag.dtx index ab72967823a..be0d1a23f53 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3flag.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3flag.dtx @@ -41,7 +41,7 @@ % }^^A % } % -% \date{Released 2018-04-30} +% \date{Released 2018-05-12} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3format.ins b/Master/texmf-dist/source/latex/l3kernel/l3format.ins index 323ed20b793..7953e36624c 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3format.ins +++ b/Master/texmf-dist/source/latex/l3kernel/l3format.ins @@ -78,6 +78,7 @@ and all files in that bundle must be distributed together. \from{l3file.dtx} {initex} \from{l3skip.dtx} {initex} \from{l3keys.dtx} {initex} + \from{l3intarray.dtx} {initex} \from{l3fp.dtx} {initex} \from{l3fp-aux.dtx} {initex} \from{l3fp-traps.dtx} {initex} @@ -91,7 +92,7 @@ and all files in that bundle must be distributed together. \from{l3fp-trig.dtx} {initex} \from{l3fp-convert.dtx} {initex} \from{l3fp-random.dtx} {initex} - \from{l3intarray.dtx} {initex} + \from{l3fparray.dtx} {package} \from{l3sort.dtx} {initex} \from{l3tl-analysis.dtx}{initex} \from{l3regex.dtx} {initex} diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-assign.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-assign.dtx index f799a1d55bc..8da6dca6551 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3fp-assign.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-assign.dtx @@ -38,7 +38,7 @@ % {latex-team@latex-project.org}^^A % }^^A % } -% \date{Released 2018-04-30} +% \date{Released 2018-05-12} % \maketitle % % \begin{documentation} diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-aux.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-aux.dtx index db486f01c0d..28c4c9bd47e 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3fp-aux.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-aux.dtx @@ -41,7 +41,7 @@ % }^^A % } % -% \date{Released 2018-04-30} +% \date{Released 2018-05-12} % % \maketitle % @@ -71,7 +71,7 @@ % use private names. The same is true for \tn{romannumeral}, although it % is used much less widely. % \begin{macrocode} -\cs_new_eq:NN \@@_int_eval:w \etex_numexpr:D +\cs_new_eq:NN \@@_int_eval:w \tex_numexpr:D \cs_new_eq:NN \@@_int_eval_end: \scan_stop: \cs_new_eq:NN \@@_int_to_roman:w \tex_romannumeral:D % \end{macrocode} @@ -1245,17 +1245,17 @@ % No \pkg{l3sys} or \pkg{l3luatex} just yet so we have to define in terms of % primitives. % \begin{macrocode} -\cs_new:Npn \@@_str_if_eq_x:nn #1#2 { \pdftex_strcmp:D {#1} {#2} } +\cs_new:Npn \@@_str_if_eq_x:nn #1#2 { \tex_strcmp:D {#1} {#2} } \sys_if_engine_luatex:T { \cs_set:Npn \@@_str_if_eq_x:nn #1#2 { - \luatex_directlua:D + \tex_directlua:D { l3kernel.strcmp ( - " \luatex_luaescapestring:D {#1}", - " \luatex_luaescapestring:D {#2}" + " \tex_luaescapestring:D {#1}", + " \tex_luaescapestring:D {#2}" ) } } diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-basics.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-basics.dtx index 76948f5a45c..7b5c7bd8982 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3fp-basics.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-basics.dtx @@ -38,7 +38,7 @@ % {latex-team@latex-project.org}^^A % }^^A % } -% \date{Released 2018-04-30} +% \date{Released 2018-05-12} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-convert.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-convert.dtx index 7d32164b5b9..5bd0662a69b 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3fp-convert.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-convert.dtx @@ -41,7 +41,7 @@ % }^^A % } % -% \date{Released 2018-04-30} +% \date{Released 2018-05-12} % % \maketitle % @@ -503,7 +503,7 @@ \exp_after:wN \@@_from_dim_test:ww \exp_after:wN 0 \exp_after:wN , - \int_value:w \etex_glueexpr:D #1 ; + \int_value:w \tex_glueexpr:D #1 ; } \cs_new:Npn \@@_from_dim_test:ww #1, #2 { diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-expo.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-expo.dtx index bda1371504a..7cd493a7eff 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3fp-expo.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-expo.dtx @@ -38,7 +38,7 @@ % {latex-team@latex-project.org}^^A % }^^A % } -% \date{Released 2018-04-30} +% \date{Released 2018-05-12} % % \maketitle % @@ -720,17 +720,88 @@ % \end{macro} % \end{macro} % +% \begin{variable}{\c_@@_exp_intarray} +% The integer array has $6\times 9\times 4=216$ items encoding the +% values of $\exp(j\times 10^i)$ for $j=1,\dots,9$ and $i=-1,\dots,4$. +% Each value is expressed as $\simeq 10^p \times 0.m_1m_2m_3$ with +% three $8$-digit blocks $m_1$, $m_2$, $m_3$ and an integer +% exponent~$p$ (one more than the scientific exponent), and these are +% stored in the integer array as four items: $p$, $10^8+m_1$, +% $10^8+m_2$, $10^8+m_3$. The various exponentials are stored in +% increasing order of $j\times 10^i$. +% +% Storing this data in an integer array makes it slightly harder to +% access (slower, too), but uses $16$ bytes of memory per exponential +% stored, while storing as tokens used around $40$ tokens; tokens have +% an especially large footprint in Unicode-aware engines. +% \begin{macrocode} +\intarray_const_from_clist:Nn \c_@@_exp_intarray + { + 1 , 1 1105 1709 , 1 1807 5647 , 1 6248 1171 , + 1 , 1 1221 4027 , 1 5816 0169 , 1 8339 2107 , + 1 , 1 1349 8588 , 1 0757 6003 , 1 1039 8374 , + 1 , 1 1491 8246 , 1 9764 1270 , 1 3178 2485 , + 1 , 1 1648 7212 , 1 7070 0128 , 1 1468 4865 , + 1 , 1 1822 1188 , 1 0039 0508 , 1 9748 7537 , + 1 , 1 2013 7527 , 1 0747 0476 , 1 5216 2455 , + 1 , 1 2225 5409 , 1 2849 2467 , 1 6045 7954 , + 1 , 1 2459 6031 , 1 1115 6949 , 1 6638 0013 , + 1 , 1 2718 2818 , 1 2845 9045 , 1 2353 6029 , + 1 , 1 7389 0560 , 1 9893 0650 , 1 2272 3043 , + 2 , 1 2008 5536 , 1 9231 8766 , 1 7740 9285 , + 2 , 1 5459 8150 , 1 0331 4423 , 1 9078 1103 , + 3 , 1 1484 1315 , 1 9102 5766 , 1 0342 1116 , + 3 , 1 4034 2879 , 1 3492 7351 , 1 2260 8387 , + 4 , 1 1096 6331 , 1 5842 8458 , 1 5992 6372 , + 4 , 1 2980 9579 , 1 8704 1728 , 1 2747 4359 , + 4 , 1 8103 0839 , 1 2757 5384 , 1 0077 1000 , + 5 , 1 2202 6465 , 1 7948 0671 , 1 6516 9579 , + 9 , 1 4851 6519 , 1 5409 7902 , 1 7796 9107 , + 14 , 1 1068 6474 , 1 5815 2446 , 1 2146 9905 , + 18 , 1 2353 8526 , 1 6837 0199 , 1 8540 7900 , + 22 , 1 5184 7055 , 1 2858 7072 , 1 4640 8745 , + 27 , 1 1142 0073 , 1 8981 5684 , 1 2836 6296 , + 31 , 1 2515 4386 , 1 7091 9167 , 1 0062 6578 , + 35 , 1 5540 6223 , 1 8439 3510 , 1 0525 7117 , + 40 , 1 1220 4032 , 1 9431 7840 , 1 8020 0271 , + 44 , 1 2688 1171 , 1 4181 6135 , 1 4484 1263 , + 87 , 1 7225 9737 , 1 6812 5749 , 1 2581 7748 , + 131 , 1 1942 4263 , 1 9524 1255 , 1 9365 8421 , + 174 , 1 5221 4696 , 1 8976 4143 , 1 9505 8876 , + 218 , 1 1403 5922 , 1 1785 2837 , 1 4107 3977 , + 261 , 1 3773 0203 , 1 0092 9939 , 1 8234 0143 , + 305 , 1 1014 2320 , 1 5473 5004 , 1 5094 5533 , + 348 , 1 2726 3745 , 1 7211 2566 , 1 5673 6478 , + 391 , 1 7328 8142 , 1 2230 7421 , 1 7051 8866 , + 435 , 1 1970 0711 , 1 1401 7046 , 1 9938 8888 , + 869 , 1 3881 1801 , 1 9428 4368 , 1 5764 8232 , + 1303 , 1 7646 2009 , 1 8905 4704 , 1 8893 1073 , + 1738 , 1 1506 3559 , 1 7005 0524 , 1 9009 7592 , + 2172 , 1 2967 6283 , 1 8402 3667 , 1 0689 6630 , + 2606 , 1 5846 4389 , 1 5650 2114 , 1 7278 5046 , + 3041 , 1 1151 7900 , 1 5080 6878 , 1 2914 4154 , + 3475 , 1 2269 1083 , 1 0850 6857 , 1 8724 4002 , + 3909 , 1 4470 3047 , 1 3316 5442 , 1 6408 6591 , + 4343 , 1 8806 8182 , 1 2566 2921 , 1 5872 6150 , + 8686 , 1 7756 0047 , 1 2598 6861 , 1 0458 3204 , + 13029 , 1 6830 5723 , 1 7791 4884 , 1 1932 7351 , + 17372 , 1 6015 5609 , 1 3095 3052 , 1 3494 7574 , + 21715 , 1 5297 7951 , 1 6443 0315 , 1 3251 3576 , + 26058 , 1 4665 6719 , 1 0099 3379 , 1 5527 2929 , + 30401 , 1 4108 9724 , 1 3326 3186 , 1 5271 5665 , + 34744 , 1 3618 6973 , 1 3140 0875 , 1 3856 4102 , + 39087 , 1 3186 9209 , 1 6113 3900 , 1 6705 9685 , + } +% \end{macrocode} +% \end{variable} +% % \begin{macro}[rEXP] % { % \@@_exp_pos_large:NnnNwn , % \@@_exp_large_after:wwn , -% \@@_exp_large:w , -% \@@_exp_large_v:wN, -% \@@_exp_large_iv:wN, -% \@@_exp_large_iii:wN, -% \@@_exp_large_ii:wN, -% \@@_exp_large_i:wN, -% \@@_exp_large_:wN, +% \@@_exp_large:NwN , +% \@@_exp_intarray:w , +% \@@_exp_intarray_aux:w , % } % The first two arguments are irrelevant (a rounding digit, and a % brace group with $8$ zeros). The third argument is the integer part @@ -740,122 +811,56 @@ % ensures that an integer part of $0$ is also removed. Then read % digits one by one, looking up $\exp(\meta{digit}\cdot % 10^{\meta{exponent}})$ in a table, and multiplying that to the -% current total. The loop is done by having the auxiliary for one -% exponent call the auxiliary for the next exponent. The current -% total is expressed by leaving the exponent behind in the input -% stream (we are currently within an \cs{@@_int_eval:w}), and keeping -% track of a fixed point number, |#1| for the numbered auxiliaries. -% Our usage of \cs{if_case:w} is somewhat dirty for optimization: -% \TeX{} jumps to the appropriate case, but we then close the -% \cs{if_case:w} \enquote{by hand}, using \cs{or:} and \cs{fi:} as -% delimiters. +% current total. The loop is done by \cs{@@_exp_large:NwN}, whose +% |#1| is the \meta{exponent}, |#2| is the current mantissa, and |#3| +% is the \meta{digit}. At the end, \cs{@@_exp_large_after:wwn} moves +% on to the Taylor series, eventually multiplied with the mantissa +% that we have just computed. % \begin{macrocode} \cs_new:Npn \@@_exp_pos_large:NnnNwn #1#2#3 #4#5; #6 { - \exp_after:wN \exp_after:wN - \cs:w @@_exp_large_ \@@_int_to_roman:w #6 :wN \exp_after:wN \cs_end: + \exp_after:wN \exp_after:wN \exp_after:wN \@@_exp_large:NwN + \exp_after:wN \exp_after:wN \exp_after:wN #6 \exp_after:wN \c_@@_one_fixed_tl \int_value:w #3 #4 \exp_stop_f: #5 00000 ; } -\cs_new:Npn \@@_exp_large:w #1 \or: #2 \fi: - { \fi: \@@_fixed_mul:wwn #1; } -\cs_new:Npn \@@_exp_large_v:wN #1; #2 +\cs_new:Npn \@@_exp_large:NwN #1#2; #3 { - \if_case:w #2 ~ \exp_after:wN \@@_fixed_continue:wn \or: - + 4343 \@@_exp_large:w {8806}{8182}{2566}{2921}{5872}{6150} \or: - + 8686 \@@_exp_large:w {7756}{0047}{2598}{6861}{0458}{3204} \or: - + 13029 \@@_exp_large:w {6830}{5723}{7791}{4884}{1932}{7351} \or: - + 17372 \@@_exp_large:w {6015}{5609}{3095}{3052}{3494}{7574} \or: - + 21715 \@@_exp_large:w {5297}{7951}{6443}{0315}{3251}{3576} \or: - + 26058 \@@_exp_large:w {4665}{6719}{0099}{3379}{5527}{2929} \or: - + 30401 \@@_exp_large:w {4108}{9724}{3326}{3186}{5271}{5665} \or: - + 34744 \@@_exp_large:w {3618}{6973}{3140}{0875}{3856}{4102} \or: - + 39087 \@@_exp_large:w {3186}{9209}{6113}{3900}{6705}{9685} \or: - \fi: - #1; - \@@_exp_large_iv:wN - } -\cs_new:Npn \@@_exp_large_iv:wN #1; #2 - { - \if_case:w #2 ~ \exp_after:wN \@@_fixed_continue:wn \or: - + 435 \@@_exp_large:w {1970}{0711}{1401}{7046}{9938}{8888} \or: - + 869 \@@_exp_large:w {3881}{1801}{9428}{4368}{5764}{8232} \or: - + 1303 \@@_exp_large:w {7646}{2009}{8905}{4704}{8893}{1073} \or: - + 1738 \@@_exp_large:w {1506}{3559}{7005}{0524}{9009}{7592} \or: - + 2172 \@@_exp_large:w {2967}{6283}{8402}{3667}{0689}{6630} \or: - + 2606 \@@_exp_large:w {5846}{4389}{5650}{2114}{7278}{5046} \or: - + 3041 \@@_exp_large:w {1151}{7900}{5080}{6878}{2914}{4154} \or: - + 3475 \@@_exp_large:w {2269}{1083}{0850}{6857}{8724}{4002} \or: - + 3909 \@@_exp_large:w {4470}{3047}{3316}{5442}{6408}{6591} \or: - \fi: - #1; - \@@_exp_large_iii:wN - } -\cs_new:Npn \@@_exp_large_iii:wN #1; #2 - { - \if_case:w #2 ~ \exp_after:wN \@@_fixed_continue:wn \or: - + 44 \@@_exp_large:w {2688}{1171}{4181}{6135}{4484}{1263} \or: - + 87 \@@_exp_large:w {7225}{9737}{6812}{5749}{2581}{7748} \or: - + 131 \@@_exp_large:w {1942}{4263}{9524}{1255}{9365}{8421} \or: - + 174 \@@_exp_large:w {5221}{4696}{8976}{4143}{9505}{8876} \or: - + 218 \@@_exp_large:w {1403}{5922}{1785}{2837}{4107}{3977} \or: - + 261 \@@_exp_large:w {3773}{0203}{0092}{9939}{8234}{0143} \or: - + 305 \@@_exp_large:w {1014}{2320}{5473}{5004}{5094}{5533} \or: - + 348 \@@_exp_large:w {2726}{3745}{7211}{2566}{5673}{6478} \or: - + 391 \@@_exp_large:w {7328}{8142}{2230}{7421}{7051}{8866} \or: - \fi: - #1; - \@@_exp_large_ii:wN - } -\cs_new:Npn \@@_exp_large_ii:wN #1; #2 - { - \if_case:w #2 ~ \exp_after:wN \@@_fixed_continue:wn \or: - + 5 \@@_exp_large:w {2202}{6465}{7948}{0671}{6516}{9579} \or: - + 9 \@@_exp_large:w {4851}{6519}{5409}{7902}{7796}{9107} \or: - + 14 \@@_exp_large:w {1068}{6474}{5815}{2446}{2146}{9905} \or: - + 18 \@@_exp_large:w {2353}{8526}{6837}{0199}{8540}{7900} \or: - + 22 \@@_exp_large:w {5184}{7055}{2858}{7072}{4640}{8745} \or: - + 27 \@@_exp_large:w {1142}{0073}{8981}{5684}{2836}{6296} \or: - + 31 \@@_exp_large:w {2515}{4386}{7091}{9167}{0062}{6578} \or: - + 35 \@@_exp_large:w {5540}{6223}{8439}{3510}{0525}{7117} \or: - + 40 \@@_exp_large:w {1220}{4032}{9431}{7840}{8020}{0271} \or: - \fi: - #1; - \@@_exp_large_i:wN - } -\cs_new:Npn \@@_exp_large_i:wN #1; #2 - { - \if_case:w #2 ~ \exp_after:wN \@@_fixed_continue:wn \or: - + 1 \@@_exp_large:w {2718}{2818}{2845}{9045}{2353}{6029} \or: - + 1 \@@_exp_large:w {7389}{0560}{9893}{0650}{2272}{3043} \or: - + 2 \@@_exp_large:w {2008}{5536}{9231}{8766}{7740}{9285} \or: - + 2 \@@_exp_large:w {5459}{8150}{0331}{4423}{9078}{1103} \or: - + 3 \@@_exp_large:w {1484}{1315}{9102}{5766}{0342}{1116} \or: - + 3 \@@_exp_large:w {4034}{2879}{3492}{7351}{2260}{8387} \or: - + 4 \@@_exp_large:w {1096}{6331}{5842}{8458}{5992}{6372} \or: - + 4 \@@_exp_large:w {2980}{9579}{8704}{1728}{2747}{4359} \or: - + 4 \@@_exp_large:w {8103}{0839}{2757}{5384}{0077}{1000} \or: + \if_case:w #3 ~ + \exp_after:wN \@@_fixed_continue:wn + \else: + \exp_after:wN \@@_exp_intarray:w + \int_value:w \@@_int_eval:w 36 * #1 + 4 * #3 \exp_after:wN ; \fi: - #1; - \@@_exp_large_:wN + #2; + { + \if_meaning:w 0 #1 + \exp_after:wN \@@_exp_large_after:wwn + \else: + \exp_after:wN \@@_exp_large:NwN + \int_value:w \@@_int_eval:w #1 - 1 \exp_after:wN \scan_stop: + \fi: + } } -\cs_new:Npn \@@_exp_large_:wN #1; #2 +\cs_new:Npn \@@_exp_intarray:w #1 ; { - \if_case:w #2 ~ \exp_after:wN \@@_fixed_continue:wn \or: - + 1 \@@_exp_large:w {1105}{1709}{1807}{5647}{6248}{1171} \or: - + 1 \@@_exp_large:w {1221}{4027}{5816}{0169}{8339}{2107} \or: - + 1 \@@_exp_large:w {1349}{8588}{0757}{6003}{1039}{8374} \or: - + 1 \@@_exp_large:w {1491}{8246}{9764}{1270}{3178}{2485} \or: - + 1 \@@_exp_large:w {1648}{7212}{7070}{0128}{1468}{4865} \or: - + 1 \@@_exp_large:w {1822}{1188}{0039}{0508}{9748}{7537} \or: - + 1 \@@_exp_large:w {2013}{7527}{0747}{0476}{5216}{2455} \or: - + 1 \@@_exp_large:w {2225}{5409}{2849}{2467}{6045}{7954} \or: - + 1 \@@_exp_large:w {2459}{6031}{1115}{6949}{6638}{0013} \or: - \fi: - #1; - \@@_exp_large_after:wwn + + + \__kernel_intarray_item:Nn \c_@@_exp_intarray + { \@@_int_eval:w #1 - 3 \scan_stop: } + \exp_after:wN \use_i:nnn + \exp_after:wN \@@_fixed_mul:wwn + \int_value:w 0 + \exp_after:wN \@@_exp_intarray_aux:w + \int_value:w \__kernel_intarray_item:Nn + \c_@@_exp_intarray { \@@_int_eval:w #1 - 2 } + \exp_after:wN \@@_exp_intarray_aux:w + \int_value:w \__kernel_intarray_item:Nn + \c_@@_exp_intarray { \@@_int_eval:w #1 - 1 } + \exp_after:wN \@@_exp_intarray_aux:w + \int_value:w \__kernel_intarray_item:Nn \c_@@_exp_intarray {#1} ; ; } +\cs_new:Npn \@@_exp_intarray_aux:w 1 #1#2#3#4#5 ; { ; {#1#2#3#4} {#5} } \cs_new:Npn \@@_exp_large_after:wwn #1; #2; #3 { \@@_exp_Taylor:Nnnwn ? { } { } 0 #2; {} #3 @@ -1142,7 +1147,11 @@ \fi: } \cs_new:Npn \@@_pow_C_pack:w - { \exp_after:wN \@@_exp_large_v:wN \c_@@_one_fixed_tl } + { + \exp_after:wN \@@_exp_large:NwN + \exp_after:wN 5 + \c_@@_one_fixed_tl + } % \end{macrocode} % \end{macro} %^^A end[todo] diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-extended.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-extended.dtx index 9187ab81a14..11e322406c8 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3fp-extended.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-extended.dtx @@ -38,7 +38,7 @@ % {latex-team@latex-project.org}^^A % }^^A % } -% \date{Released 2018-04-30} +% \date{Released 2018-05-12} % % \maketitle % @@ -442,7 +442,8 @@ % \cs{@@_fixed_mul_sub_back:wwwn} \meta{a} |;| \meta{b} |;| \meta{c} |;| \Arg{continuation} % \cs{@@_fixed_one_minus_mul:wwn} \meta{a} |;| \meta{b} |;| \Arg{continuation} % \end{syntax} -% Compute $a\times b + c$, $c - a\times b$, and $1 - a\times b$ and +% Sometimes called |FMA| (fused multiply-add), these functions +% compute $a\times b + c$, $c - a\times b$, and $1 - a\times b$ and % feed the result to the \meta{continuation}. Those functions require % $0\leq a_{1}, b_{1}, c_{1} \leq 10000$. Since those functions are % at the heart of the computation of Taylor expansions, we diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-logic.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-logic.dtx index e6821415089..f450cf17982 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3fp-logic.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-logic.dtx @@ -38,7 +38,7 @@ % {latex-team@latex-project.org}^^A % }^^A % } -% \date{Released 2018-04-30} +% \date{Released 2018-05-12} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-parse.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-parse.dtx index 9a0f8a233f6..dd473d12422 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3fp-parse.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-parse.dtx @@ -38,7 +38,7 @@ % {latex-team@latex-project.org}^^A % }^^A % } -% \date{Released 2018-04-30} +% \date{Released 2018-05-12} % % \maketitle % @@ -496,14 +496,14 @@ % \item If the next token is a control sequence, it could be the % special marker \cs{s_@@_mark}, and % otherwise it is a case of juxtaposing numbers, such as -% |2\c_zero|, with an implied multiplication. +% |2\c_zero_int|, with an implied multiplication. % \item If the next token is a letter, it is also a case of % juxtaposition, as letters cannot be proper infix operators. % \item Otherwise (including in the case of digits), if the token is a % known infix operator, the appropriate % |\__fp_infix_|\meta{operator}|:N| function is built, and if it % does not exist, we complain. In particular, the juxtaposition -% |\c_zero 2| is disallowed. +% |\c_zero_int 2| is disallowed. % \end{itemize} % % In the above, we need to test whether a character token~|#1| is a @@ -2812,113 +2812,6 @@ % \end{macrocode} % \end{macro} % -% \subsection{Candidate: defining new \pkg{l3fp} functions} -% -% \begin{macro}[EXP]{\fp_function:Nw} -% Parse the argument of the function~|#1| using -% \cs{@@_parse_operand:Nw} with a precedence of~$16$, and pass the -% function and argument to \cs{@@_function_apply:nw}. -% \begin{macrocode} -\cs_new:Npn \fp_function:Nw #1 - { - \exp_after:wN \@@_function_apply:nw - \exp_after:wN #1 - \exp:w - \@@_parse_operand:Nw \c_@@_prec_func_int \@@_parse_expand:w - } -% \end{macrocode} -% \end{macro} -% -% \begin{macro}{\fp_new_function:Npn} -% \begin{macro}{\@@_new_function:NNnnn, \@@_new_function:Ncfnn} -% \begin{macro}{\@@_function_args:Nwn} -% Save the code provided by the user in the control sequence -% |\__fp_user_#1|. Define |#1| to call \cs{@@_function_apply:nw} -% after parsing one operand using \cs{@@_parse_operand:Nw} with -% precedence~$16$. The auxiliary \cs{@@_function_args:Nwn} receives -% the user function and the number of arguments (half of the number of -% tokens in the parameter text~|#2|), followed by the operand (as a -% token list of floating points). It checks the number of arguments, -% and applies the user function to the arguments (without the outer -% brace group). -% \begin{macrocode} -\cs_new_protected:Npn \fp_new_function:Npn #1#2# - { - \@@_new_function:Ncfnn #1 - { @@_user_ \cs_to_str:N #1 } - { \int_eval:n { \tl_count:n {#2} / 2 } } - {#2} - } -\cs_new_protected:Npn \@@_new_function:NNnnn #1#2#3#4#5 - { - \cs_new:Npn #1 - { - \exp_after:wN \@@_function_apply:nw \exp_after:wN - { - \exp_after:wN \@@_function_args:Nwn - \exp_after:wN #2 - \int_value:w #3 \exp_after:wN ; \exp_after:wN - } - \exp:w - \@@_parse_operand:Nw \c_@@_prec_func_int \@@_parse_expand:w - } - \cs_new:Npn #2 #4 {#5} - } -\cs_generate_variant:Nn \@@_new_function:NNnnn { Ncf } -\cs_new:Npn \@@_function_args:Nwn #1#2; #3 - { - \int_compare:nNnTF { \tl_count:n {#3} } = {#2} - { #1 #3 } - { - \__kernel_msg_expandable_error:nnnnn - { kernel } { fp-num-args } { #1() } {#2} {#2} - \c_nan_fp - } - } -% \end{macrocode} -% \end{macro} -% \end{macro} -% \end{macro} -% -% \begin{macro}[EXP] -% { -% \@@_function_apply:nw, -% \@@_function_store:wwNwnn, -% \@@_function_store_end:wnnn -% } -% The auxiliary \cs{@@_function_apply:nw} is called after parsing an -% operand, so it receives some code~|#1|, then the operand ending -% with~|@|, then a function such as \cs{@@_parse_infix_+:N} (but not -% always of this form, see comparisons for instance). Package the -% operand (an array) into a token list with floating point items: this -% is the role of \cs{@@_function_store:wwNwnn} and -% \cs{@@_function_store_end:wnnn}. Then apply \cs{@@_parse:n} to the -% code~|#1| followed by a brace group with this token list. This -% results in a floating point result, which is then correctly parsed -% as the next operand of whatever was looking for one. The trailing -% \cs{s_@@_mark} is used as a special infix operator to indicate that -% the next token has already gone through \cs{@@_parse_infix:NN}. -% \begin{macrocode} -\cs_new:Npn \@@_function_apply:nw #1#2 @ - { - \@@_parse:n - { - \@@_function_store:wwNwnn #2 - \s_@@_mark \@@_function_store:wwNwnn ; - \s_@@_mark \@@_function_store_end:wnnn - \s_@@_stop { } { } {#1} - } - \s_@@_mark - } -\cs_new:Npn \@@_function_store:wwNwnn - #1; #2 \s_@@_mark #3#4 \s_@@_stop #5#6 - { #3 #2 \s_@@_mark #3#4 \s_@@_stop { #5 #6 } { { #1; } } } -\cs_new:Npn \@@_function_store_end:wnnn - #1 \s_@@_stop #2#3#4 - { #4 {#2} } -% \end{macrocode} -% \end{macro} -% % ^^A end[todo] % % \subsection{Messages} diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-random.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-random.dtx index 20c90ce692d..d5f0d684729 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3fp-random.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-random.dtx @@ -38,7 +38,7 @@ % {latex-team@latex-project.org}^^A % }^^A % } -% \date{Released 2018-04-30} +% \date{Released 2018-05-12} % % \maketitle % @@ -71,146 +71,280 @@ % % \subsection{Engine support} % -% At present, \XeTeX{} does not provide random -% numbers, while \pdfTeX{}, \LuaTeX{}, \pTeX{} and \upTeX{} provide the primitive -% \cs{pdftex_uniformdeviate:D}. We write the test twice simply in -% order to write the \texttt{false} branch first. +% Most engines provide random numbers, but not all. We write the test +% twice simply in order to write the \texttt{false} branch first. % \begin{macrocode} -\cs_if_exist:NF \pdftex_uniformdeviate:D +\sys_if_rand_exist:F { \__kernel_msg_new:nnn { kernel } { fp-no-random } - { Random~numbers~unavailable } + { Random~numbers~unavailable~for~#1 } \cs_new:Npn \@@_rand_o:Nw ? #1 @ { - \__kernel_msg_expandable_error:nn { kernel } { fp-no-random } + \__kernel_msg_expandable_error:nnn { kernel } { fp-no-random } + { fp~rand } \exp_after:wN \c_nan_fp } \cs_new_eq:NN \@@_randint_o:Nw \@@_rand_o:Nw \cs_new:Npn \int_rand:nn #1#2 { - \__kernel_msg_expandable_error:nn { kernel } { fp-no-random } + \__kernel_msg_expandable_error:nnn { kernel } { fp-no-random } + { \int_rand:nn {#1} {#2} } \int_eval:n {#1} } + \cs_new:Npn \int_rand:n #1 + { + \__kernel_msg_expandable_error:nnn { kernel } { fp-no-random } + { \int_rand:n {#1} } + 1 + } } -\cs_if_exist:NT \pdftex_uniformdeviate:D +\sys_if_rand_exist:T { % \end{macrocode} % -% \begin{macro}[EXP]{\@@_rand_uniform:} -% \begin{variable} -% { -% \c_@@_rand_size_int, -% \c_@@_rand_four_int, -% \c_@@_rand_eight_int, -% } -% The \cs{pdftex_uniformdeviate:D} primitive gives a pseudo-random -% integer in a range $[0,n-1]$ of the user's choice. This number is -% meant to be uniformly distributed, but is produced by rescaling a -% uniform pseudo-random integer in $[0,2^{28}-1]$. For instance, -% setting~$n$ to (any multiple of) $2^{29}$ gives only even values. -% Thus it is only safe to call \cs{pdftex_uniformdeviate:D} with -% argument $2^{28}$. This integer is also used in the implementation -% of \cs{int_rand:nn}. We also use variants of this number -% rounded down to multiples of $10^4$ and $10^8$. +% Obviously, every word \enquote{random} below means +% \enquote{pseudo-random}, as we have no access to entropy (except a +% very unreliable source of entropy: the time it takes to run some +% code). +% +% The primitive random number generator (RNG) is provided as +% \cs{tex_uniformdeviate:D}. Under the hood, it maintains an array of +% $55$ $28$-bit numbers, updated with a linear recursion relation +% (similar to Fibonacci numbers) modulo $2^{28}$. When +% \cs{tex_uniformdeviate:D} \meta{integer} is called (for brevity denote +% by~$N$ the \meta{integer}), the next $28$-bit number is read from the +% array, scaled by $N/2^{28}$, and rounded. To prevent $0$ and $N$ from +% appearing half as often as other numbers, they are both mapped to the +% result~$0$. +% +% This process means that \cs{tex_uniformdeviate:D} only gives a uniform +% distribution from $0$ to $N-1$ if $N$ is a divisor of $2^{28}$, so we +% will mostly call the RNG with such power of~$2$ arguments. If $N$ +% does not divide $2^{28}$, then the relative non-uniformity (difference +% between probabilities of getting different numbers) is about +% $N/2^{28}$. This implies that detecting deviation from $1/N$ of the +% probability of a fixed value X requires about $2^{56}/N$ random +% trials. But collective patterns can reduce this to about +% $2^{56}/N^2$. For instance with $N=3\times 2^{k}$, the modulo~$3$ +% repartition of such random numbers is biased with a non-uniformity +% about $2^k/2^{28}$ (which is much worse than the circa $3/2^{28}$ +% non-uniformity from taking directly $N=3$). This is detectable after +% about $2^{56}/2^{2k} = 9\cdot 2^{56}/N^2$ random numbers. For $k=15$, +% $N=98304$, this means roughly $2^{26}$ calls to the RNG +% (experimentally this takes at the very least 16 seconds on a 2 giga-hertz +% processor). While this bias is not quite problematic, it is +% uncomfortably close to being so, and it becomes worse as $N$ is +% increased. In our code, we shall thus combine several results from +% the RNG\@. +% +% The RNG has three types of unexpected correlations. First, everything +% is linear modulo~$2^{28}$, hence the lowest $k$ bits of the random +% numbers only depend on the lowest $k$ bits of the seed (and of course +% the number of times the RNG was called since setting the seed). The +% recommended way to get a number from $0$ to $N-1$ is thus to scale the +% raw $28$-bit integer, as the engine's RNG does. We will go further +% and in fact typically we discard some of the lowest bits. +% +% Second, suppose that we call the RNG with the same argument~$N$ to get +% a set of $K$ integers in $[0,N-1]$ (throwing away repeats), and +% suppose that $N>K^3$ and $K>55$. The recursion used to construct more +% $28$-bit numbers from previous ones is linear: +% $x_n = x_{n-55} - x_{n-24}$ or $x_n = x_{n-55}-x_{n-24}+2^{28}$. +% After rescaling and rounding we find that the result $N_n\in[0,N-1]$ +% is among $N_{n-55} - N_{n-24} + \{-1,0,1\}$ modulo~$N$ (a more +% detailed analysis shows that $0$ appears with frequency close +% to~$3/4$). The resulting set thus has more triplets $(a,b,c)$ than +% expected obeying $a=b+c$ modulo~$N$. Namely it will have of order +% $(K-55)\times 3/4$ such triplets, when one would expect $K^3/(6N)$. +% This starts to be detectable around $N=2^{18}>55^3$ (earlier if one +% keeps track of positions too, but this is more subtle than it looks +% because the array of $28$-bit integers is read backwards by the +% engine). Hopefully the correlation is subtle enough to not affect +% realistic documents so we do not specifically mitigate against this. +% Since we typically use two calls to the RNG per \cs{int_rand:nn} we +% would need to investigate linear relations between the $x_{2n}$ on the +% one hand and between the $x_{2n+1}$ on the other hand. Such relations +% will have more complicated coefficients than $\pm 1$, which alleviates +% the issue. +% +% Third, consider successive batches of $165$ calls to the RNG (with +% argument $2^{28}$ or with argument~$2$ for instance), then most +% batches have more odd than even numbers. Note that this does not mean +% that there are more odd than even numbers overall. Similar issues are +% discussed in Knuth's TAOCP volume 2 near exercise 3.3.2-31. We do not +% have any mitigation strategy for this. +% +% Ideally, our algorithm should be: +% \begin{itemize} +% \item Uniform. The result should be as uniform as possible assuming +% that the RNG's underlying $28$-bit integers are uniform. +% \item Uncorrelated. The result should not have detectable +% correlations between different seeds, similar to the lowest-bit ones +% mentioned earlier. +% \item Quick. The algorithm should be fast in \TeX{}, so no +% \enquote{bit twiddling}, but \enquote{digit twiddling} is ok. +% \item Simple. The behaviour must be documentable precisely. +% \item Predictable. The number of calls to the RNG should be the same +% for any \cs{int_rand:nn}, because then the algorithm can be modified +% later without changing the result of other uses of the RNG\@. +% \item Robust. It should work even for \cs{int_rand:nn} |{| |-| +% \cs{c_max_int} |}| |{| \cs{c_max_int} |}| where the range is not +% representable as an integer. In fact, we also provide later a +% floating-point |randint| whose range can go all the way up to +% $2\times 10^{16}-1$ possible values. +% \end{itemize} +% Some of these requirements conflict. For instance, uniformity cannot +% be achieved with a fixed number of calls to the RNG\@. +% +% Denote by $\operatorname{random}(N)$ one call to +% \cs{tex_uniformdeviate:D} with argument~$N$, and by +% $\operatorname{ediv}(p,q)$ the \eTeX{} rounding division giving +% $\lfloor p/q+1/2\rfloor$. Denote by $\meta{min}$, $\meta{max}$ and +% $R=\meta{max}-\meta{min}+1$ the arguments of \cs{int_min:nn} and the +% number of possible outcomes. Note that $R\in [1,2^{32}-1]$ cannot +% necessarily be represented as an integer (however, $R-2^{31}$ can). +% Our strategy is to get two $28$-bit integers $X$ and $Y$ from the RNG, +% split each into $14$-bit integers, as $X=X_1\times 2^{14}+X_0$ and +% $Y=Y_1\times 2^{14}+Y_0$ then return essentially +% $\meta{min} + \lfloor R (X_1\times 2^{-14} + Y_1\times 2^{-28} + +% Y_0\times 2^{-42} + X_0\times 2^{-56})\rfloor$. For small~$R$ the +% $X_0$ term has a tiny effect so we ignore it and we can compute +% $R\times Y/2^{28}$ much more directly by $\operatorname{random}(R)$. +% \begin{itemize} +% \item If $R \leq 2^{17}-1$ then return +% $\operatorname{ediv}(R\operatorname{random}(2^{14}) + +% \operatorname{random}(R) + 2^{13}, 2^{14}) - 1 + \meta{min}$. The +% shifts by $2^{13}$ and $-1$ convert \eTeX{} division to truncated +% division. The bound on $R$ ensures that the number obtained after +% the shift is less than \cs{c_max_int}. The non-uniformity is at +% most of order $2^{17}/2^{42} = 2^{-25}$. +% \item Split $R=R_2\times 2^{28}+R_1\times 2^{14}+R_0$, where +% $R_2\in [0,15]$. Compute +% $\meta{min} + R_2 X_1 2^{14} + (R_2 Y_1 + R_1 X_1) + +% \operatorname{ediv}(R_2 Y_0 + R_1 Y_1 + R_0 X_1 + +% \operatorname{ediv}(R_2 X_0 + R_0 Y_1 + \operatorname{ediv}((2^{14} +% R_1 + R_0) (2^{14} Y_0 + X_0), 2^{28}), 2^{14}), 2^{14})$ then map a +% result of $\meta{max}+1$ to $\meta{min}$. Writing each +% $\operatorname{ediv}$ in terms of truncated division with a shift, +% and using +% $\lfloor(p+\lfloor r/s\rfloor)/q\rfloor = +% \lfloor(ps+r)/(sq)\rfloor$, what we compute is equal to +% $\lfloor\meta{exact}+2^{-29}+2^{-15}+2^{-1}\rfloor$ with +% $\meta{exact}=\meta{min} + R \times 0.X_1Y_1Y_0X_0$. Given we map +% $\meta{max}+1$ to $\meta{min}$, the shift has no effect on +% uniformity. The non-uniformity is bounded by $R/2^{56}<2^{-24}$. It +% may be possible to speed up the code by dropping tiny terms such as +% $R_0 X_0$, but the analysis of non-uniformity proves too difficult. +% +% To avoid the overflow when the computation yields $\meta{max}+1$ +% with $\meta{max}=2^{31}-1$ (note that $R$ is then arbitrary), we +% compute the result in two pieces. Compute +% $\meta{first} = \meta{min} + R_2 X_1 2^{14}$ if $R_2<8$ or +% $\meta{min} + 8 X_1 2^{14} + (R_2-8) X_1 2^{14}$ if $R_2\geq 8$, the +% expressions being chosen to avoid overflow. Compute +% $\meta{second} = R_2 Y_1 + R_1 X_1 + \operatorname{ediv}({\dots})$, +% at most +% $R_2 2^{14} + R_1 2^{14} + R_0\leq 2^{28} + 15\times 2^{14} - 1$, +% not at risk of overflowing. We have +% $\meta{first}+\meta{second}=\meta{max}+1=\meta{min}+R$ if and only +% if $\meta{second} = R1 2^{14} + R_0 + R_2 2^{14}$ and +% $2^{14} R_2 X_1 = 2^{28} R_2 - 2^{14} R_2$ (namely $R_2=0$ or +% $X_1=2^{14}-1$). In that case, return \meta{min}, otherwise return +% $\meta{first}+\meta{second}$, which is safe because it is at most +% \meta{max}. Note that the decision of what to return does not need +% \meta{first} explicitly so we don't actually compute it, just put it +% in an integer expression in which \meta{second} is eventually added +% (or not). +% \item To get a floating point number in $[0,1)$ just call the +% $R=10000\leq 2^{17}-1$ procedure above to produce four blocks of four +% digits. +% \item To get an integer floating point number in a range (whose size +% can be up to $2\times 10^{16}-1$), work with fixed-point numbers: +% get six times four digits to build a fixed point number, multiply by +% $R$ and add $\meta{min}$. This requires some care because +% \pkg{l3fp-extended} only supports non-negative numbers. +% \end{itemize} +% +% \begin{variable}{\c__kernel_randint_max_int} +% Constant equal to $2^{17}-1$, the maximal size of a range that +% \cs{int_range:nn} can do with its \enquote{simple} algorithm. % \begin{macrocode} - \cs_new:Npn \@@_rand_uniform: - { \pdftex_uniformdeviate:D \c_@@_rand_size_int } - \int_const:Nn \c_@@_rand_size_int { 268 435 456 } - \int_const:Nn \c_@@_rand_four_int { 268 430 000 } - \int_const:Nn \c_@@_rand_eight_int { 200 000 000 } + \int_const:Nn \c__kernel_randint_max_int { 131071 } % \end{macrocode} % \end{variable} +% +% \begin{macro}[EXP]{\__kernel_randint:n} +% Used in an integer expression, \cs{__kernel_randint:n} |{|$R$|}| +% gives a random number +% $1+\lfloor(R\operatorname{random}(2^{14}) + +% \operatorname{random}(R))/2^{14}\rfloor$ that is in $[1,R]$. +% Previous code was computing $\lfloor p/2^{14}\rfloor$ as +% $\operatorname{ediv}(p-2^{13},2^{14})$ but that wrongly gives $-1$ +% for $p=0$. +% \begin{macrocode} + \cs_new:Npn \__kernel_randint:n #1 + { + (#1 * \tex_uniformdeviate:D 16384 + + \tex_uniformdeviate:D #1 + 8192 ) / 16384 + } +% \end{macrocode} % \end{macro} % -% \begin{macro}[EXP]{\@@_rand_myriads:n} % \begin{macro}[EXP] -% { -% \@@_rand_myriads_loop:nn, -% \@@_rand_myriads_get:w, -% \@@_rand_myriads_last:, -% \@@_rand_myriads_last:w, -% } -% Used as \cs{@@_rand_myriads:n} |{XXX}| with one input character per -% block of four digit we want. Given a pseudo-random integer from the -% primitive, we extract $2$ blocks of digits if possible, namely if -% the integer is less than $2\times 10^8$. If that's not possible, -% we try to extract $1$~block, which succeeds in the range $[2\times -% 10^8, 26843\times 10^4)$. For the $5456$ remaining possible values -% we just throw away the random integer and get a new one. Depending -% on whether we got $2$, $1$, or~$0$ blocks, remove the same number of -% characters from the input stream with \cs{use_i:nnn}, \cs{use_i:nn} -% or nothing. +% {\@@_rand_myriads:n, \@@_rand_myriads_loop:w, \@@_rand_myriads_get:w} +% Used as \cs{@@_rand_myriads:n} |{XXX}| with one letter |X| +% (specifically) per block of four digit we want; it expands to |;| +% followed by the requested number of brace groups, each containing +% four (pseudo-random) digits. Digits are produced as a random number +% in $[10000,19999]$ for the usual reason of preserving leading zeros. % \begin{macrocode} \cs_new:Npn \@@_rand_myriads:n #1 + { \@@_rand_myriads_loop:w #1 \prg_break: X \prg_break_point: ; } + \cs_new:Npn \@@_rand_myriads_loop:w #1 X { - \@@_rand_myriads_loop:nn #1 - { ? \use_i_delimit_by_q_stop:nw \@@_rand_myriads_last: } - { ? \use_none_delimit_by_q_stop:w } \q_stop - } - \cs_new:Npn \@@_rand_myriads_loop:nn #1#2 - { - \use_none:n #2 + #1 \exp_after:wN \@@_rand_myriads_get:w - \int_value:w \@@_rand_uniform: ; {#1}{#2} - } - \cs_new:Npn \@@_rand_myriads_get:w #1 ; - { - \if_int_compare:w #1 < \c_@@_rand_eight_int - \exp_after:wN \use_none:n - \int_value:w \@@_int_eval:w - \c_@@_rand_eight_int + #1 \@@_int_eval_end: - \exp_after:wN \use_i:nnn - \else: - \if_int_compare:w #1 < \c_@@_rand_four_int - \exp_after:wN \use_none:nnnnn - \int_value:w \@@_int_eval:w - \c_@@_rand_four_int + #1 \@@_int_eval_end: - \exp_after:wN \exp_after:wN \exp_after:wN \use_i:nn - \fi: - \fi: - \@@_rand_myriads_loop:nn - } - \cs_new:Npn \@@_rand_myriads_last: - { - \exp_after:wN \@@_rand_myriads_last:w - \int_value:w \@@_rand_uniform: ; - } - \cs_new:Npn \@@_rand_myriads_last:w #1 ; - { - \if_int_compare:w #1 < \c_@@_rand_four_int - \exp_after:wN \use_none:nnnnn - \int_value:w \@@_int_eval:w - \c_@@_rand_four_int + #1 \@@_int_eval_end: - \else: - \exp_after:wN \@@_rand_myriads_last: - \fi: + \int_value:w \@@_int_eval:w 9999 + + \__kernel_randint:n { 10000 } + \@@_rand_myriads_loop:w } + \cs_new:Npn \@@_rand_myriads_get:w 1 #1 ; { ; {#1} } % \end{macrocode} % \end{macro} -% \end{macro} % % \subsection{Random floating point} % -% \begin{macro}[EXP]{\@@_rand_o:Nw} -% \begin{macro}[EXP]{\@@_rand_o:, \@@_rand_o:w} +% \begin{macro}[EXP]{\@@_rand_o:Nw, \@@_rand_o:w} % First we check that |random| was called without argument. Then get -% four blocks of four digits. +% four blocks of four digits and convert that fixed point number to a +% floating point number (this correctly sets the exponent). This has +% a minor bug: if all of the random numbers are zero then the result +% is correctly~$0$ but it raises the \texttt{underflow} flag; it +% should not do that. % \begin{macrocode} \cs_new:Npn \@@_rand_o:Nw ? #1 @ { \tl_if_empty:nTF {#1} - { \@@_rand_o: } + { + \exp_after:wN \@@_rand_o:w + \exp:w \exp_end_continue_f:w + \@@_rand_myriads:n { XXXX } { 0000 } { 0000 } ; 0 + } { \__kernel_msg_expandable_error:nnnnn { kernel } { fp-num-args } { rand() } { 0 } { 0 } \exp_after:wN \c_nan_fp } } - \cs_new:Npn \@@_rand_o: - { \@@_parse_o:n { . \@@_rand_myriads:n { xxxx } } } + \cs_new:Npn \@@_rand_o:w ; + { + \exp_after:wN \@@_sanitize:Nw + \exp_after:wN 0 + \int_value:w \@@_int_eval:w \c_zero_int + \@@_fixed_to_float_o:wN + } % \end{macrocode} % \end{macro} -% \end{macro} % % \subsection{Random integer} % @@ -220,33 +354,31 @@ % \@@_randint_default:w, % \@@_randint_badarg:w, % \@@_randint_o:w, -% \@@_randint_e:wnn, -% \@@_randint_e:wwNnn, -% \@@_randint_e:wwwNnn, -% \@@_randint_narrow_e:nnnn, -% \@@_randint_wide_e:nnnn, -% \@@_randint_wide_e:wnnn, +% \@@_randint_auxi_o:ww, +% \@@_randint_auxii:wn, +% \@@_randint_auxiii_o:ww, +% \@@_randint_auxiv_o:ww, +% \@@_randint_auxv_o:w, % } % Enforce that there is one argument (then add first argument~$1$) -% or two arguments. Enforce that they are integers in -% $(-10^{16},10^{16})$ and ordered. We distinguish narrow ranges -% (less than $2^{28}$) from wider ones. -% -% For narrow ranges, compute the number~$n$ of possible outputs as -% an integer using \cs{fp_to_int:n}, and reduce a pseudo-random -% $28$-bit integer~$r$ modulo~$n$. On its own, this is not uniform -% when $[0,2^{28}-1]$ does not divide evenly into intervals of -% size~$n$. The auxiliary \cs{@@_randint_e:wwwNnn} discards the -% pseudo-random integer if it lies in an incomplete interval, and -% repeats. -% -% For wide ranges we use the same code except for the last eight -% digits which use \cs{@@_rand_myriads:n}. It is not safe to -% combine the first digits with the last eight as a single string of -% digits, as this may exceed $16$~digits and be rounded. Instead, -% we first add the first few digits (times $10^8$) to the lower -% bound. The result is compared to the upper bound and the process -% repeats if needed. +% or two arguments. Call \cs{@@_randint_badarg:w} on each; this +% function inserts |1| \cs{exp_stop_f:} to end the \cs{if_case:w} +% statement if either the argument is not an integer or if its +% absolute value is $\geq 10^{16}$. Also bail out if +% \cs{@@_compare_back:ww} yields~|1|, meaning that the bounds are +% not in the right order. Otherwise an auxiliary converts each +% argument times $10^{-16}$ (hence the shift in exponent) to a +% $24$-digit fixed point number (see \pkg{l3fp-extended}). +% Then compute the number of choices, $\meta{max}+1-\meta{min}$. +% Create a random $24$-digit fixed-point number with +% \cs{@@_rand_myriads:n}, then use a fused multiply-add instruction +% to multiply the number of choices to that random number and add it +% to \meta{min}. Then truncate to $16$ digits (namely select the +% integer part of $10^{16}$ times the result) before converting back +% to a floating point number (\cs{@@_sanitize:Nw} takes care of zero). +% To avoid issues with negative numbers, add $1$ to all fixed point +% numbers (namely $10^{16}$ to the integers they represent), except +% of course when it is time to convert back to a float. % \begin{macrocode} \cs_new:Npn \@@_randint_o:Nw ? { @@ -261,7 +393,7 @@ { \if_meaning:w 1 #1 \if_int_compare:w - \use_i_delimit_by_q_stop:nw #3 \q_stop > \c_@@_prec_int + \@@_use_i_until_s:nw #3 ; > \c_@@_prec_int 1 \exp_stop_f: \fi: \fi: @@ -273,9 +405,9 @@ \if_case:w \@@_randint_badarg:w #1; \@@_randint_badarg:w #2; - \fp_compare:nNnTF { #1; } > { #2; } { 1 } { 0 } \exp_stop_f: - \exp_after:wN \exp_after:wN \exp_after:wN \@@_randint_e:wnn - \@@_parse:n { #2; - #1; } { #1; } { #2; } + \if:w 1 \@@_compare_back:ww #2; #1; 1 \exp_stop_f: \fi: + 0 \exp_stop_f: + \@@_randint_auxi_o:ww #1; #2; \or: \@@_invalid_operation_tl_o:ff { randint } { \@@_array_to_clist:n { #1; #2; } } @@ -283,133 +415,226 @@ \fi: \exp_after:wN \exp_end: } - \cs_new:Npn \@@_randint_e:wnn #1; + \cs_new:Npn \@@_randint_auxi_o:ww #1 ; #2 ; #3 \exp_end: { - \exp_after:wN \@@_randint_e:wwNnn - \int_value:w \@@_rand_uniform: \exp_after:wN ; - \exp:w \exp_end_continue_f:w - \fp_compare:nNnTF { #1 ; } < \c_@@_rand_size_int - { \fp_to_int:n { #1 ; + 1 } ; \@@_randint_narrow_e:nnnn } - { - \fp_to_int:n { floor(#1 ; * 1e-8 + 1) } ; - \@@_randint_wide_e:nnnn - } + \fi: + \@@_randint_auxii:wn #2 ; + { \@@_randint_auxii:wn #1 ; \@@_randint_auxiii_o:ww } } - \cs_new:Npn \@@_randint_e:wwNnn #1 ; #2 ; + \cs_new:Npn \@@_randint_auxii:wn \s_@@ \@@_chk:w 1#1#2#3 ; { - \exp_after:wN \@@_randint_e:wwwNnn - \int_value:w \int_mod:nn {#1} {#2} ; #1 ; #2 ; + \exp_after:wN \@@_ep_to_fixed:wwn + \int_value:w \@@_int_eval:w + #2 - \c_@@_prec_int , #3 {0000} {0000} ; + { + \if_meaning:w 0 #1 + \exp_after:wN \use_i:nnnn + \exp_after:wN \@@_fixed_add_one:wN + \fi: + \exp_after:wN \@@_fixed_sub:wwn \c_@@_one_fixed_tl + } + \@@_fixed_continue:wn } - \cs_new:Npn \@@_randint_e:wwwNnn #1 ; #2 ; #3 ; #4 + \cs_new:Npn \@@_randint_auxiii_o:ww #1 ; #2 ; { - \int_compare:nNnTF { #2 - #1 + #3 } > \c_@@_rand_size_int - { - \exp_after:wN \@@_randint_e:wwNnn - \int_value:w \@@_rand_uniform: ; #3 ; #4 - } - { #4 {#1} {#3} } + \@@_fixed_add:wwn #2 ; + {0000} {0000} {0000} {0001} {0000} {0000} ; + \@@_fixed_sub:wwn #1 ; + { + \exp_after:wN \use_i:nn + \exp_after:wN \@@_fixed_mul_add:wwwn + \exp:w \exp_end_continue_f:w \@@_rand_myriads:n { XXXXXX } ; + } + #1 ; + \@@_randint_auxiv_o:ww + #2 ; + \@@_randint_auxv_o:w #1 ; @ } - \cs_new:Npn \@@_randint_narrow_e:nnnn #1#2#3#4 - { \@@_parse_o:n { #3 + #1 } \exp:w } - \cs_new:Npn \@@_randint_wide_e:nnnn #1#2#3#4 + \cs_new:Npn \@@_randint_auxiv_o:ww #1#2#3#4#5 ; #6#7#8#9 { - \exp_after:wN \exp_after:wN - \exp_after:wN \@@_randint_wide_e:wnnn - \@@_parse:n { #3 + #1e8 + \@@_rand_myriads:n { xx } } - {#2} {#3} {#4} + \if_int_compare:w + \if_int_compare:w #1#2 > #6#7 \exp_stop_f: 1 \else: + \if_int_compare:w #1#2 < #6#7 \exp_stop_f: - \fi: \fi: + #3#4 > #8#9 \exp_stop_f: + \@@_use_i_until_s:nw + \fi: + \@@_randint_auxv_o:w {#1}{#2}{#3}{#4}#5 } - \cs_new:Npn \@@_randint_wide_e:wnnn #1 ; #2#3#4 + \cs_new:Npn \@@_randint_auxv_o:w #1#2#3#4#5 ; #6 @ { - \fp_compare:nNnTF { #1 ; } > {#4} - { - \exp_after:wN \@@_randint_e:wwNnn - \int_value:w \@@_rand_uniform: ; #2 ; - \@@_randint_wide_e:nnnn {#3} {#4} - } - { \@@_exp_after_o:w #1 ; \exp:w } + \exp_after:wN \@@_sanitize:Nw + \int_value:w + \if_int_compare:w #1 < 10000 \exp_stop_f: + 2 + \else: + 0 + \exp_after:wN \exp_after:wN + \exp_after:wN \@@_reverse_args:Nww + \fi: + \exp_after:wN \@@_fixed_sub:wwn \c_@@_one_fixed_tl + {#1} {#2} {#3} {#4} {0000} {0000} ; + { + \exp_after:wN \exp_stop_f: + \int_value:w \@@_int_eval:w \c_@@_prec_int + \@@_fixed_to_float_o:wN + } + 0 + \exp:w \exp_after:wN \exp_end: } % \end{macrocode} % \end{macro} % \end{macro} % -% \begin{macro}{\int_rand:nn} -% \begin{macro}{\@@_randint:ww} -% \begin{macro}{\@@_randint_narrow:n} -% \begin{macro}{\@@_randint_narrow:nn} -% \begin{macro}{\@@_randint_narrow:nnn} +% \begin{macro}{\int_rand:nn, \@@_randint:ww} % Evaluate the argument and filter out the case where the lower % bound~|#1| is more than the upper bound~|#2|. Then determine -% whether the range is narrower than \cs{c_@@_rand_size_int}; |#2-#1| -% may overflow for very large positive~|#2| and negative~|#1|. If the -% range is wide, use slower code from \pkg{l3fp}. If the range is -% narrow, call \cs{@@_randint_narrow:n} \Arg{choices} where -% \meta{choices} is the number of possible outcomes. -% -% One option then would be to reduce a random number modulo -% \meta{choices}, but the low-order bits of random numbers provided by -% the primitive have poor randomness: empirical tests indicate that -% taking random numbers modulo~$2$ gives only two possible sequences -% of bits depending on the seed's parity. Instead, fit in the output -% range $[0,\cs{c_@@_rand_size_int}-1]$ of the random number generator -% \meta{choices} equal-size intervals of maximum possible size -% (obtained using \cs{int_div_truncate:nn}). Given a random number, -% divide it by the size to determine which interval it falls into; if -% it is beyond \meta{choices}, try another random number. +% whether the range is narrower than \cs{c__kernel_randint_max_int}; +% |#2-#1| may overflow for very large positive~|#2| and negative~|#1|. +% If the range is narrow, call \cs{__kernel_randint:n} \Arg{choices} +% where \meta{choices} is the number of possible outcomes. If the +% range is wide, use somewhat slower code. % \begin{macrocode} \cs_new:Npn \int_rand:nn #1#2 { - \exp_after:wN \@@_randint:ww - \int_value:w \int_eval:n {#1} \exp_after:wN ; - \int_value:w \int_eval:n {#2} ; + \int_eval:n + { + \exp_after:wN \@@_randint:ww + \int_value:w \int_eval:n {#1} \exp_after:wN ; + \int_value:w \int_eval:n {#2} ; + } } \cs_new:Npn \@@_randint:ww #1; #2; { - \int_compare:nNnTF {#1} > {#2} - { - \__kernel_msg_expandable_error:nnnn - { kernel } { randint-backward-range } {#1} {#2} - \@@_randint:ww #2; #1; - } - { - \int_compare:nNnTF {#1} > 0 - { \int_compare:nNnTF { #2 - #1 } < \c_@@_rand_size_int } - { \int_compare:nNnTF {#2} < { #1 + \c_@@_rand_size_int } } - { - \int_eval:n - { - #1 + - \exp_args:Nf \@@_randint_narrow:n - { \int_eval:n { #2 - #1 + 1 } } - } - } - { \fp_to_int:n { randint(#1,#2) } } - } + \if_int_compare:w #1 > #2 \exp_stop_f: + \__kernel_msg_expandable_error:nnnn + { kernel } { randint-backward-range } {#1} {#2} + \@@_randint:ww #2; #1; + \else: + \if_int_compare:w \@@_int_eval:w #2 + \if_int_compare:w #1 > \c_zero_int + - #1 < \@@_int_eval:w + \else: + < \@@_int_eval:w #1 + + \fi: + \c__kernel_randint_max_int + \@@_int_eval_end: + \__kernel_randint:n + { \@@_int_eval:w #2 - #1 + 1 \@@_int_eval_end: } + - 1 + #1 + \else: + \__kernel_randint:nn {#1} {#2} + \fi: + \fi: } - \cs_new:Npn \@@_randint_narrow:n #1 +% \end{macrocode} +% \end{macro} +% +% \begin{macro} +% { +% \__kernel_randint:nn, \@@_randint_split_o:Nw, \@@_randint_split_aux:w, +% \@@_randinat_wide_aux:w, \@@_randinat_wide_auxii:w, +% } +% Any $n\in[-2^{31}+1,2^{31}-1]$ is uniquely written as +% $2^{14}n_1+n_2$ with $n_1\in[-2^{17},2^{17}-1]$ and +% $n_2\in[0,2^{14}-1]$. Calling \cs{@@_randint_split_o:Nw} $n$ |;| +% gives $n_1$|;| $n_2$|;| and expands the next token once. We do this +% for two random numbers and apply \cs{@@_randint_split_o:Nw} twice to +% fully decompose the range~$R$. One subtlety is that we compute +% $R-2^{31}=\meta{max}-\meta{min}-(2^{31}-1)\in[-2^{31}+1,2^{31}-1]$ +% rather than $R$ to avoid overflow. +% +% Then we have \cs{@@_randint_wide_aux:w} \meta{X_1}|;|\meta{X_0}|;| +% \meta{Y_1}|;|\meta{Y_0}|;| \meta{R_2}|;|\meta{R_1}|;|\meta{R_0}|;.| +% and we apply the algorithm described earlier. +% \begin{macrocode} + \cs_new:Npn \__kernel_randint:nn #1#2 { - \exp_args:Nf \@@_randint_narrow:nn - { \int_div_truncate:nn \c_@@_rand_size_int {#1} } {#1} + #1 + \exp_after:wN \@@_randint_wide_aux:w + \int_value:w + \exp_after:wN \@@_randint_split_o:Nw + \tex_uniformdeviate:D 268435456 ; + \int_value:w + \exp_after:wN \@@_randint_split_o:Nw + \tex_uniformdeviate:D 268435456 ; + \int_value:w + \exp_after:wN \@@_randint_split_o:Nw + \int_value:w \@@_int_eval:w 131072 + + \exp_after:wN \@@_randint_split_o:Nw + \int_value:w + \__kernel_int_add:nnn {#2} { -#1 } { -\c_max_int } ; + . } - \cs_new:Npn \@@_randint_narrow:nn #1 + \cs_new:Npn \@@_randint_split_o:Nw #1#2 ; { - \exp_args:Nf \@@_randint_narrow:nnn - { - \int_div_truncate:nn - { \pdftex_uniformdeviate:D \c_@@_rand_size_int } {#1} - } - {#1} + \if_meaning:w 0 #1 + 0 \exp_after:wN ; \int_value:w 0 + \else: + \exp_after:wN \@@_randint_split_aux:w + \int_value:w \@@_int_eval:w (#1#2 - 8192) / 16384 ; + + #1#2 + \fi: + \exp_after:wN ; } - \cs_new:Npn \@@_randint_narrow:nnn #1#2#3 + \cs_new:Npn \@@_randint_split_aux:w #1 ; { - \int_compare:nNnTF {#1} < {#3} - {#1} - { \@@_randint_narrow:nn {#2} {#3} } + #1 \exp_after:wN ; + \int_value:w \@@_int_eval:w - #1 * 16384 + } + \cs_new:Npn \@@_randint_wide_aux:w #1;#2; #3;#4; #5;#6;#7; . + { + \exp_after:wN \@@_randint_wide_auxii:w + \int_value:w \@@_int_eval:w #5 * #3 + #6 * #1 + + (#5 * #4 + #6 * #3 + #7 * #1 + + (#5 * #2 + #7 * #3 + + (16384 * #6 + #7) * (16384 * #4 + #2) / 268435456) / 16384 + ) / 16384 \exp_after:wN ; + \int_value:w \@@_int_eval:w (#5 + #6) * 16384 + #7 ; + #1 ; #5 ; + } + \cs_new:Npn \@@_randint_wide_auxii:w #1; #2; #3; #4; + { + \if_int_odd:w 0 + \if_int_compare:w #1 = #2 \else: \exp_stop_f: \fi: + \if_int_compare:w #4 = \c_zero_int 1 \fi: + \if_int_compare:w #3 = 16383 ~ 1 \fi: + \exp_stop_f: + \exp_after:wN \prg_break: + \fi: + \if_int_compare:w #4 < 8 \exp_stop_f: + + #4 * #3 * 16384 + \else: + + 8 * #3 * 16384 + (#4 - 8) * #3 * 16384 + \fi: + + #1 + \prg_break_point: } % \end{macrocode} % \end{macro} -% \end{macro} -% \end{macro} -% \end{macro} +% +% \begin{macro}{\int_rand:n, \@@_randint:n} +% Similar to \cs{int_rand:nn}, but needs fewer checks. +% \begin{macrocode} + \cs_new:Npn \int_rand:n #1 + { + \int_eval:n + { \exp_args:Nf \@@_randint:n { \int_eval:n {#1} } } + } + \cs_new:Npn \@@_randint:n #1 + { + \if_int_compare:w #1 < 1 \exp_stop_f: + \__kernel_msg_expandable_error:nnnn + { kernel } { randint-backward-range } { 1 } {#1} + \@@_randint:ww #1; 1; + \else: + \if_int_compare:w #1 > \c__kernel_randint_max_int + \__kernel_randint:nn { 1 } {#1} + \else: + \__kernel_randint:n {#1} + \fi: + \fi: + } +% \end{macrocode} % \end{macro} % % End the initial conditional that ensures these commands are only diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-round.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-round.dtx index da019daf60f..610e8d60428 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3fp-round.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-round.dtx @@ -41,7 +41,7 @@ % }^^A % } % -% \date{Released 2018-04-30} +% \date{Released 2018-05-12} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-traps.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-traps.dtx index c98d5efd7d8..7baed58dc52 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3fp-traps.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-traps.dtx @@ -38,7 +38,7 @@ % {latex-team@latex-project.org}^^A % }^^A % } -% \date{Released 2018-04-30} +% \date{Released 2018-05-12} % \maketitle % % \begin{documentation} diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-trig.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-trig.dtx index 223e28a1ba7..165301268b0 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3fp-trig.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-trig.dtx @@ -38,7 +38,7 @@ % {latex-team@latex-project.org}^^A % }^^A % } -% \date{Released 2018-04-30} +% \date{Released 2018-05-12} % % \maketitle % @@ -512,178 +512,231 @@ % 24 - 5 = 23$ significant digits, enough to round correctly up to % $0.6\cdot\text{ulp}$ in all cases. % -% ^^A todo: if the exponent range is reduced, store 1/2pi as a simple tl -% \begin{variable}[EXP]{\@@_trig_inverse_two_pi:} -% This macro expands to |,,!| or~|,!| followed by $10112$~decimals of +% \begin{variable}[EXP]{\c_@@_trig_intarray} +% This integer array stores blocks of $8$~decimals of +% $10^{-16}/(2\pi)$. Each entry is $10^8$ plus an $8$~digit number +% storing $8$ decimals. In total we store $10112$~decimals of % $10^{-16}/(2\pi)$. The number of decimals we really need is the % maximum exponent plus the number of digits we later need,~$52$, -% plus~$12$ ($4-1$~groups of $4$~digits). We store the decimals as a -% control sequence name, and convert it to a token list when required: -% strings take up less memory than their token list representation. +% plus~$12$ ($4-1$~groups of $4$~digits). The memory footprint ($1/2$ +% byte per digit) is the same as an earlier method of storing the data +% as a control sequence name, but the major advantage is that we can +% unpack specific subsets of the digits without unpacking the $10112$ +% decimals. % \begin{macrocode} -\cs_new:Npx \@@_trig_inverse_two_pi: +\intarray_const_from_clist:Nn \c_@@_trig_intarray { - \exp_not:n { \exp_after:wN \use_none:n \token_to_str:N } - \cs:w , , ! - 0000000000000000159154943091895335768883763372514362034459645740 ~ - 4564487476673440588967976342265350901138027662530859560728427267 ~ - 5795803689291184611457865287796741073169983922923996693740907757 ~ - 3077746396925307688717392896217397661693362390241723629011832380 ~ - 1142226997557159404618900869026739561204894109369378440855287230 ~ - 9994644340024867234773945961089832309678307490616698646280469944 ~ - 8652187881574786566964241038995874139348609983868099199962442875 ~ - 5851711788584311175187671605465475369880097394603647593337680593 ~ - 0249449663530532715677550322032477781639716602294674811959816584 ~ - 0606016803035998133911987498832786654435279755070016240677564388 ~ - 8495713108801221993761476813777647378906330680464579784817613124 ~ - 2731406996077502450029775985708905690279678513152521001631774602 ~ - 0924811606240561456203146484089248459191435211575407556200871526 ~ - 6068022171591407574745827225977462853998751553293908139817724093 ~ - 5825479707332871904069997590765770784934703935898280871734256403 ~ - 6689511662545705943327631268650026122717971153211259950438667945 ~ - 0376255608363171169525975812822494162333431451061235368785631136 ~ - 3669216714206974696012925057833605311960859450983955671870995474 ~ - 6510431623815517580839442979970999505254387566129445883306846050 ~ - 7852915151410404892988506388160776196993073410389995786918905980 ~ - 9373777206187543222718930136625526123878038753888110681406765434 ~ - 0828278526933426799556070790386060352738996245125995749276297023 ~ - 5940955843011648296411855777124057544494570217897697924094903272 ~ - 9477021664960356531815354400384068987471769158876319096650696440 ~ - 4776970687683656778104779795450353395758301881838687937766124814 ~ - 9530599655802190835987510351271290432315804987196868777594656634 ~ - 6221034204440855497850379273869429353661937782928735937843470323 ~ - 0237145837923557118636341929460183182291964165008783079331353497 ~ - 7909974586492902674506098936890945883050337030538054731232158094 ~ - 3197676032283131418980974982243833517435698984750103950068388003 ~ - 9786723599608024002739010874954854787923568261139948903268997427 ~ - 0834961149208289037767847430355045684560836714793084567233270354 ~ - 8539255620208683932409956221175331839402097079357077496549880868 ~ - 6066360968661967037474542102831219251846224834991161149566556037 ~ - 9696761399312829960776082779901007830360023382729879085402387615 ~ - 5744543092601191005433799838904654921248295160707285300522721023 ~ - 6017523313173179759311050328155109373913639645305792607180083617 ~ - 9548767246459804739772924481092009371257869183328958862839904358 ~ - 6866663975673445140950363732719174311388066383072592302759734506 ~ - 0548212778037065337783032170987734966568490800326988506741791464 ~ - 6835082816168533143361607309951498531198197337584442098416559541 ~ - 5225064339431286444038388356150879771645017064706751877456059160 ~ - 8716857857939226234756331711132998655941596890719850688744230057 ~ - 5191977056900382183925622033874235362568083541565172971088117217 ~ - 9593683256488518749974870855311659830610139214454460161488452770 ~ - 2511411070248521739745103866736403872860099674893173561812071174 ~ - 0478899368886556923078485023057057144063638632023685201074100574 ~ - 8592281115721968003978247595300166958522123034641877365043546764 ~ - 6456565971901123084767099309708591283646669191776938791433315566 ~ - 5066981321641521008957117286238426070678451760111345080069947684 ~ - 2235698962488051577598095339708085475059753626564903439445420581 ~ - 7886435683042000315095594743439252544850674914290864751442303321 ~ - 3324569511634945677539394240360905438335528292434220349484366151 ~ - 4663228602477666660495314065734357553014090827988091478669343492 ~ - 2737602634997829957018161964321233140475762897484082891174097478 ~ - 2637899181699939487497715198981872666294601830539583275209236350 ~ - 6853889228468247259972528300766856937583659722919824429747406163 ~ - 8183113958306744348516928597383237392662402434501997809940402189 ~ - 6134834273613676449913827154166063424829363741850612261086132119 ~ - 9863346284709941839942742955915628333990480382117501161211667205 ~ - 1912579303552929241134403116134112495318385926958490443846807849 ~ - 0973982808855297045153053991400988698840883654836652224668624087 ~ - 2540140400911787421220452307533473972538149403884190586842311594 ~ - 6322744339066125162393106283195323883392131534556381511752035108 ~ - 7459558201123754359768155340187407394340363397803881721004531691 ~ - 8295194879591767395417787924352761740724605939160273228287946819 ~ - 3649128949714953432552723591659298072479985806126900733218844526 ~ - 7943350455801952492566306204876616134365339920287545208555344144 ~ - 0990512982727454659118132223284051166615650709837557433729548631 ~ - 2041121716380915606161165732000083306114606181280326258695951602 ~ - 4632166138576614804719932707771316441201594960110632830520759583 ~ - 4850305079095584982982186740289838551383239570208076397550429225 ~ - 9847647071016426974384504309165864528360324933604354657237557916 ~ - 1366324120457809969715663402215880545794313282780055246132088901 ~ - 8742121092448910410052154968097113720754005710963406643135745439 ~ - 9159769435788920793425617783022237011486424925239248728713132021 ~ - 7667360756645598272609574156602343787436291321097485897150713073 ~ - 9104072643541417970572226547980381512759579124002534468048220261 ~ - 7342299001020483062463033796474678190501811830375153802879523433 ~ - 4195502135689770912905614317878792086205744999257897569018492103 ~ - 2420647138519113881475640209760554895793785141404145305151583964 ~ - 2823265406020603311891586570272086250269916393751527887360608114 ~ - 5569484210322407772727421651364234366992716340309405307480652685 ~ - 0930165892136921414312937134106157153714062039784761842650297807 ~ - 8606266969960809184223476335047746719017450451446166382846208240 ~ - 8673595102371302904443779408535034454426334130626307459513830310 ~ - 2293146934466832851766328241515210179422644395718121717021756492 ~ - 1964449396532222187658488244511909401340504432139858628621083179 ~ - 3939608443898019147873897723310286310131486955212620518278063494 ~ - 5711866277825659883100535155231665984394090221806314454521212978 ~ - 9734471488741258268223860236027109981191520568823472398358013366 ~ - 0683786328867928619732367253606685216856320119489780733958419190 ~ - 6659583867852941241871821727987506103946064819585745620060892122 ~ - 8416394373846549589932028481236433466119707324309545859073361878 ~ - 6290631850165106267576851216357588696307451999220010776676830946 ~ - 9814975622682434793671310841210219520899481912444048751171059184 ~ - 4139907889455775184621619041530934543802808938628073237578615267 ~ - 7971143323241969857805637630180884386640607175368321362629671224 ~ - 2609428540110963218262765120117022552929289655594608204938409069 ~ - 0760692003954646191640021567336017909631872891998634341086903200 ~ - 5796637103128612356988817640364252540837098108148351903121318624 ~ - 7228181050845123690190646632235938872454630737272808789830041018 ~ - 9485913673742589418124056729191238003306344998219631580386381054 ~ - 2457893450084553280313511884341007373060595654437362488771292628 ~ - 9807423539074061786905784443105274262641767830058221486462289361 ~ - 9296692992033046693328438158053564864073184440599549689353773183 ~ - 6726613130108623588021288043289344562140479789454233736058506327 ~ - 0439981932635916687341943656783901281912202816229500333012236091 ~ - 8587559201959081224153679499095448881099758919890811581163538891 ~ - 6339402923722049848375224236209100834097566791710084167957022331 ~ - 7897107102928884897013099533995424415335060625843921452433864640 ~ - 3432440657317477553405404481006177612569084746461432976543900008 ~ - 3826521145210162366431119798731902751191441213616962045693602633 ~ - 6102355962140467029012156796418735746835873172331004745963339773 ~ - 2477044918885134415363760091537564267438450166221393719306748706 ~ - 2881595464819775192207710236743289062690709117919412776212245117 ~ - 2354677115640433357720616661564674474627305622913332030953340551 ~ - 3841718194605321501426328000879551813296754972846701883657425342 ~ - 5016994231069156343106626043412205213831587971115075454063290657 ~ - 0248488648697402872037259869281149360627403842332874942332178578 ~ - 7750735571857043787379693402336902911446961448649769719434527467 ~ - 4429603089437192540526658890710662062575509930379976658367936112 ~ - 8137451104971506153783743579555867972129358764463093757203221320 ~ - 2460565661129971310275869112846043251843432691552928458573495971 ~ - 5042565399302112184947232132380516549802909919676815118022483192 ~ - 5127372199792134331067642187484426215985121676396779352982985195 ~ - 8545392106957880586853123277545433229161989053189053725391582222 ~ - 9232597278133427818256064882333760719681014481453198336237910767 ~ - 1255017528826351836492103572587410356573894694875444694018175923 ~ - 0609370828146501857425324969212764624247832210765473750568198834 ~ - 5641035458027261252285503154325039591848918982630498759115406321 ~ - 0354263890012837426155187877318375862355175378506956599570028011 ~ - 5841258870150030170259167463020842412449128392380525772514737141 ~ - 2310230172563968305553583262840383638157686828464330456805994018 ~ - 7001071952092970177990583216417579868116586547147748964716547948 ~ - 8312140431836079844314055731179349677763739898930227765607058530 ~ - 4083747752640947435070395214524701683884070908706147194437225650 ~ - 2823145872995869738316897126851939042297110721350756978037262545 ~ - 8141095038270388987364516284820180468288205829135339013835649144 ~ - 3004015706509887926715417450706686888783438055583501196745862340 ~ - 8059532724727843829259395771584036885940989939255241688378793572 ~ - 7967951654076673927031256418760962190243046993485989199060012977 ~ - 7469214532970421677817261517850653008552559997940209969455431545 ~ - 2745856704403686680428648404512881182309793496962721836492935516 ~ - 2029872469583299481932978335803459023227052612542114437084359584 ~ - 9443383638388317751841160881711251279233374577219339820819005406 ~ - 3292937775306906607415304997682647124407768817248673421685881509 ~ - 9133422075930947173855159340808957124410634720893194912880783576 ~ - 3115829400549708918023366596077070927599010527028150868897828549 ~ - 4340372642729262103487013992868853550062061514343078665396085995 ~ - 0058714939141652065302070085265624074703660736605333805263766757 ~ - 2018839497277047222153633851135483463624619855425993871933367482 ~ - 0422097449956672702505446423243957506869591330193746919142980999 ~ - 3424230550172665212092414559625960554427590951996824313084279693 ~ - 7113207021049823238195747175985519501864630940297594363194450091 ~ - 9150616049228764323192129703446093584259267276386814363309856853 ~ - 2786024332141052330760658841495858718197071242995959226781172796 ~ - 4438853796763139274314227953114500064922126500133268623021550837 - \cs_end: + 100000000, 100000000, 115915494, 130918953, 135768883, 176337251, + 143620344, 159645740, 145644874, 176673440, 158896797, 163422653, + 150901138, 102766253, 108595607, 128427267, 157958036, 189291184, + 161145786, 152877967, 141073169, 198392292, 139966937, 140907757, + 130777463, 196925307, 168871739, 128962173, 197661693, 136239024, + 117236290, 111832380, 111422269, 197557159, 140461890, 108690267, + 139561204, 189410936, 193784408, 155287230, 199946443, 140024867, + 123477394, 159610898, 132309678, 130749061, 166986462, 180469944, + 186521878, 181574786, 156696424, 110389958, 174139348, 160998386, + 180991999, 162442875, 158517117, 188584311, 117518767, 116054654, + 175369880, 109739460, 136475933, 137680593, 102494496, 163530532, + 171567755, 103220324, 177781639, 171660229, 146748119, 159816584, + 106060168, 103035998, 113391198, 174988327, 186654435, 127975507, + 100162406, 177564388, 184957131, 108801221, 199376147, 168137776, + 147378906, 133068046, 145797848, 117613124, 127314069, 196077502, + 145002977, 159857089, 105690279, 167851315, 125210016, 131774602, + 109248116, 106240561, 145620314, 164840892, 148459191, 143521157, + 154075562, 100871526, 160680221, 171591407, 157474582, 172259774, + 162853998, 175155329, 139081398, 117724093, 158254797, 107332871, + 190406999, 175907657, 170784934, 170393589, 182808717, 134256403, + 166895116, 162545705, 194332763, 112686500, 126122717, 197115321, + 112599504, 138667945, 103762556, 108363171, 116952597, 158128224, + 194162333, 143145106, 112353687, 185631136, 136692167, 114206974, + 169601292, 150578336, 105311960, 185945098, 139556718, 170995474, + 165104316, 123815517, 158083944, 129799709, 199505254, 138756612, + 194458833, 106846050, 178529151, 151410404, 189298850, 163881607, + 176196993, 107341038, 199957869, 118905980, 193737772, 106187543, + 122271893, 101366255, 126123878, 103875388, 181106814, 106765434, + 108282785, 126933426, 179955607, 107903860, 160352738, 199624512, + 159957492, 176297023, 159409558, 143011648, 129641185, 157771240, + 157544494, 157021789, 176979240, 194903272, 194770216, 164960356, + 153181535, 144003840, 168987471, 176915887, 163190966, 150696440, + 147769706, 187683656, 177810477, 197954503, 153395758, 130188183, + 186879377, 166124814, 195305996, 155802190, 183598751, 103512712, + 190432315, 180498719, 168687775, 194656634, 162210342, 104440855, + 149785037, 192738694, 129353661, 193778292, 187359378, 143470323, + 102371458, 137923557, 111863634, 119294601, 183182291, 196416500, + 187830793, 131353497, 179099745, 186492902, 167450609, 189368909, + 145883050, 133703053, 180547312, 132158094, 131976760, 132283131, + 141898097, 149822438, 133517435, 169898475, 101039500, 168388003, + 197867235, 199608024, 100273901, 108749548, 154787923, 156826113, + 199489032, 168997427, 108349611, 149208289, 103776784, 174303550, + 145684560, 183671479, 130845672, 133270354, 185392556, 120208683, + 193240995, 162211753, 131839402, 109707935, 170774965, 149880868, + 160663609, 168661967, 103747454, 121028312, 119251846, 122483499, + 111611495, 166556037, 196967613, 199312829, 196077608, 127799010, + 107830360, 102338272, 198790854, 102387615, 157445430, 192601191, + 100543379, 198389046, 154921248, 129516070, 172853005, 122721023, + 160175233, 113173179, 175931105, 103281551, 109373913, 163964530, + 157926071, 180083617, 195487672, 146459804, 173977292, 144810920, + 109371257, 186918332, 189588628, 139904358, 168666639, 175673445, + 114095036, 137327191, 174311388, 106638307, 125923027, 159734506, + 105482127, 178037065, 133778303, 121709877, 134966568, 149080032, + 169885067, 141791464, 168350828, 116168533, 114336160, 173099514, + 198531198, 119733758, 144420984, 116559541, 152250643, 139431286, + 144403838, 183561508, 179771645, 101706470, 167518774, 156059160, + 187168578, 157939226, 123475633, 117111329, 198655941, 159689071, + 198506887, 144230057, 151919770, 156900382, 118392562, 120338742, + 135362568, 108354156, 151729710, 188117217, 195936832, 156488518, + 174997487, 108553116, 159830610, 113921445, 144601614, 188452770, + 125114110, 170248521, 173974510, 138667364, 103872860, 109967489, + 131735618, 112071174, 104788993, 168886556, 192307848, 150230570, + 157144063, 163863202, 136852010, 174100574, 185922811, 115721968, + 100397824, 175953001, 166958522, 112303464, 118773650, 143546764, + 164565659, 171901123, 108476709, 193097085, 191283646, 166919177, + 169387914, 133315566, 150669813, 121641521, 100895711, 172862384, + 126070678, 145176011, 113450800, 169947684, 122356989, 162488051, + 157759809, 153397080, 185475059, 175362656, 149034394, 145420581, + 178864356, 183042000, 131509559, 147434392, 152544850, 167491429, + 108647514, 142303321, 133245695, 111634945, 167753939, 142403609, + 105438335, 152829243, 142203494, 184366151, 146632286, 102477666, + 166049531, 140657343, 157553014, 109082798, 180914786, 169343492, + 127376026, 134997829, 195701816, 119643212, 133140475, 176289748, + 140828911, 174097478, 126378991, 181699939, 148749771, 151989818, + 172666294, 160183053, 195832752, 109236350, 168538892, 128468247, + 125997252, 183007668, 156937583, 165972291, 198244297, 147406163, + 181831139, 158306744, 134851692, 185973832, 137392662, 140243450, + 119978099, 140402189, 161348342, 173613676, 144991382, 171541660, + 163424829, 136374185, 106122610, 186132119, 198633462, 184709941, + 183994274, 129559156, 128333990, 148038211, 175011612, 111667205, + 119125793, 103552929, 124113440, 131161341, 112495318, 138592695, + 184904438, 146807849, 109739828, 108855297, 104515305, 139914009, + 188698840, 188365483, 166522246, 168624087, 125401404, 100911787, + 142122045, 123075334, 173972538, 114940388, 141905868, 142311594, + 163227443, 139066125, 116239310, 162831953, 123883392, 113153455, + 163815117, 152035108, 174595582, 101123754, 135976815, 153401874, + 107394340, 136339780, 138817210, 104531691, 182951948, 179591767, + 139541778, 179243527, 161740724, 160593916, 102732282, 187946819, + 136491289, 149714953, 143255272, 135916592, 198072479, 198580612, + 169007332, 118844526, 179433504, 155801952, 149256630, 162048766, + 116134365, 133992028, 175452085, 155344144, 109905129, 182727454, + 165911813, 122232840, 151166615, 165070983, 175574337, 129548631, + 120411217, 116380915, 160616116, 157320000, 183306114, 160618128, + 103262586, 195951602, 146321661, 138576614, 180471993, 127077713, + 116441201, 159496011, 106328305, 120759583, 148503050, 179095584, + 198298218, 167402898, 138551383, 123957020, 180763975, 150429225, + 198476470, 171016426, 197438450, 143091658, 164528360, 132493360, + 143546572, 137557916, 113663241, 120457809, 196971566, 134022158, + 180545794, 131328278, 100552461, 132088901, 187421210, 192448910, + 141005215, 149680971, 113720754, 100571096, 134066431, 135745439, + 191597694, 135788920, 179342561, 177830222, 137011486, 142492523, + 192487287, 113132021, 176673607, 156645598, 127260957, 141566023, + 143787436, 129132109, 174858971, 150713073, 191040726, 143541417, + 197057222, 165479803, 181512759, 157912400, 125344680, 148220261, + 173422990, 101020483, 106246303, 137964746, 178190501, 181183037, + 151538028, 179523433, 141955021, 135689770, 191290561, 143178787, + 192086205, 174499925, 178975690, 118492103, 124206471, 138519113, + 188147564, 102097605, 154895793, 178514140, 141453051, 151583964, + 128232654, 106020603, 131189158, 165702720, 186250269, 191639375, + 115278873, 160608114, 155694842, 110322407, 177272742, 116513642, + 134366992, 171634030, 194053074, 180652685, 109301658, 192136921, + 141431293, 171341061, 157153714, 106203978, 147618426, 150297807, + 186062669, 169960809, 118422347, 163350477, 146719017, 145045144, + 161663828, 146208240, 186735951, 102371302, 190444377, 194085350, + 134454426, 133413062, 163074595, 113830310, 122931469, 134466832, + 185176632, 182415152, 110179422, 164439571, 181217170, 121756492, + 119644493, 196532222, 118765848, 182445119, 109401340, 150443213, + 198586286, 121083179, 139396084, 143898019, 114787389, 177233102, + 186310131, 148695521, 126205182, 178063494, 157118662, 177825659, + 188310053, 151552316, 165984394, 109022180, 163144545, 121212978, + 197344714, 188741258, 126822386, 102360271, 109981191, 152056882, + 134723983, 158013366, 106837863, 128867928, 161973236, 172536066, + 185216856, 132011948, 197807339, 158419190, 166595838, 167852941, + 124187182, 117279875, 106103946, 106481958, 157456200, 160892122, + 184163943, 173846549, 158993202, 184812364, 133466119, 170732430, + 195458590, 173361878, 162906318, 150165106, 126757685, 112163575, + 188696307, 145199922, 100107766, 176830946, 198149756, 122682434, + 179367131, 108412102, 119520899, 148191244, 140487511, 171059184, + 141399078, 189455775, 118462161, 190415309, 134543802, 180893862, + 180732375, 178615267, 179711433, 123241969, 185780563, 176301808, + 184386640, 160717536, 183213626, 129671224, 126094285, 140110963, + 121826276, 151201170, 122552929, 128965559, 146082049, 138409069, + 107606920, 103954646, 119164002, 115673360, 117909631, 187289199, + 186343410, 186903200, 157966371, 103128612, 135698881, 176403642, + 152540837, 109810814, 183519031, 121318624, 172281810, 150845123, + 169019064, 166322359, 138872454, 163073727, 128087898, 130041018, + 194859136, 173742589, 141812405, 167291912, 138003306, 134499821, + 196315803, 186381054, 124578934, 150084553, 128031351, 118843410, + 107373060, 159565443, 173624887, 171292628, 198074235, 139074061, + 178690578, 144431052, 174262641, 176783005, 182214864, 162289361, + 192966929, 192033046, 169332843, 181580535, 164864073, 118444059, + 195496893, 153773183, 167266131, 130108623, 158802128, 180432893, + 144562140, 147978945, 142337360, 158506327, 104399819, 132635916, + 168734194, 136567839, 101281912, 120281622, 195003330, 112236091, + 185875592, 101959081, 122415367, 194990954, 148881099, 175891989, + 108115811, 163538891, 163394029, 123722049, 184837522, 142362091, + 100834097, 156679171, 100841679, 157022331, 178971071, 102928884, + 189701309, 195339954, 124415335, 106062584, 139214524, 133864640, + 134324406, 157317477, 155340540, 144810061, 177612569, 108474646, + 114329765, 143900008, 138265211, 145210162, 136643111, 197987319, + 102751191, 144121361, 169620456, 193602633, 161023559, 162140467, + 102901215, 167964187, 135746835, 187317233, 110047459, 163339773, + 124770449, 118885134, 141536376, 100915375, 164267438, 145016622, + 113937193, 106748706, 128815954, 164819775, 119220771, 102367432, + 189062690, 170911791, 194127762, 112245117, 123546771, 115640433, + 135772061, 166615646, 174474627, 130562291, 133320309, 153340551, + 138417181, 194605321, 150142632, 180008795, 151813296, 175497284, + 167018836, 157425342, 150169942, 131069156, 134310662, 160434122, + 105213831, 158797111, 150754540, 163290657, 102484886, 148697402, + 187203725, 198692811, 149360627, 140384233, 128749423, 132178578, + 177507355, 171857043, 178737969, 134023369, 102911446, 196144864, + 197697194, 134527467, 144296030, 189437192, 154052665, 188907106, + 162062575, 150993037, 199766583, 167936112, 181374511, 104971506, + 115378374, 135795558, 167972129, 135876446, 130937572, 103221320, + 124605656, 161129971, 131027586, 191128460, 143251843, 143269155, + 129284585, 173495971, 150425653, 199302112, 118494723, 121323805, + 116549802, 190991967, 168151180, 122483192, 151273721, 199792134, + 133106764, 121874844, 126215985, 112167639, 167793529, 182985195, + 185453921, 106957880, 158685312, 132775454, 133229161, 198905318, + 190537253, 191582222, 192325972, 178133427, 181825606, 148823337, + 160719681, 101448145, 131983362, 137910767, 112550175, 128826351, + 183649210, 135725874, 110356573, 189469487, 154446940, 118175923, + 106093708, 128146501, 185742532, 149692127, 164624247, 183221076, + 154737505, 168198834, 156410354, 158027261, 125228550, 131543250, + 139591848, 191898263, 104987591, 115406321, 103542638, 190012837, + 142615518, 178773183, 175862355, 117537850, 169565995, 170028011, + 158412588, 170150030, 117025916, 174630208, 142412449, 112839238, + 105257725, 114737141, 123102301, 172563968, 130555358, 132628403, + 183638157, 168682846, 143304568, 105994018, 170010719, 152092970, + 117799058, 132164175, 179868116, 158654714, 177489647, 116547948, + 183121404, 131836079, 184431405, 157311793, 149677763, 173989893, + 102277656, 107058530, 140837477, 152640947, 143507039, 152145247, + 101683884, 107090870, 161471944, 137225650, 128231458, 172995869, + 173831689, 171268519, 139042297, 111072135, 107569780, 137262545, + 181410950, 138270388, 198736451, 162848201, 180468288, 120582913, + 153390138, 135649144, 130040157, 106509887, 192671541, 174507066, + 186888783, 143805558, 135011967, 145862340, 180595327, 124727843, + 182925939, 157715840, 136885940, 198993925, 152416883, 178793572, + 179679516, 154076673, 192703125, 164187609, 162190243, 104699348, + 159891990, 160012977, 174692145, 132970421, 167781726, 115178506, + 153008552, 155999794, 102099694, 155431545, 127458567, 104403686, + 168042864, 184045128, 181182309, 179349696, 127218364, 192935516, + 120298724, 169583299, 148193297, 183358034, 159023227, 105261254, + 121144370, 184359584, 194433836, 138388317, 175184116, 108817112, + 151279233, 137457721, 193398208, 119005406, 132929377, 175306906, + 160741530, 149976826, 147124407, 176881724, 186734216, 185881509, + 191334220, 175930947, 117385515, 193408089, 157124410, 163472089, + 131949128, 180783576, 131158294, 100549708, 191802336, 165960770, + 170927599, 101052702, 181508688, 197828549, 143403726, 142729262, + 110348701, 139928688, 153550062, 106151434, 130786653, 196085995, + 100587149, 139141652, 106530207, 100852656, 124074703, 166073660, + 153338052, 163766757, 120188394, 197277047, 122215363, 138511354, + 183463624, 161985542, 159938719, 133367482, 104220974, 149956672, + 170250544, 164232439, 157506869, 159133019, 137469191, 142980999, + 134242305, 150172665, 121209241, 145596259, 160554427, 159095199, + 168243130, 184279693, 171132070, 121049823, 123819574, 171759855, + 119501864, 163094029, 175943631, 194450091, 191506160, 149228764, + 132319212, 197034460, 193584259, 126727638, 168143633, 109856853, + 127860243, 132141052, 133076065, 188414958, 158718197, 107124299, + 159592267, 181172796, 144388537, 196763139, 127431422, 179531145, + 100064922, 112650013, 132686230, 121550837, } % \end{macrocode} % \end{variable} @@ -691,45 +744,79 @@ % \begin{macro}[rEXP] % { % \@@_trig_large:ww, -% \@@_trig_large_auxi:wwwwww, -% \@@_trig_large_auxii:ww, -% \@@_trig_large_auxiii:wNNNNNNNN, -% \@@_trig_large_auxiv:wN +% \@@_trig_large_auxi:w, +% \@@_trig_large_auxii:w, +% \@@_trig_large_auxiii:w, % } % The exponent~|#1| is between $1$ and~$\ExplSyntaxOn \int_use:N -% \c__fp_max_exponent_int$. We discard the integer part of -% $10^{\text{\texttt{\#1}}-16}/(2\pi)$, that is, the first |#1|~digits -% of $10^{-16}/(2\pi)$, because it yields an integer contribution to -% $x/(2\pi)$. The \texttt{auxii} auxiliary discards~$64$ digits at a -% time thanks to spaces inserted in the result of -% \cs{@@_trig_inverse_two_pi:}, while \texttt{auxiii} discards~$8$ -% digits at a time, and \texttt{auxiv} discards digits one at a time. -% Then $64$~digits are packed into groups of~$4$ and the \texttt{auxv} -% auxiliary is called. +% \c__fp_max_exponent_int$. We wish to look up decimals +% $10^{\text{\texttt{\#1}}-16}/(2\pi)$ starting from the digit +% $|#1|+1$. Since they are stored in batches of~$8$, compute +% $\lfloor|#1|/8\rfloor$ and fetch blocks of $8$ digits starting +% there. The numbering of items in \cs{c_@@_trig_intarray} starts +% at~$1$, so the block $\lfloor|#1|/8\rfloor+1$ contains the digit we +% want, at one of the eight positions. Each call to \cs{int_value:w} +% \cs{__kernel_intarray_item:Nn} expands the next, until being stopped +% by \cs{@@_trig_large_auxiii:w} using \cs{exp_stop_f:}. Once all +% these blocks are unpacked, the \cs{exp_stop_f:} and $0$ to $7$ +% digits are removed by \cs[no-index]{use_none:n\ldots{}n}. +% Finally, \cs{@@_trig_large_auxii:w} packs $64$ digits (there are +% between $65$ and $72$ at this point) into groups of~$4$ and the +% \texttt{auxv} auxiliary is called. % \begin{macrocode} \cs_new:Npn \@@_trig_large:ww #1, #2#3#4#5#6; { - \exp_after:wN \@@_trig_large_auxi:wwwwww - \int_value:w \@@_int_eval:w (#1 - 32) / 64 \exp_after:wN , + \exp_after:wN \@@_trig_large_auxi:w \int_value:w \@@_int_eval:w (#1 - 4) / 8 \exp_after:wN , - \int_value:w #1 \@@_trig_inverse_two_pi: ; + \int_value:w #1 , ; {#2}{#3}{#4}{#5} ; } -\cs_new:Npn \@@_trig_large_auxi:wwwwww #1, #2, #3, #4! +\cs_new:Npn \@@_trig_large_auxi:w #1, #2, + { + \exp_after:wN \exp_after:wN + \exp_after:wN \@@_trig_large_auxii:w + \cs:w + use_none:n \prg_replicate:nn { #2 - #1 * 8 } { n } + \exp_after:wN + \cs_end: + \int_value:w + \__kernel_intarray_item:Nn \c_@@_trig_intarray + { \@@_int_eval:w #1 + 1 \scan_stop: } + \exp_after:wN \@@_trig_large_auxiii:w \int_value:w + \__kernel_intarray_item:Nn \c_@@_trig_intarray + { \@@_int_eval:w #1 + 2 \scan_stop: } + \exp_after:wN \@@_trig_large_auxiii:w \int_value:w + \__kernel_intarray_item:Nn \c_@@_trig_intarray + { \@@_int_eval:w #1 + 3 \scan_stop: } + \exp_after:wN \@@_trig_large_auxiii:w \int_value:w + \__kernel_intarray_item:Nn \c_@@_trig_intarray + { \@@_int_eval:w #1 + 4 \scan_stop: } + \exp_after:wN \@@_trig_large_auxiii:w \int_value:w + \__kernel_intarray_item:Nn \c_@@_trig_intarray + { \@@_int_eval:w #1 + 5 \scan_stop: } + \exp_after:wN \@@_trig_large_auxiii:w \int_value:w + \__kernel_intarray_item:Nn \c_@@_trig_intarray + { \@@_int_eval:w #1 + 6 \scan_stop: } + \exp_after:wN \@@_trig_large_auxiii:w \int_value:w + \__kernel_intarray_item:Nn \c_@@_trig_intarray + { \@@_int_eval:w #1 + 7 \scan_stop: } + \exp_after:wN \@@_trig_large_auxiii:w \int_value:w + \__kernel_intarray_item:Nn \c_@@_trig_intarray + { \@@_int_eval:w #1 + 8 \scan_stop: } + \exp_after:wN \@@_trig_large_auxiii:w \int_value:w + \__kernel_intarray_item:Nn \c_@@_trig_intarray + { \@@_int_eval:w #1 + 9 \scan_stop: } + \exp_stop_f: + } +\cs_new:Npn \@@_trig_large_auxii:w { - \prg_replicate:nn {#1} { \@@_trig_large_auxii:ww } - \prg_replicate:nn { #2 - #1 * 8 } - { \@@_trig_large_auxiii:wNNNNNNNN } - \prg_replicate:nn { #3 - #2 * 8 } - { \@@_trig_large_auxiv:wN } - \prg_replicate:nn { 8 } { \@@_pack_twice_four:wNNNNNNNN } - \@@_trig_large_auxv:www - ; + \@@_pack_twice_four:wNNNNNNNN \@@_pack_twice_four:wNNNNNNNN + \@@_pack_twice_four:wNNNNNNNN \@@_pack_twice_four:wNNNNNNNN + \@@_pack_twice_four:wNNNNNNNN \@@_pack_twice_four:wNNNNNNNN + \@@_pack_twice_four:wNNNNNNNN \@@_pack_twice_four:wNNNNNNNN + \@@_trig_large_auxv:www ; } -\cs_new:Npn \@@_trig_large_auxii:ww #1; #2 ~ { #1; } -\cs_new:Npn \@@_trig_large_auxiii:wNNNNNNNN - #1; #2#3#4#5#6#7#8#9 { #1; } -\cs_new:Npn \@@_trig_large_auxiv:wN #1; #2 { #1; } +\cs_new:Npn \@@_trig_large_auxiii:w 1 { \exp_stop_f: } % \end{macrocode} % \end{macro} % @@ -741,7 +828,7 @@ % } % First come the first $64$~digits of the fractional part of % $10^{\text{\texttt{\#1}}-16}/(2\pi)$, arranged in $16$~blocks -% of~$4$, and ending with a semicolon. Then some more digits of the +% of~$4$, and ending with a semicolon. Then a few more digits of the % same fractional part, ending with a semicolon, then $4$~blocks of % $4$~digits holding the significand of the original argument. % Multiply the $16$-digit significand with the $64$-digit fractional diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp.dtx index 06a0754ab6c..3c44cbd67b1 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3fp.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3fp.dtx @@ -47,7 +47,7 @@ % }^^A % } % -% \date{Released 2018-04-30} +% \date{Released 2018-05-12} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fparray.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fparray.dtx new file mode 100644 index 00000000000..199e53572cb --- /dev/null +++ b/Master/texmf-dist/source/latex/l3kernel/l3fparray.dtx @@ -0,0 +1,331 @@ +% \iffalse meta-comment +% +%% File: l3fparray.dtx Copyright (C) 2018 The LaTeX3 Project +% +% It may be distributed and/or modified under the conditions of the +% LaTeX Project Public License (LPPL), either version 1.3c of this +% license or (at your option) any later version. The latest version +% of this license is in the file +% +% https://www.latex-project.org/lppl.txt +% +% This file is part of the "l3kernel bundle" (The Work in LPPL) +% and all files in that bundle must be distributed together. +% +% ----------------------------------------------------------------------- +% +% The development version of the bundle can be found at +% +% https://github.com/latex3/latex3 +% +% for those people who are interested. +% +%<*driver> +\documentclass[full,kernel]{l3doc} +\begin{document} + \DocInput{\jobname.dtx} +\end{document} +%</driver> +% \fi +% +% +% \title{^^A +% The \textsf{l3fparray} package: fast global floating point arrays^^A +% } +% +% \author{^^A +% The \LaTeX3 Project\thanks +% {^^A +% E-mail: +% \href{mailto:latex-team@latex-project.org} +% {latex-team@latex-project.org}^^A +% }^^A +% } +% +% \date{Released 2018-05-12} +% +% \maketitle +% +% \begin{documentation} +% +% \section{\pkg{l3fparray} documentation} +% +% For applications requiring heavy use of floating points, this module +% provides arrays which can be accessed in constant time (contrast +% \pkg{l3seq}, where access time is linear). The interface is very +% close to that of \pkg{l3intarray}. The size of the array is fixed and +% must be given at point of initialisation +% +% Currently \emph{all} functions in this module are candidates. Their +% documentation can be found in \pkg{l3candidates}. +% +% \end{documentation} +% +% \begin{implementation} +% +% \section{\pkg{l3fparray} implementation} +% +% \begin{macrocode} +%<*initex|package> +% \end{macrocode} +% +% \begin{macrocode} +%<@@=fp> +% \end{macrocode} +% +% In analogy to \pkg{l3intarray} it would make sense to have +% |<@@=fparray>|, but we need direct access to \cs{@@_parse:n} from +% \pkg{l3fp-parse}, and a few other (less crucial) internals of the +% \pkg{l3fp} family. +% +% \subsection{Allocating arrays} +% +% There are somewhat more than $(2^{31}-1)^2$ floating point numbers so +% we store each floating point number as three entries in integer +% arrays. To avoid having to multiply indices by three or to add 1 etc, +% a floating point array is just a token list consisting of three +% tokens: integer arrays of the same size. +% +% \begin{variable}{\g_@@_array_int} +% Used to generate unique names for the three integer arrays. +% \begin{macrocode} +\int_new:N \g_@@_array_int +% \end{macrocode} +% \end{variable} +% +% \begin{variable}{\l_@@_array_loop_int} +% Used to loop in \cs{@@_array_gzero:N}. +% \begin{macrocode} +\int_new:N \l_@@_array_loop_int +% \end{macrocode} +% \end{variable} +% +% \begin{macro}{\fparray_new:Nn, \@@_array_new:nNNN} +% Build a three token token list, then define all three tokens to be +% integer arrays of the same size. No need to initialize the data: +% the integer arrays start with zeros, and three zeros denote +% precisely \cs{c_zero_fp}, as we want. +% \begin{macrocode} +\cs_new_protected:Npn \fparray_new:Nn #1#2 + { + \tl_new:N #1 + \prg_replicate:nn { 3 } + { + \int_gincr:N \g_@@_array_int + \exp_args:NNc \tl_gput_right:Nn #1 + { g_@@_array_ \@@_int_to_roman:w \g_@@_array_int _intarray } + } + \exp_last_unbraced:Nfo \@@_array_new:nNNNN + { \int_eval:n {#2} } #1 #1 + } +\cs_new_protected:Npn \@@_array_new:nNNNN #1#2#3#4#5 + { + \int_compare:nNnTF {#1} < 0 + { + \__kernel_msg_error:nnn { kernel } { negative-array-size } {#1} + \cs_undefine:N #1 + \int_gsub:Nn \g_@@_array_int { 3 } + } + { + \intarray_new:Nn #2 {#1} + \intarray_new:Nn #3 {#1} + \intarray_new:Nn #4 {#1} + } + } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}[EXP]{\fparray_count:N} +% Size of any of the intarrays, here we pick the third. +% \begin{macrocode} +\cs_new:Npn \fparray_count:N #1 + { + \exp_after:wN \use_i:nnn + \exp_after:wN \intarray_count:N #1 + } +% \end{macrocode} +% \end{macro} +% +% \subsection{Array items} +% +% \begin{macro}[EXP]{\@@_array_bounds:NNnTF, \@@_array_bounds_error:NNn} +% See the \pkg{l3intarray} analogue: only names change. +% The functions \cs{fparray_gset:Nnn} and \cs{fparray_item:Nn} share +% bounds checking. The |T| branch is used if |#3| is within bounds of +% the array |#2|. +% \begin{macrocode} +\cs_new:Npn \@@_array_bounds:NNnTF #1#2#3#4#5 + { + \if_int_compare:w 1 > #3 \exp_stop_f: + \@@_array_bounds_error:NNn #1 #2 {#3} + #5 + \else: + \if_int_compare:w #3 > \fparray_count:N #2 \exp_stop_f: + \@@_array_bounds_error:NNn #1 #2 {#3} + #5 + \else: + #4 + \fi: + \fi: + } +\cs_new:Npn \@@_array_bounds_error:NNn #1#2#3 + { + #1 { kernel } { out-of-bounds } + { \token_to_str:N #2 } {#3} { \fparray_count:N #2 } + } +% \end{macrocode} +% \end{macro} +% +% \begin{macro} +% { +% \fparray_gset:Nnn, \@@_array_gset:NNNNww, \@@_array_gset:w, +% \@@_array_gset_recover:Nw, \@@_array_gset_special:nnNNN, +% \@@_array_gset_normal:w +% } +% Evaluate, then store exponent in one intarray, sign and $8$ digits +% of mantissa in the next, and $8$ trailing digits in the last. +% \begin{macrocode} +\cs_new_protected:Npn \fparray_gset:Nnn #1#2#3 + { + \exp_after:wN \exp_after:wN + \exp_after:wN \@@_array_gset:NNNNww + \exp_after:wN #1 + \exp_after:wN #1 + \int_value:w \int_eval:n {#2} \exp_after:wN ; + \exp:w \exp_end_continue_f:w \@@_parse:n {#3} + } +\cs_new_protected:Npn \@@_array_gset:NNNNww #1#2#3#4#5 ; #6 ; + { + \@@_array_bounds:NNnTF \__kernel_msg_error:nnxxx #4 {#5} + { + \exp_after:wN \@@_change_func_type:NNN + \@@_use_i_until_s:nw #6 ; + \@@_array_gset:w + \@@_array_gset_recover:Nw + #6 ; {#5} #1 #2 #3 + } + { } + } +\cs_new_protected:Npn \@@_array_gset_recover:Nw #1#2 ; + { + \@@_error:nffn { fp-unknown-type } { \tl_to_str:n { #2 ; } } { } { } + \exp_after:wN #1 \c_nan_fp + } +\cs_new_protected:Npn \@@_array_gset:w \s_@@ \@@_chk:w #1#2 + { + \if_case:w #1 \exp_stop_f: + \@@_case_return:nw { \@@_array_gset_special:nnNNN {#2} } + \or: \exp_after:wN \@@_array_gset_normal:w + \or: \@@_case_return:nw { \@@_array_gset_special:nnNNN { #2 3 } } + \or: \@@_case_return:nw { \@@_array_gset_special:nnNNN { 1 } } + \fi: + \s_@@ \@@_chk:w #1 #2 + } +\cs_new_protected:Npn \@@_array_gset_normal:w + \s_@@ \@@_chk:w 1 #1 #2 #3#4#5 ; #6#7#8#9 + { + \__kernel_intarray_gset:Nnn #7 {#6} {#2} + \__kernel_intarray_gset:Nnn #8 {#6} + { \if_meaning:w 2 #1 3 \else: 1 \fi: #3#4 } + \__kernel_intarray_gset:Nnn #9 {#6} { 1 \use:nn #5 } + } +\cs_new_protected:Npn \@@_array_gset_special:nnNNN #1#2#3#4#5 + { + \__kernel_intarray_gset:Nnn #3 {#2} {#1} + \__kernel_intarray_gset:Nnn #4 {#2} {0} + \__kernel_intarray_gset:Nnn #5 {#2} {0} + } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\fparray_gzero:N} +% \begin{macrocode} +\cs_new_protected:Npn \fparray_gzero:N #1 + { + \int_zero:N \l_@@_array_loop_int + \prg_replicate:nn { \fparray_count:N #1 } + { + \int_incr:N \l_@@_array_loop_int + \exp_after:wN \@@_array_gset_special:nnNNN + \exp_after:wN 0 + \exp_after:wN \l_@@_array_loop_int + #1 + } + } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}[EXP] +% { +% \fparray_item:Nn, +% \fparray_item_to_tl:Nn, +% \@@_array_item:NwN, +% \@@_array_item:NNNnN, +% \@@_array_item:N, +% \@@_array_item:w, +% \@@_array_item_special:w, +% \@@_array_item_normal:w +% } +% \begin{macrocode} +\cs_new:Npn \fparray_item:Nn #1#2 + { + \exp_after:wN \@@_array_item:NwN + \exp_after:wN #1 + \int_value:w \int_eval:n {#2} ; + \@@_to_decimal:w + } +\cs_new:Npn \fparray_item_to_tl:Nn #1#2 + { + \exp_after:wN \@@_array_item:NwN + \exp_after:wN #1 + \int_value:w \int_eval:n {#2} ; + \@@_to_tl:w + } +\cs_new:Npn \@@_array_item:NwN #1#2 ; #3 + { + \@@_array_bounds:NNnTF \__kernel_msg_expandable_error:nnfff #1 {#2} + { \exp_after:wN \@@_array_item:NNNnN #1 {#2} #3 } + { \exp_after:wN #3 \c_nan_fp } + } +\cs_new:Npn \@@_array_item:NNNnN #1#2#3#4 + { + \exp_after:wN \@@_array_item:N + \int_value:w \__kernel_intarray_item:Nn #2 {#4} \exp_after:wN ; + \int_value:w \__kernel_intarray_item:Nn #3 {#4} \exp_after:wN ; + \int_value:w \__kernel_intarray_item:Nn #1 {#4} ; + } +\cs_new:Npn \@@_array_item:N #1 + { + \if_meaning:w 0 #1 \exp_after:wN \@@_array_item_special:w \fi: + \@@_array_item:w #1 + } +\cs_new:Npn \@@_array_item:w #1 #2#3#4#5 #6 ; 1 #7 ; + { + \exp_after:wN \@@_array_item_normal:w + \int_value:w \if_meaning:w #1 1 0 \else: 2 \fi: \exp_stop_f: + #7 ; {#2#3#4#5} {#6} ; + } +\cs_new:Npn \@@_array_item_special:w #1 ; #2 ; #3 ; #4 + { + \exp_after:wN #4 + \exp:w \exp_end_continue_f:w + \if_case:w #3 \exp_stop_f: + \exp_after:wN \c_zero_fp + \or: \exp_after:wN \c_nan_fp + \or: \exp_after:wN \c_minus_zero_fp + \or: \exp_after:wN \c_inf_fp + \else: \exp_after:wN \c_minus_inf_fp + \fi: + } +\cs_new:Npn \@@_array_item_normal:w #1 #2#3#4#5 #6 ; #7 ; #8 ; #9 + { #9 \s_@@ \@@_chk:w 1 #1 {#8} #7 {#2#3#4#5} {#6} ; } +% \end{macrocode} +% \end{macro} +% +% \begin{macrocode} +%</initex|package> +% \end{macrocode} +% +% \end{implementation} +% +% \PrintIndex diff --git a/Master/texmf-dist/source/latex/l3kernel/l3int.dtx b/Master/texmf-dist/source/latex/l3kernel/l3int.dtx index 58c13e5ec41..4b75c60f836 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3int.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3int.dtx @@ -41,7 +41,7 @@ % }^^A % } % -% \date{Released 2018-04-30} +% \date{Released 2018-05-12} % % \maketitle % @@ -829,33 +829,8 @@ % % \section{Constant integers} % -% \begin{variable} -% { -% \c_zero , -% \c_one , -% \c_two , -% \c_three , -% \c_four , -% \c_five , -% \c_six , -% \c_seven , -% \c_eight , -% \c_nine , -% \c_ten , -% \c_eleven , -% \c_twelve , -% \c_thirteen , -% \c_fourteen , -% \c_fifteen , -% \c_sixteen , -% \c_thirty_two , -% \c_one_hundred , -% \c_two_hundred_fifty_five , -% \c_two_hundred_fifty_six , -% \c_one_thousand , -% \c_ten_thousand -% } -% Integer values used with primitive tests and assignments: +% \begin{variable}[added = 2018-05-07]{\c_zero_int, \c_one_int} +% Integer values used with primitive tests and assignments: their % self-terminating nature makes these more convenient and faster than % literal numbers. % \end{variable} @@ -1011,7 +986,7 @@ % expressions. % \begin{macrocode} \cs_new_eq:NN \int_value:w \tex_number:D -\cs_new_eq:NN \@@_eval:w \etex_numexpr:D +\cs_new_eq:NN \@@_eval:w \tex_numexpr:D \cs_new_eq:NN \@@_eval_end: \tex_relax:D \cs_new_eq:NN \if_int_odd:w \tex_ifodd:D \cs_new_eq:NN \if_case:w \tex_ifcase:D @@ -1178,6 +1153,27 @@ % \end{macro} % \end{macro} % +% \begin{macro}[EXP]{\__kernel_int_add:nnn} +% Equivalent to \cs{int_eval:n} |{#1+#2+#3}| except that overflow only +% occurs if the final result overflows $[-2^{31}+1,2^{31}-1]$. The +% idea is to choose the order in which the three numbers are added +% together. If |#1| and |#2| have opposite signs (one is in +% $[-2^{31}+1,-1]$ and the other in $[0,2^{31}-1]$) then |#1+#2| +% cannot overflow so we compute the result as |#1+#2+#3|. If they +% have the same sign, then either |#3| has the same sign and the order +% does not matter, or |#3| has the opposite sign and any order in +% which |#3| is not last will work. We use |#1+#3+#2|. +% \begin{macrocode} +\cs_new:Npn \__kernel_int_add:nnn #1#2#3 + { + \int_value:w \@@_eval:w #1 + \if_int_compare:w #2 < \c_zero_int \exp_after:wN \reverse_if:N \fi: + \if_int_compare:w #1 < \c_zero_int + #2 + #3 \else: + #3 + #2 \fi: + \@@_eval_end: + } +% \end{macrocode} +% \end{macro} +% % \subsection{Creating and initialising integers} % % \begin{macro}{\int_new:N, \int_new:c} @@ -1216,7 +1212,7 @@ { {#1} { \__kernel_chk_expr:nNnN {#2} \@@_eval:w { } \int_const:Nn } } \cs_new_protected:Npn \int_const:Nn #1#2 { - \int_compare:nNnTF {#2} < \c_zero + \int_compare:nNnTF {#2} < \c_zero_int { \int_new:N #1 \tex_global:D @@ -1236,12 +1232,12 @@ } \cs_generate_variant:Nn \int_const:Nn { c } \if_int_odd:w 0 - \cs_if_exist:NT \luatex_luatexversion:D { 1 } - \cs_if_exist:NT \uptex_disablecjktoken:D - { \if_int_compare:w \ptex_jis:D "2121 = "3000 ~ 1 \fi: } - \cs_if_exist:NT \xetex_XeTeXversion:D { 1 } ~ - \cs_if_exist:NTF \uptex_disablecjktoken:D - { \cs_new_eq:NN \@@_constdef:Nw \uptex_kchardef:D } + \cs_if_exist:NT \tex_luatexversion:D { 1 } + \cs_if_exist:NT \tex_disablecjktoken:D + { \if_int_compare:w \tex_jis:D "2121 = "3000 ~ 1 \fi: } + \cs_if_exist:NT \tex_XeTeXversion:D { 1 } ~ + \cs_if_exist:NTF \tex_disablecjktoken:D + { \cs_new_eq:NN \@@_constdef:Nw \tex_kchardef:D } { \cs_new_eq:NN \@@_constdef:Nw \tex_chardef:D } \@@_constdef:Nw \c_@@_max_constdef_int 1114111 ~ \else: @@ -1260,9 +1256,9 @@ % Functions that reset an \meta{integer} register to zero. % \begin{macrocode} \__kernel_patch:nnNNpn { \__kernel_chk_var_local:N #1 } { } -\cs_new_protected:Npn \int_zero:N #1 { #1 = \c_zero } +\cs_new_protected:Npn \int_zero:N #1 { #1 = \c_zero_int } \__kernel_patch:nnNNpn { \__kernel_chk_var_global:N #1 } { } -\cs_new_protected:Npn \int_gzero:N #1 { \tex_global:D #1 = \c_zero } +\cs_new_protected:Npn \int_gzero:N #1 { \tex_global:D #1 = \c_zero_int } \cs_generate_variant:Nn \int_zero:N { c } \cs_generate_variant:Nn \int_gzero:N { c } % \end{macrocode} @@ -1377,16 +1373,16 @@ % \begin{macrocode} \__kernel_patch:nnNNpn { \__kernel_chk_var_local:N #1 } { } \cs_new_protected:Npn \int_incr:N #1 - { \tex_advance:D #1 \c_one } + { \tex_advance:D #1 \c_one_int } \__kernel_patch:nnNNpn { \__kernel_chk_var_local:N #1 } { } \cs_new_protected:Npn \int_decr:N #1 - { \tex_advance:D #1 - \c_one } + { \tex_advance:D #1 - \c_one_int } \__kernel_patch:nnNNpn { \__kernel_chk_var_global:N #1 } { } \cs_new_protected:Npn \int_gincr:N #1 - { \tex_global:D \tex_advance:D #1 \c_one } + { \tex_global:D \tex_advance:D #1 \c_one_int } \__kernel_patch:nnNNpn { \__kernel_chk_var_global:N #1 } { } \cs_new_protected:Npn \int_gdecr:N #1 - { \tex_global:D \tex_advance:D #1 - \c_one } + { \tex_global:D \tex_advance:D #1 - \c_one_int } \cs_generate_variant:Nn \int_incr:N { c } \cs_generate_variant:Nn \int_decr:N { c } \cs_generate_variant:Nn \int_gincr:N { c } @@ -1451,7 +1447,7 @@ % \begin{macrocode} \cs_new_protected:Npn \@@_compare_error: { - \if_int_compare:w \c_zero \c_zero \fi: + \if_int_compare:w \c_zero_int \c_zero_int \fi: = \@@_compare_error: } @@ -1459,7 +1455,7 @@ #1#2 \q_stop { { } - \c_zero \fi: + \c_zero_int \fi: \__kernel_msg_expandable_error:nnn { kernel } { unknown-comparison } {#1} \prg_return_false: @@ -1692,10 +1688,10 @@ { { \__kernel_chk_expr:nNnN {#1} \@@_eval:w { } \int_if_even:n } } \prg_new_conditional:Npnn \int_if_even:n #1 { p , T , F , TF} { - \if_int_odd:w \@@_eval:w #1 \@@_eval_end: - \prg_return_false: - \else: + \reverse_if:N \if_int_odd:w \@@_eval:w #1 \@@_eval_end: \prg_return_true: + \else: + \prg_return_false: \fi: } % \end{macrocode} @@ -1831,10 +1827,10 @@ } \cs_new:Npn \@@_step:wwwN #1; #2; #3; #4 { - \int_compare:nNnTF {#2} > \c_zero + \int_compare:nNnTF {#2} > \c_zero_int { \@@_step:NwnnN > } { - \int_compare:nNnTF {#2} = \c_zero + \int_compare:nNnTF {#2} = \c_zero_int { \__kernel_msg_expandable_error:nnn { kernel } { zero-step } {#4} @@ -2502,59 +2498,10 @@ % % \subsection{Constant integers} % -% \begin{variable}{\c_zero} -% Again, in \pkg{l3basics} -% \end{variable} -% -% \begin{variable} -% { -% \c_one, \c_two, \c_three, \c_four, \c_five, \c_six, \c_seven, \c_eight, -% \c_nine, \c_ten, \c_eleven, \c_twelve, \c_thirteen, \c_fourteen, -% \c_fifteen, \c_sixteen -% } -% Low-number values not previously defined. -% \begin{macrocode} -\int_const:Nn \c_one { 1 } -\int_const:Nn \c_two { 2 } -\int_const:Nn \c_three { 3 } -\int_const:Nn \c_four { 4 } -\int_const:Nn \c_five { 5 } -\int_const:Nn \c_six { 6 } -\int_const:Nn \c_seven { 7 } -\int_const:Nn \c_eight { 8 } -\int_const:Nn \c_nine { 9 } -\int_const:Nn \c_ten { 10 } -\int_const:Nn \c_eleven { 11 } -\int_const:Nn \c_twelve { 12 } -\int_const:Nn \c_thirteen { 13 } -\int_const:Nn \c_fourteen { 14 } -\int_const:Nn \c_fifteen { 15 } -\int_const:Nn \c_sixteen { 16 } -% \end{macrocode} -% \end{variable} -% -% \begin{variable}{\c_thirty_two} -% One middling value. -% \begin{macrocode} -\int_const:Nn \c_thirty_two { 32 } -% \end{macrocode} -% \end{variable} -% -% \begin{variable}{\c_two_hundred_fifty_five, \c_two_hundred_fifty_six} -% Two classic mid-range integer constants. -% \begin{macrocode} -\int_const:Nn \c_two_hundred_fifty_five { 255 } -\int_const:Nn \c_two_hundred_fifty_six { 256 } -% \end{macrocode} -%\end{variable} -% -% \begin{variable} -% {\c_one_hundred, \c_one_thousand, \c_ten_thousand} -% Simple runs of powers of ten. +% \begin{variable}{\c_zero_int, \c_one_int} +% The zero is defined in \pkg{l3basics}. % \begin{macrocode} -\int_const:Nn \c_one_hundred { 100 } -\int_const:Nn \c_one_thousand { 1000 } -\int_const:Nn \c_ten_thousand { 10000 } +\int_const:Nn \c_one_int { 1 } % \end{macrocode} % \end{variable} % @@ -2574,8 +2521,8 @@ \int_const:Nn \c_max_char_int { \if_int_odd:w 0 - \cs_if_exist:NT \luatex_luatexversion:D { 1 } - \cs_if_exist:NT \xetex_XeTeXversion:D { 1 } ~ + \cs_if_exist:NT \tex_luatexversion:D { 1 } + \cs_if_exist:NT \tex_XeTeXversion:D { 1 } ~ "10FFFF \else: "FF @@ -2602,14 +2549,15 @@ % \subsection{Deprecated} % % \begin{variable}[deprecated = 2018-12-31]{\c_minus_one} -% The actual allocation mechanism is in \pkg{l3alloc}; it requires -% \cs{c_one} to be defined. In package mode, reuse \tn{m@ne}. +% The actual allocation mechanism is in \pkg{l3alloc}. +% In package mode, reuse \tn{m@ne}. % We also store in two global token lists some code for -% \cs{debug_deprecation_on:} and \cs{debug_deprecation_off:}. For the +% \cs{debug_on:n} \texttt{\{deprecation\}} and \cs{debug_off:n} +% \texttt{\{deprecation\}}. For the % latter, we need to locally set \cs{c_minus_one} back to the constant % hence use a private name. We use \cs{tex_let:D} directly because % \cs{c_minus_one} (as all deprecated commands) is made outer by -% \cs{debug_deprecation_on:}. +% \cs{debug_on:n} \texttt{\{deprecation\}}. % \begin{macrocode} %<package>\cs_gset_eq:NN \c_@@_minus_one \m@ne %<initex>\int_const:Nn \c_@@_minus_one { -1 } @@ -2620,6 +2568,66 @@ % \end{macrocode} % \end{variable} % +% \begin{variable}[deprecated = 2019-12-31] +% { +% \c_zero, \c_one, \c_two, \c_three, \c_four, \c_five, \c_six, +% \c_seven, \c_eight, \c_nine, \c_ten, \c_eleven, \c_twelve, +% \c_thirteen, \c_fourteen, \c_fifteen, \c_sixteen, \c_thirty_two, +% \c_one_hundred, \c_two_hundred_fifty_five, +% \c_two_hundred_fifty_six, \c_one_thousand, \c_ten_thousand, +% } +% \begin{macro}{\@@_deprecated_constants:nn} +% Constants that are now deprecated. By default define them with +% \cs{int_const:Nn}. To deprecate them call for instance +% \cs{__kernel_deprecation_error:Nnn} \cs{c_zero} |{0}| +% |{2019-12-31}|. To redefine them (locally), use +% \cs{@@_constdef:Nw}, with an \cs{exp_not:N} construction because the +% constants themselves are outer at that point. +% \begin{macrocode} +\cs_new_protected:Npn \@@_deprecated_constants:nn #1#2 + { + #1 \c_zero { 0 } #2 + #1 \c_one { 1 } #2 + #1 \c_two { 2 } #2 + #1 \c_three { 3 } #2 + #1 \c_four { 4 } #2 + #1 \c_five { 5 } #2 + #1 \c_six { 6 } #2 + #1 \c_seven { 7 } #2 + #1 \c_eight { 8 } #2 + #1 \c_nine { 9 } #2 + #1 \c_ten { 10 } #2 + #1 \c_eleven { 11 } #2 + #1 \c_twelve { 12 } #2 + #1 \c_thirteen { 13 } #2 + #1 \c_fourteen { 14 } #2 + #1 \c_fifteen { 15 } #2 + #1 \c_sixteen { 16 } #2 + #1 \c_thirty_two { 32 } #2 + #1 \c_one_hundred { 100 } #2 + #1 \c_two_hundred_fifty_five { 255 } #2 + #1 \c_two_hundred_fifty_six { 256 } #2 + #1 \c_one_thousand { 1000 } #2 + #1 \c_ten_thousand { 10000 } #2 + } +\@@_deprecated_constants:nn { \int_const:Nn } { } +\__kernel_deprecation_code:nn + { + \@@_deprecated_constants:nn + { \__kernel_deprecation_error:Nnn } { { 2019-12-31 } } + } + { + \@@_deprecated_constants:nn + { + \exp_after:wN \use:nnn + \exp_after:wN \@@_constdef:Nw \exp_not:N + } + { \exp_stop_f: } + } +% \end{macrocode} +% \end{macro} +% \end{variable} +% % \begin{macro}[deprecated = 2019-12-31]{\@@_value:w} % Made public. % \begin{macrocode} diff --git a/Master/texmf-dist/source/latex/l3kernel/l3intarray.dtx b/Master/texmf-dist/source/latex/l3kernel/l3intarray.dtx index 9ccc892e28d..90d734c438a 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3intarray.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3intarray.dtx @@ -42,7 +42,7 @@ % }^^A % } % -% \date{Released 2018-04-30} +% \date{Released 2018-05-12} % % \maketitle % @@ -70,6 +70,8 @@ % \end{syntax} % Evaluates the integer expression \meta{size} and allocates an % \meta{integer array variable} with that number of (zero) entries. +% The variable name should start with |\g_| because assignments are +% always global. % \end{function} % % \begin{function}[EXP, added = 2018-03-29]{\intarray_count:N} @@ -92,6 +94,14 @@ % global. % \end{function} % +% \begin{function}[added = 2018-05-04]{\intarray_gzero:N} +% \begin{syntax} +% \cs{intarray_gzero:N} \meta{intarray~var} +% \end{syntax} +% Sets all entries of the \meta{integer array variable} to zero. +% Assignments are always global. +% \end{function} +% % \begin{function}[EXP, added = 2018-03-29]{\intarray_item:Nn} % \begin{syntax} % \cs{intarray_item:Nn} \meta{intarray~var} \Arg{position} @@ -133,6 +143,21 @@ % % \subsection{Allocating arrays} % +% \begin{macro}{\@@_entry:w, \@@_count:w} +% We use these primitives quite a lot in this module. +% \begin{macrocode} +\cs_new_eq:NN \@@_entry:w \tex_fontdimen:D +\cs_new_eq:NN \@@_count:w \tex_hyphenchar:D +% \end{macrocode} +% \end{macro} +% +% \begin{variable}{\l_@@_loop_int} +% A loop index. +% \begin{macrocode} +\int_new:N \l_@@_loop_int +% \end{macrocode} +% \end{variable} +% % \begin{variable}{\c_@@_sp_dim} % Used to convert integers to dimensions fast. % \begin{macrocode} @@ -147,7 +172,12 @@ % \end{macrocode} % \end{variable} % -% \begin{macro}{\intarray_new:Nn} +% \begin{macrocode} +\__kernel_msg_new:nnn { kernel } { negative-array-size } + { Size~of~array~may~not~be~negative:~#1 } +% \end{macrocode} +% +% \begin{macro}{\intarray_new:Nn, \@@_new:N} % Declare |#1| to be a font (arbitrarily |cmr10| at a never-used % size). Store the array's size as the \tn{hyphenchar} of that font % and make sure enough \tn{fontdimen} are allocated, by setting the @@ -158,17 +188,27 @@ % Every \texttt{intarray} must be global; it's enough to run this % check in \cs{intarray_new:Nn}. % \begin{macrocode} -\__kernel_patch:nnNNpn { \__kernel_chk_var_scope:NN g #1 } { } -\cs_new_protected:Npn \intarray_new:Nn #1#2 +\cs_new_protected:Npn \@@_new:N #1 { \__kernel_chk_if_free_cs:N #1 \int_gincr:N \g_@@_font_int \tex_global:D \tex_font:D #1 = cmr10~at~ \g_@@_font_int \c_@@_sp_dim \scan_stop: - \tex_hyphenchar:D #1 = \int_eval:n {#2} \scan_stop: - \int_compare:nNnT { \tex_hyphenchar:D #1 } > 0 - { \tex_fontdimen:D \tex_hyphenchar:D #1 #1 = \c_zero_dim } - \int_step_inline:nn { 8 } { \tex_fontdimen:D ##1 #1 = \c_zero_dim } + \int_step_inline:nn { 8 } + { \__kernel_intarray_gset:Nnn #1 {##1} \c_zero_int } + } +\__kernel_patch:nnNNpn { \__kernel_chk_var_scope:NN g #1 } { } +\cs_new_protected:Npn \intarray_new:Nn #1#2 + { + \@@_new:N #1 + \@@_count:w #1 = \int_eval:n {#2} \scan_stop: + \int_compare:nNnT { \intarray_count:N #1 } < 0 + { + \__kernel_msg_error:nnx { kernel } { negative-array-size } + { \intarray_count:N #1 } + } + \int_compare:nNnT { \intarray_count:N #1 } > 0 + { \__kernel_intarray_gset:Nnn #1 { \intarray_count:N #1 } { 0 } } } % \end{macrocode} % \end{macro} @@ -176,12 +216,21 @@ % \begin{macro}[EXP]{\intarray_count:N} % Size of an array. % \begin{macrocode} -\cs_new:Npn \intarray_count:N #1 { \tex_the:D \tex_hyphenchar:D #1 } +\cs_new:Npn \intarray_count:N #1 { \int_value:w \@@_count:w #1 } % \end{macrocode} % \end{macro} % % \subsection{Array items} % +% \begin{macro}[EXP]{\@@_signed_max_dim:n} +% Used when an item to be stored is larger than \cs{c_max_dim} in +% absolute value; it is replaced by $\pm\cs{c_max_dim}$. +% \begin{macrocode} +\cs_new:Npn \@@_signed_max_dim:n #1 + { \int_value:w \int_compare:nNnT {#1} < 0 { - } \c_max_dim } +% \end{macrocode} +% \end{macro} +% % \begin{macro}[EXP]{\@@_bounds:NNnTF, \@@_bounds_error:NNn} % The functions \cs{intarray_gset:Nnn} and \cs{intarray_item:Nn} share % bounds checking. The |T| branch is used if |#3| is within bounds of @@ -218,7 +267,7 @@ % are within bounds. % \begin{macrocode} \cs_new_protected:Npn \__kernel_intarray_gset:Nnn #1#2#3 - { \tex_fontdimen:D #2 #1 #3 \c_@@_sp_dim } + { \@@_entry:w #2 #1 #3 \c_@@_sp_dim } \cs_new_protected:Npn \intarray_gset:Nnn #1#2#3 { \exp_after:wN \@@_gset:Nww @@ -230,25 +279,56 @@ { \@@_bounds:NNnTF \__kernel_msg_error:nnxxx #1 {#2} { - \if_int_compare:w \int_abs:n {#3} > \c_max_dim - \exp_after:wN \@@_gset_overflow:NNnn - \fi: + \@@_gset_overflow_test:nw {#3} \__kernel_intarray_gset:Nnn #1 {#2} {#3} } { } } +\cs_if_exist:NTF \tex_ifabsnum:D + { + \cs_new_protected:Npn \@@_gset_overflow_test:nw #1 + { + \tex_ifabsnum:D #1 > \c_max_dim + \exp_after:wN \@@_gset_overflow:NNnn + \fi: + } + } + { + \cs_new_protected:Npn \@@_gset_overflow_test:nw #1 + { + \if_int_compare:w \int_abs:n {#1} > \c_max_dim + \exp_after:wN \@@_gset_overflow:NNnn + \fi: + } + } \cs_new_protected:Npn \@@_gset_overflow:NNnn #1#2#3#4 { \__kernel_msg_error:nnxxxx { kernel } { overflow } - { \token_to_str:N #2 } {#3} {#4} - { \int_value:w \int_compare:nNnT {#4} < 0 { - } \c_max_dim } - \__kernel_intarray_gset:Nnn #2 {#3} - { \int_value:w \int_compare:nNnT {#4} < 0 { - } \c_max_dim } + { \token_to_str:N #2 } {#3} {#4} { \@@_signed_max_dim:n {#4} } + #1 #2 {#3} { \@@_signed_max_dim:n {#4} } } % \end{macrocode} % \end{macro} % \end{macro} % +% \begin{macro}{\intarray_gzero:N} +% Set the appropriate \tn{fontdimen} to zero. No bound checking +% needed. The \cs{prg_replicate:nn} possibly uses quite a lot of +% memory, but this is somewhat comparable to the size of the array, +% and it is much faster than an \cs{int_step_inline:nn} loop. +% \begin{macrocode} +\cs_new_protected:Npn \intarray_gzero:N #1 + { + \int_zero:N \l_@@_loop_int + \prg_replicate:nn { \intarray_count:N #1 } + { + \int_incr:N \l_@@_loop_int + \@@_entry:w \l_@@_loop_int #1 \c_zero_dim + } + } +% \end{macrocode} +% \end{macro} +% % \begin{macro}[EXP]{\intarray_item:Nn, \__kernel_intarray_item:Nn} % \begin{macro}{\@@_item:Nn} % Get the appropriate \tn{fontdimen} and perform bound checks. The @@ -257,7 +337,7 @@ % suitable for \cs{int_value:w}. % \begin{macrocode} \cs_new:Npn \__kernel_intarray_item:Nn #1#2 - { \int_value:w \tex_fontdimen:D #2 #1 } + { \int_value:w \@@_entry:w #2 #1 } \cs_new:Npn \intarray_item:Nn #1#2 { \exp_after:wN \@@_item:Nw @@ -274,6 +354,187 @@ % \end{macro} % \end{macro} % +% \begin{macro}{\intarray_rand_item:N} +% Importantly, \cs{intarray_item:Nn} only evaluates its argument once. +% \begin{macrocode} +\cs_new:Npn \intarray_rand_item:N #1 + { \intarray_item:Nn #1 { \int_rand:n { \intarray_count:N #1 } } } +% \end{macrocode} +% \end{macro} +% +% \subsection{Working with contents of integer arrays} +% +% At the time of writing these are candidates, but we need at least +% \cs{intarray_const_from_clist:Nn} in \pkg{l3fp} so before +% \pkg{l3candidates}. +% +% \begin{macro}{\intarray_const_from_clist:Nn, \@@_const_from_clist:nN} +% Similar to \cs{intarray_new:Nn} (which we don't use because when +% debugging is enabled that function checks the variable name starts +% with |g_|). We make use of the fact that \TeX{} allows allocation +% of successive \tn{fontdimen} as long as no other font has been +% declared: no need to count the comma list items first. We need the +% code in \cs{intarray_gset:Nnn} that checks the item value is not too +% big, namely \cs{@@_gset_overflow_test:nw}, but not the code that +% checks bounds. At the end, set the size of the intarray. +% \begin{macrocode} +\__kernel_patch:nnNNpn { \__kernel_chk_var_scope:NN c #1 } { } +\cs_new_protected:Npn \intarray_const_from_clist:Nn #1#2 + { + \@@_new:N #1 + \int_zero:N \l_@@_loop_int + \clist_map_inline:nn {#2} + { \exp_args:Nf \@@_const_from_clist:nN { \int_eval:n {##1} } #1 } + \@@_count:w #1 \l_@@_loop_int + } +\cs_new_protected:Npn \@@_const_from_clist:nN #1#2 + { + \int_incr:N \l_@@_loop_int + \@@_gset_overflow_test:nw {#1} + \__kernel_intarray_gset:Nnn #2 \l_@@_loop_int {#1} + } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}[rEXP]{\intarray_to_clist:N, \@@_to_clist:Nn, \@@_to_clist:w} +% Loop through the array, putting a comma before each item. Remove +% the leading comma with |f|-expansion. We also use the auxiliary in +% \cs{intarray_show:N} with argument comma, space. +% \begin{macrocode} +\cs_new:Npn \intarray_to_clist:N #1 { \@@_to_clist:Nn #1 { , } } +\cs_new:Npn \@@_to_clist:Nn #1#2 + { + \int_compare:nNnF { \intarray_count:N #1 } = \c_zero_int + { + \exp_last_unbraced:Nf \use_none:n + { \@@_to_clist:w 1 ; #1 {#2} \prg_break_point: } + } + } +\cs_new:Npn \@@_to_clist:w #1 ; #2#3 + { + \if_int_compare:w #1 > \@@_count:w #2 + \prg_break:n + \fi: + #3 \__kernel_intarray_item:Nn #2 {#1} + \exp_after:wN \@@_to_clist:w + \int_value:w \int_eval:w #1 + \c_one_int ; #2 {#3} + } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\intarray_show:N, \intarray_log:N} +% Convert the list to a comma list (with spaces after each comma) +% \begin{macrocode} +\cs_new_protected:Npn \intarray_show:N { \@@_show:NN \msg_show:nnxxxx } +\cs_generate_variant:Nn \intarray_show:N { c } +\cs_new_protected:Npn \intarray_log:N { \@@_show:NN \msg_log:nnxxxx } +\cs_generate_variant:Nn \intarray_log:N { c } +\cs_new_protected:Npn \@@_show:NN #1#2 + { + \__kernel_chk_defined:NT #2 + { + #1 { LaTeX/kernel } { show-intarray } + { \token_to_str:N #2 } + { \intarray_count:N #2 } + { >~ \@@_to_clist:Nn #2 { , ~ } } + { } + } + } +% \end{macrocode} +% \end{macro} +% +% \subsection{Random arrays} +% +% \begin{macro} +% { +% \intarray_gset_rand:Nn, +% \intarray_gset_rand:Nnn, +% \@@_gset_rand:Nnn, +% \@@_gset_rand:Nff, +% \@@_gset_rand_auxi:Nnnn, +% \@@_gset_rand_auxii:Nnnn, +% \@@_gset_rand_auxiii:Nnnn, +% \@@_gset_all_same:Nn, +% } +% We only perform the bounds checks once. This is done by two +% \cs{@@_gset_overflow_test:nw}, with an appropriate empty argument to +% avoid a spurious \enquote{at position \texttt{\#1}} part in the +% error message. Then calculate the number of choices: this is at +% most $(2^{30}-1)-(-(2^{30}-1))+1=2^{31}-1$, which just barely does +% not overflow. For small ranges use \cs{__kernel_randint:n} (making +% sure to subtract~$1$ \emph{before} adding the random number to the +% \meta{min}, to avoid overflow when \meta{min} or \meta{max} are +% $\pm\cs{c_max_int}$), otherwise \cs{__kernel_randint:nn}. Finally, +% if there are no random numbers do not define any of the auxiliaries. +% \begin{macrocode} +\cs_new_protected:Npn \intarray_gset_rand:Nn #1 + { \intarray_gset_rand:Nnn #1 { 1 } } +\sys_if_rand_exist:TF + { + \cs_new_protected:Npn \intarray_gset_rand:Nnn #1#2#3 + { + \@@_gset_rand:Nff #1 + { \int_eval:n {#2} } { \int_eval:n {#3} } + } + \cs_new_protected:Npn \@@_gset_rand:Nnn #1#2#3 + { + \int_compare:nNnTF {#2} > {#3} + { + \__kernel_msg_expandable_error:nnnn + { kernel } { randint-backward-range } {#2} {#3} + \@@_gset_rand:Nnn #1 {#3} {#2} + } + { + \@@_gset_overflow_test:nw {#2} + \@@_gset_rand_auxi:Nnnn #1 { } {#2} {#3} + } + } + \cs_generate_variant:Nn \@@_gset_rand:Nnn { Nff } + \cs_new_protected:Npn \@@_gset_rand_auxi:Nnnn #1#2#3#4 + { + \@@_gset_overflow_test:nw {#4} + \@@_gset_rand_auxii:Nnnn #1 { } {#4} {#3} + } + \cs_new_protected:Npn \@@_gset_rand_auxii:Nnnn #1#2#3#4 + { + \exp_args:NNf \@@_gset_rand_auxiii:Nnnn #1 + { \int_eval:n { #3 - #4 + 1 } } {#4} {#3} + } + \cs_new_protected:Npn \@@_gset_rand_auxiii:Nnnn #1#2#3#4 + { + \exp_args:NNf \@@_gset_all_same:Nn #1 + { + \int_compare:nNnTF {#2} > \c__kernel_randint_max_int + { + \exp_stop_f: + \int_eval:n { \__kernel_randint:nn {#3} {#4} } + } + { + \exp_stop_f: + \int_eval:n { \__kernel_randint:n {#2} - 1 + #3 } + } + } + } + \cs_new_protected:Npn \@@_gset_all_same:Nn #1#2 + { + \int_zero:N \l_@@_loop_int + \prg_replicate:nn { \intarray_count:N #1 } + { + \int_incr:N \l_@@_loop_int + \__kernel_intarray_gset:Nnn #1 \l_@@_loop_int {#2} + } + } + } + { + \cs_new_protected:Npn \intarray_gset_rand:Nnn #1#2#3 + { + \__kernel_msg_error:nnn { kernel } { fp-no-random } + { \intarray_gset_rand:Nnn #1 {#2} {#3} } + } + } +% \end{macrocode} +% \end{macro} +% % \begin{macrocode} %</initex|package> % \end{macrocode} diff --git a/Master/texmf-dist/source/latex/l3kernel/l3kernel-functions.dtx b/Master/texmf-dist/source/latex/l3kernel/l3kernel-functions.dtx index aa4e288b59d..17182172a5c 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3kernel-functions.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3kernel-functions.dtx @@ -41,7 +41,7 @@ % }^^A % } % -% \date{Released 2018-04-30} +% \date{Released 2018-05-12} % % \maketitle % @@ -84,7 +84,7 @@ % evaluation as well as the \meta{caller}. For instance \meta{eval} % can be \cs{__int_eval:w} and \meta{caller} can be \cs{int_eval:n} or % \cs{int_set:Nn}. The argument \meta{convert} is empty except for mu -% expressions where it is \cs{etex_mutoglue:D}, used for internal +% expressions where it is \cs{tex_mutoglue:D}, used for internal % purposes. % \end{function} % @@ -199,6 +199,18 @@ % in package mode, where interfacing with the \LaTeXe{} kernel is necessary. % \end{function} % +% \begin{function}[EXP]{\__kernel_int_add:nnn} +% \begin{syntax} +% \cs{__kernel_int_add:nnn} \Arg{integer_1} \Arg{integer_2} \Arg{integer_3} +% \end{syntax} +% Expands to the result of adding the three \meta{integers} (which +% must be suitable input for \cs{int_eval:w}), avoiding intermediate +% overflow. Overflow occurs only if the overall result is outside +% $[-2^{31}+1,2^{31}-1]$. The \meta{integers} may be of the form +% \cs{int_eval:w} \dots{} \cs{scan_stop:} but may be evaluated more +% than once. +% \end{function} +% % \begin{function}{\__kernel_ior_open:Nn, \__kernel_ior_open:No} % \begin{syntax} % \cs{__kernel_ior_open:Nn} \meta{stream} \Arg{file name} @@ -429,6 +441,35 @@ % and variable mappings. % \end{variable} % +% \begin{variable}{\c__kernel_randint_max_int} +% Maximal allowed argument to \cs{__kernel_randint:n}. Equal to +% $2^{17}-1$. +% \end{variable} +% +% \begin{function}{\__kernel_randint:n} +% \begin{syntax} +% \cs{__kernel_randint:n} \Arg{max} +% \end{syntax} +% Used in an integer expression this gives a pseudo-random number +% between $1$ and $\meta{max}$ included. One must have +% $\meta{max}\leq 2^{17}-1$. The \meta{max} must be suitable for +% \cs{int_value:w} (and any \cs{int_eval:w} must be terminated by +% \cs{scan_stop:} or equivalent). +% \end{function} +% +% \begin{function}{\__kernel_randint:nn} +% \begin{syntax} +% \cs{__kernel_randint:nn} \Arg{min} \Arg{max} +% \end{syntax} +% Used in an integer expression this gives a pseudo-random number +% between $\meta{min}$ and $\meta{max}$ included. The \meta{min} and +% \meta{max} must be suitable for \cs{int_value:w} (and any +% \cs{int_eval:w} must be terminated by \cs{scan_stop:} or +% equivalent). For small ranges +% $R=\meta{max}-\meta{min}+1\leq 2^{17}-1$, +% $\meta{min} - 1 + \cs{__kernel_randint:n} |{|R|}|$ is faster. +% \end{function} +% % \begin{function}{\__kernel_register_show:N, \__kernel_register_show:c} % \begin{syntax} % \cs{__kernel_register_show:N} \meta{register} diff --git a/Master/texmf-dist/source/latex/l3kernel/l3keys.dtx b/Master/texmf-dist/source/latex/l3kernel/l3keys.dtx index 7b8c19097ba..16e295be511 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3keys.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3keys.dtx @@ -41,7 +41,7 @@ % }^^A % } % -% \date{Released 2018-04-30} +% \date{Released 2018-05-12} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3luatex.dtx b/Master/texmf-dist/source/latex/l3kernel/l3luatex.dtx index 77431db7558..65419364c8b 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3luatex.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3luatex.dtx @@ -41,7 +41,7 @@ % }^^A % } % -% \date{Released 2018-04-30} +% \date{Released 2018-05-12} % % \maketitle % @@ -203,9 +203,9 @@ % \begin{macro}[EXP]{\@@_escape_x:n, \@@_now_x:n, \@@_shipout_x:n} % Copies of primitives. % \begin{macrocode} -\cs_new_eq:NN \@@_escape_x:n \luatex_luaescapestring:D -\cs_new_eq:NN \@@_now_x:n \luatex_directlua:D -\cs_new_eq:NN \@@_shipout_x:n \luatex_latelua:D +\cs_new_eq:NN \@@_escape_x:n \tex_luaescapestring:D +\cs_new_eq:NN \@@_now_x:n \tex_directlua:D +\cs_new_eq:NN \@@_shipout_x:n \tex_latelua:D % \end{macrocode} % \end{macro} % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3msg.dtx b/Master/texmf-dist/source/latex/l3kernel/l3msg.dtx index c73c38da8ab..9db8122bd5a 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3msg.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3msg.dtx @@ -41,7 +41,7 @@ % }^^A % } % -% \date{Released 2018-04-30} +% \date{Released 2018-05-12} % % \maketitle % @@ -1192,7 +1192,7 @@ { \__kernel_iow_with:Nnn \tex_errorcontextlines:D { -1 } { - \etex_showtokens:D \exp_after:wN \exp_after:wN \exp_after:wN + \tex_showtokens:D \exp_after:wN \exp_after:wN \exp_after:wN { \exp_after:wN \l_@@_internal_tl } } } @@ -1711,7 +1711,8 @@ \__kernel_msg_new:nnnn { kernel } { overflow } { Integers~larger~than~2^{30}-1~cannot~be~stored~in~arrays. } { - An~attempt~was~made~to~store~#3~at~position~#2~in~the~array~'#1'.~ + An~attempt~was~made~to~store~#3~ + \tl_if_empty:nF {#2} { at~position~#2~ } in~the~array~'#1'.~ The~largest~allowed~value~#4~will~be~used~instead. } \__kernel_msg_new:nnnn { kernel } { out-of-bounds } @@ -1912,6 +1913,8 @@ { is~empty \\>~ . } { contains~the~items~(without~outer~braces): #2 . } } +\__kernel_msg_new:nnn { kernel } { show-intarray } + { The~integer~array~#1~contains~#2~items: \\ #3 . } \__kernel_msg_new:nnn { kernel } { show-prop } { The~property~list~#1~ diff --git a/Master/texmf-dist/source/latex/l3kernel/l3names.dtx b/Master/texmf-dist/source/latex/l3kernel/l3names.dtx index 576ba968f6d..52cb56d61b6 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3names.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3names.dtx @@ -41,7 +41,7 @@ % }^^A % } % -% \date{Released 2018-04-30} +% \date{Released 2018-05-12} % % \maketitle % @@ -65,12 +65,8 @@ % the primitives. These are named based on the engine which first introduced % them: % \begin{itemize} -% \item[{\cs[no-index]{tex_\ldots}}] Introduced by \TeX{} itself; -% \item[{\cs[no-index]{etex_\ldots}}] Introduced by the \eTeX{} extensions; -% \item[{\cs[no-index]{pdftex_\ldots}}] Introduced by \pdfTeX{}; -% \item[{\cs[no-index]{xetex_\ldots}}] Introduced by \XeTeX{}; -% \item[{\cs[no-index]{luatex_\ldots}}] Introduced by \LuaTeX{}; -% \item[{\cs[no-index]{utex_\ldots}}] Introduced by \XeTeX{} and \LuaTeX{}; +% \item[{\cs[no-index]{tex_\ldots}}] Introduced by \TeX{}, \eTeX{}, +% \pdfTeX{}, \XeTeX{} and \LuaTeX{}; % \item[{\cs[no-index]{ptex_\ldots}}] Introduced by \pTeX{}; % \item[{\cs[no-index]{uptex_\ldots}}] Introduced by \upTeX{}. % \end{itemize} @@ -465,10 +461,922 @@ \@@_primitive:NN \xspaceskip \tex_xspaceskip:D \@@_primitive:NN \year \tex_year:D % \end{macrocode} -% Since \LaTeX3 requires at least the \eTeX{} extensions, -% we also rename the additional primitives. These are all -% given the prefix | \etex_|. +% Primitives introduced by \eTeX{}. % \begin{macrocode} + \@@_primitive:NN \beginL \tex_beginL:D + \@@_primitive:NN \beginR \tex_beginR:D + \@@_primitive:NN \botmarks \tex_botmarks:D + \@@_primitive:NN \clubpenalties \tex_clubpenalties:D + \@@_primitive:NN \currentgrouplevel \tex_currentgrouplevel:D + \@@_primitive:NN \currentgrouptype \tex_currentgrouptype:D + \@@_primitive:NN \currentifbranch \tex_currentifbranch:D + \@@_primitive:NN \currentiflevel \tex_currentiflevel:D + \@@_primitive:NN \currentiftype \tex_currentiftype:D + \@@_primitive:NN \detokenize \tex_detokenize:D + \@@_primitive:NN \dimexpr \tex_dimexpr:D + \@@_primitive:NN \displaywidowpenalties \tex_displaywidowpenalties:D + \@@_primitive:NN \endL \tex_endL:D + \@@_primitive:NN \endR \tex_endR:D + \@@_primitive:NN \eTeXrevision \tex_eTeXrevision:D + \@@_primitive:NN \eTeXversion \tex_eTeXversion:D + \@@_primitive:NN \everyeof \tex_everyeof:D + \@@_primitive:NN \firstmarks \tex_firstmarks:D + \@@_primitive:NN \fontchardp \tex_fontchardp:D + \@@_primitive:NN \fontcharht \tex_fontcharht:D + \@@_primitive:NN \fontcharic \tex_fontcharic:D + \@@_primitive:NN \fontcharwd \tex_fontcharwd:D + \@@_primitive:NN \glueexpr \tex_glueexpr:D + \@@_primitive:NN \glueshrink \tex_glueshrink:D + \@@_primitive:NN \glueshrinkorder \tex_glueshrinkorder:D + \@@_primitive:NN \gluestretch \tex_gluestretch:D + \@@_primitive:NN \gluestretchorder \tex_gluestretchorder:D + \@@_primitive:NN \gluetomu \tex_gluetomu:D + \@@_primitive:NN \ifcsname \tex_ifcsname:D + \@@_primitive:NN \ifdefined \tex_ifdefined:D + \@@_primitive:NN \iffontchar \tex_iffontchar:D + \@@_primitive:NN \interactionmode \tex_interactionmode:D + \@@_primitive:NN \interlinepenalties \tex_interlinepenalties:D + \@@_primitive:NN \lastlinefit \tex_lastlinefit:D + \@@_primitive:NN \lastnodetype \tex_lastnodetype:D + \@@_primitive:NN \marks \tex_marks:D + \@@_primitive:NN \middle \tex_middle:D + \@@_primitive:NN \muexpr \tex_muexpr:D + \@@_primitive:NN \mutoglue \tex_mutoglue:D + \@@_primitive:NN \numexpr \tex_numexpr:D + \@@_primitive:NN \pagediscards \tex_pagediscards:D + \@@_primitive:NN \parshapedimen \tex_parshapedimen:D + \@@_primitive:NN \parshapeindent \tex_parshapeindent:D + \@@_primitive:NN \parshapelength \tex_parshapelength:D + \@@_primitive:NN \predisplaydirection \tex_predisplaydirection:D + \@@_primitive:NN \protected \tex_protected:D + \@@_primitive:NN \readline \tex_readline:D + \@@_primitive:NN \savinghyphcodes \tex_savinghyphcodes:D + \@@_primitive:NN \savingvdiscards \tex_savingvdiscards:D + \@@_primitive:NN \scantokens \tex_scantokens:D + \@@_primitive:NN \showgroups \tex_showgroups:D + \@@_primitive:NN \showifs \tex_showifs:D + \@@_primitive:NN \showtokens \tex_showtokens:D + \@@_primitive:NN \splitbotmarks \tex_splitbotmarks:D + \@@_primitive:NN \splitdiscards \tex_splitdiscards:D + \@@_primitive:NN \splitfirstmarks \tex_splitfirstmarks:D + \@@_primitive:NN \TeXXeTstate \tex_TeXXeTstate:D + \@@_primitive:NN \topmarks \tex_topmarks:D + \@@_primitive:NN \tracingassigns \tex_tracingassigns:D + \@@_primitive:NN \tracinggroups \tex_tracinggroups:D + \@@_primitive:NN \tracingifs \tex_tracingifs:D + \@@_primitive:NN \tracingnesting \tex_tracingnesting:D + \@@_primitive:NN \tracingscantokens \tex_tracingscantokens:D + \@@_primitive:NN \unexpanded \tex_unexpanded:D + \@@_primitive:NN \unless \tex_unless:D + \@@_primitive:NN \widowpenalties \tex_widowpenalties:D +% \end{macrocode} +% Post-\eTeX{} primitives do not always end up with the same name in all +% engines, if indeed they are available cross-engine anyway. We therefore +% take the approach of preferring the shortest name that makes sense. First, +% we deal with the primitives introduced by \pdfTeX{} which directly +% relate to PDF output: these are copied with the names unchanged. +% \begin{macrocode} + \@@_primitive:NN \pdfannot \tex_pdfannot:D + \@@_primitive:NN \pdfcatalog \tex_pdfcatalog:D + \@@_primitive:NN \pdfcompresslevel \tex_pdfcompresslevel:D + \@@_primitive:NN \pdfcolorstack \tex_pdfcolorstack:D + \@@_primitive:NN \pdfcolorstackinit \tex_pdfcolorstackinit:D + \@@_primitive:NN \pdfcreationdate \tex_pdfcreationdate:D + \@@_primitive:NN \pdfdecimaldigits \tex_pdfdecimaldigits:D + \@@_primitive:NN \pdfdest \tex_pdfdest:D + \@@_primitive:NN \pdfdestmargin \tex_pdfdestmargin:D + \@@_primitive:NN \pdfendlink \tex_pdfendlink:D + \@@_primitive:NN \pdfendthread \tex_pdfendthread:D + \@@_primitive:NN \pdffontattr \tex_pdffontattr:D + \@@_primitive:NN \pdffontname \tex_pdffontname:D + \@@_primitive:NN \pdffontobjnum \tex_pdffontobjnum:D + \@@_primitive:NN \pdfgamma \tex_pdfgamma:D + \@@_primitive:NN \pdfimageapplygamma \tex_pdfimageapplygamma:D + \@@_primitive:NN \pdfimagegamma \tex_pdfimagegamma:D + \@@_primitive:NN \pdfgentounicode \tex_pdfgentounicode:D + \@@_primitive:NN \pdfglyphtounicode \tex_pdfglyphtounicode:D + \@@_primitive:NN \pdfhorigin \tex_pdfhorigin:D + \@@_primitive:NN \pdfimagehicolor \tex_pdfimagehicolor:D + \@@_primitive:NN \pdfimageresolution \tex_pdfimageresolution:D + \@@_primitive:NN \pdfincludechars \tex_pdfincludechars:D + \@@_primitive:NN \pdfinclusioncopyfonts \tex_pdfinclusioncopyfonts:D + \@@_primitive:NN \pdfinclusionerrorlevel + \tex_pdfinclusionerrorlevel:D + \@@_primitive:NN \pdfinfo \tex_pdfinfo:D + \@@_primitive:NN \pdflastannot \tex_pdflastannot:D + \@@_primitive:NN \pdflastlink \tex_pdflastlink:D + \@@_primitive:NN \pdflastobj \tex_pdflastobj:D + \@@_primitive:NN \pdflastxform \tex_pdflastxform:D + \@@_primitive:NN \pdflastximage \tex_pdflastximage:D + \@@_primitive:NN \pdflastximagecolordepth + \tex_pdflastximagecolordepth:D + \@@_primitive:NN \pdflastximagepages \tex_pdflastximagepages:D + \@@_primitive:NN \pdflinkmargin \tex_pdflinkmargin:D + \@@_primitive:NN \pdfliteral \tex_pdfliteral:D + \@@_primitive:NN \pdfminorversion \tex_pdfminorversion:D + \@@_primitive:NN \pdfnames \tex_pdfnames:D + \@@_primitive:NN \pdfobj \tex_pdfobj:D + \@@_primitive:NN \pdfobjcompresslevel \tex_pdfobjcompresslevel:D + \@@_primitive:NN \pdfoutline \tex_pdfoutline:D + \@@_primitive:NN \pdfoutput \tex_pdfoutput:D + \@@_primitive:NN \pdfpageattr \tex_pdfpageattr:D + \@@_primitive:NN \pdfpagebox \tex_pdfpagebox:D + \@@_primitive:NN \pdfpageref \tex_pdfpageref:D + \@@_primitive:NN \pdfpageresources \tex_pdfpageresources:D + \@@_primitive:NN \pdfpagesattr \tex_pdfpagesattr:D + \@@_primitive:NN \pdfrefobj \tex_pdfrefobj:D + \@@_primitive:NN \pdfrefxform \tex_pdfrefxform:D + \@@_primitive:NN \pdfrefximage \tex_pdfrefximage:D + \@@_primitive:NN \pdfrestore \tex_pdfrestore:D + \@@_primitive:NN \pdfretval \tex_pdfretval:D + \@@_primitive:NN \pdfsave \tex_pdfsave:D + \@@_primitive:NN \pdfsetmatrix \tex_pdfsetmatrix:D + \@@_primitive:NN \pdfstartlink \tex_pdfstartlink:D + \@@_primitive:NN \pdfstartthread \tex_pdfstartthread:D + \@@_primitive:NN \pdfsuppressptexinfo \tex_pdfsuppressptexinfo:D + \@@_primitive:NN \pdfthread \tex_pdfthread:D + \@@_primitive:NN \pdfthreadmargin \tex_pdfthreadmargin:D + \@@_primitive:NN \pdftrailer \tex_pdftrailer:D + \@@_primitive:NN \pdfuniqueresname \tex_pdfuniqueresname:D + \@@_primitive:NN \pdfvorigin \tex_pdfvorigin:D + \@@_primitive:NN \pdfxform \tex_pdfxform:D + \@@_primitive:NN \pdfxformattr \tex_pdfxformattr:D + \@@_primitive:NN \pdfxformname \tex_pdfxformname:D + \@@_primitive:NN \pdfxformresources \tex_pdfxformresources:D + \@@_primitive:NN \pdfximage \tex_pdfximage:D + \@@_primitive:NN \pdfximagebbox \tex_pdfximagebbox:D +% \end{macrocode} +% These are not related to PDF output and either already appear in other +% engines without the |\pdf| prefix, or might reasonably do so at some +% future stage. We therefore drop the leading |pdf| here. +% \begin{macrocode} + \@@_primitive:NN \ifpdfabsdim \tex_ifabsdim:D + \@@_primitive:NN \ifpdfabsnum \tex_ifabsnum:D + \@@_primitive:NN \ifpdfprimitive \tex_ifprimitive:D + \@@_primitive:NN \pdfadjustspacing \tex_adjustspacing:D + \@@_primitive:NN \pdfcopyfont \tex_copyfont:D + \@@_primitive:NN \pdfdraftmode \tex_draftmode:D + \@@_primitive:NN \pdfeachlinedepth \tex_eachlinedepth:D + \@@_primitive:NN \pdfeachlineheight \tex_eachlineheight:D + \@@_primitive:NN \pdffilemoddate \tex_filemoddate:D + \@@_primitive:NN \pdffilesize \tex_filesize:D + \@@_primitive:NN \pdffirstlineheight \tex_firstlineheight:D + \@@_primitive:NN \pdffontexpand \tex_fontexpand:D + \@@_primitive:NN \pdffontsize \tex_fontsize:D + \@@_primitive:NN \pdfignoreddimen \tex_ignoreddimen:D + \@@_primitive:NN \pdfinsertht \tex_insertht:D + \@@_primitive:NN \pdflastlinedepth \tex_lastlinedepth:D + \@@_primitive:NN \pdflastxpos \tex_lastxpos:D + \@@_primitive:NN \pdflastypos \tex_lastypos:D + \@@_primitive:NN \pdfmapfile \tex_mapfile:D + \@@_primitive:NN \pdfmapline \tex_mapline:D + \@@_primitive:NN \pdfmdfivesum \tex_mdfivesum:D + \@@_primitive:NN \pdfnoligatures \tex_noligatures:D + \@@_primitive:NN \pdfnormaldeviate \tex_normaldeviate:D + \@@_primitive:NN \pdfpageheight \tex_pageheight:D + \@@_primitive:NN \pdfpagewidth \tex_pagewidth:D + \@@_primitive:NN \pdfpkmode \tex_pkmode:D + \@@_primitive:NN \pdfpkresolution \tex_pkresolution:D + \@@_primitive:NN \pdfprimitive \tex_primitive:D + \@@_primitive:NN \pdfprotrudechars \tex_protrudechars:D + \@@_primitive:NN \pdfpxdimen \tex_pxdimen:D + \@@_primitive:NN \pdfrandomseed \tex_randomseed:D + \@@_primitive:NN \pdfsavepos \tex_savepos:D + \@@_primitive:NN \pdfstrcmp \tex_strcmp:D + \@@_primitive:NN \pdfsetrandomseed \tex_setrandomseed:D + \@@_primitive:NN \pdfshellescape \tex_shellescape:D + \@@_primitive:NN \pdftracingfonts \tex_tracingfonts:D + \@@_primitive:NN \pdfuniformdeviate \tex_uniformdeviate:D +% \end{macrocode} +% The version primitives are not related to PDF mode but are +% \pdfTeX{}-specific, so again are carried forward unchanged. +% \begin{macrocode} + \@@_primitive:NN \pdftexbanner \tex_pdftexbanner:D + \@@_primitive:NN \pdftexrevision \tex_pdftexrevision:D + \@@_primitive:NN \pdftexversion \tex_pdftexversion:D +% \end{macrocode} +% These ones appear in \pdfTeX{} but don't have |pdf| in the name at all: +% no decisions to make. +% \begin{macrocode} + \@@_primitive:NN \efcode \tex_efcode:D + \@@_primitive:NN \ifincsname \tex_ifincsname:D + \@@_primitive:NN \leftmarginkern \tex_leftmarginkern:D + \@@_primitive:NN \letterspacefont \tex_letterspacefont:D + \@@_primitive:NN \lpcode \tex_lpcode:D + \@@_primitive:NN \quitvmode \tex_quitvmode:D + \@@_primitive:NN \rightmarginkern \tex_rightmarginkern:D + \@@_primitive:NN \rpcode \tex_rpcode:D + \@@_primitive:NN \synctex \tex_synctex:D + \@@_primitive:NN \tagcode \tex_tagcode:D +% \end{macrocode} +% Post \pdfTeX{} primitive availability gets more complex. Both \XeTeX{} and +% \LuaTeX{} have varying names for some primitives from \pdfTeX{}. Particularly +% for \LuaTeX{} tracking all of that would be hard. Instead, we now check that +% we only save primitives if they actually exist. +% \begin{macrocode} +%</initex|names|package> +%<*initex|package> + \tex_long:D \tex_def:D \use_ii:nn #1#2 {#2} + \tex_long:D \tex_def:D \use_none:n #1 { } + \tex_long:D \tex_def:D \@@_primitive:NN #1#2 + { + \tex_ifdefined:D #1 + \tex_expandafter:D \use_ii:nn + \tex_fi:D + \use_none:n { \tex_global:D \tex_let:D #2 #1 } +%<*initex> + \tex_global:D \tex_let:D #1 \tex_undefined:D +%</initex> + } +%</initex|package> +%<*initex|names|package> +% \end{macrocode} +% \XeTeX{}-specific primitives. Note that \XeTeX{}'s \tn{strcmp} is +% handled earlier and is \enquote{rolled up} into \tn{pdfstrcmp}. +% A few cross-compatibility names which lack +% the |pdf| of the original are handled later. +% \begin{macrocode} + \@@_primitive:NN \suppressfontnotfounderror + \tex_suppressfontnotfounderror:D + \@@_primitive:NN \XeTeXcharclass \tex_XeTeXcharclass:D + \@@_primitive:NN \XeTeXcharglyph \tex_XeTeXcharglyph:D + \@@_primitive:NN \XeTeXcountfeatures \tex_XeTeXcountfeatures:D + \@@_primitive:NN \XeTeXcountglyphs \tex_XeTeXcountglyphs:D + \@@_primitive:NN \XeTeXcountselectors \tex_XeTeXcountselectors:D + \@@_primitive:NN \XeTeXcountvariations \tex_XeTeXcountvariations:D + \@@_primitive:NN \XeTeXdefaultencoding \tex_XeTeXdefaultencoding:D + \@@_primitive:NN \XeTeXdashbreakstate \tex_XeTeXdashbreakstate:D + \@@_primitive:NN \XeTeXfeaturecode \tex_XeTeXfeaturecode:D + \@@_primitive:NN \XeTeXfeaturename \tex_XeTeXfeaturename:D + \@@_primitive:NN \XeTeXfindfeaturebyname + \tex_XeTeXfindfeaturebyname:D + \@@_primitive:NN \XeTeXfindselectorbyname + \tex_XeTeXfindselectorbyname:D + \@@_primitive:NN \XeTeXfindvariationbyname + \tex_XeTeXfindvariationbyname:D + \@@_primitive:NN \XeTeXfirstfontchar \tex_XeTeXfirstfontchar:D + \@@_primitive:NN \XeTeXfonttype \tex_XeTeXfonttype:D + \@@_primitive:NN \XeTeXgenerateactualtext + \tex_XeTeXgenerateactualtext:D + \@@_primitive:NN \XeTeXglyph \tex_XeTeXglyph:D + \@@_primitive:NN \XeTeXglyphbounds \tex_XeTeXglyphbounds:D + \@@_primitive:NN \XeTeXglyphindex \tex_XeTeXglyphindex:D + \@@_primitive:NN \XeTeXglyphname \tex_XeTeXglyphname:D + \@@_primitive:NN \XeTeXinputencoding \tex_XeTeXinputencoding:D + \@@_primitive:NN \XeTeXinputnormalization + \tex_XeTeXinputnormalization:D + \@@_primitive:NN \XeTeXinterchartokenstate + \tex_XeTeXinterchartokenstate:D + \@@_primitive:NN \XeTeXinterchartoks \tex_XeTeXinterchartoks:D + \@@_primitive:NN \XeTeXisdefaultselector + \tex_XeTeXisdefaultselector:D + \@@_primitive:NN \XeTeXisexclusivefeature + \tex_XeTeXisexclusivefeature:D + \@@_primitive:NN \XeTeXlastfontchar \tex_XeTeXlastfontchar:D + \@@_primitive:NN \XeTeXlinebreakskip \tex_XeTeXlinebreakskip:D + \@@_primitive:NN \XeTeXlinebreaklocale \tex_XeTeXlinebreaklocale:D + \@@_primitive:NN \XeTeXlinebreakpenalty \tex_XeTeXlinebreakpenalty:D + \@@_primitive:NN \XeTeXOTcountfeatures \tex_XeTeXOTcountfeatures:D + \@@_primitive:NN \XeTeXOTcountlanguages \tex_XeTeXOTcountlanguages:D + \@@_primitive:NN \XeTeXOTcountscripts \tex_XeTeXOTcountscripts:D + \@@_primitive:NN \XeTeXOTfeaturetag \tex_XeTeXOTfeaturetag:D + \@@_primitive:NN \XeTeXOTlanguagetag \tex_XeTeXOTlanguagetag:D + \@@_primitive:NN \XeTeXOTscripttag \tex_XeTeXOTscripttag:D + \@@_primitive:NN \XeTeXpdffile \tex_XeTeXpdffile:D + \@@_primitive:NN \XeTeXpdfpagecount \tex_XeTeXpdfpagecount:D + \@@_primitive:NN \XeTeXpicfile \tex_XeTeXpicfile:D + \@@_primitive:NN \XeTeXrevision \tex_XeTeXrevision:D + \@@_primitive:NN \XeTeXselectorname \tex_XeTeXselectorname:D + \@@_primitive:NN \XeTeXtracingfonts \tex_XeTeXtracingfonts:D + \@@_primitive:NN \XeTeXupwardsmode \tex_XeTeXupwardsmode:D + \@@_primitive:NN \XeTeXuseglyphmetrics \tex_XeTeXuseglyphmetrics:D + \@@_primitive:NN \XeTeXvariation \tex_XeTeXvariation:D + \@@_primitive:NN \XeTeXvariationdefault \tex_XeTeXvariationdefault:D + \@@_primitive:NN \XeTeXvariationmax \tex_XeTeXvariationmax:D + \@@_primitive:NN \XeTeXvariationmin \tex_XeTeXvariationmin:D + \@@_primitive:NN \XeTeXvariationname \tex_XeTeXvariationname:D + \@@_primitive:NN \XeTeXversion \tex_XeTeXversion:D +% \end{macrocode} +% Primitives from \pdfTeX{} that \XeTeX{} renames: also helps with +% \LuaTeX{}. +% \begin{macrocode} + \@@_primitive:NN \mdfivesum \tex_mdfivesum:D + \@@_primitive:NN \ifprimitive \tex_ifprimitive:D + \@@_primitive:NN \primitive \tex_primitive:D + \@@_primitive:NN \shellescape \tex_shellescape:D +% \end{macrocode} +% Primitives from \LuaTeX{}, some of which have been ported back to +% \XeTeX{}. +% \begin{macrocode} + \@@_primitive:NN \alignmark \tex_alignmark:D + \@@_primitive:NN \aligntab \tex_aligntab:D + \@@_primitive:NN \attribute \tex_attribute:D + \@@_primitive:NN \attributedef \tex_attributedef:D + \@@_primitive:NN \automaticdiscretionary + \tex_automaticdiscretionary:D + \@@_primitive:NN \automatichyphenmode \tex_automatichyphenmode:D + \@@_primitive:NN \automatichyphenpenalty + \tex_automatichyphenpenalty:D + \@@_primitive:NN \begincsname \tex_begincsname:D + \@@_primitive:NN \breakafterdirmode \tex_breakafterdirmode:D + \@@_primitive:NN \catcodetable \tex_catcodetable:D + \@@_primitive:NN \clearmarks \tex_clearmarks:D + \@@_primitive:NN \crampeddisplaystyle \tex_crampeddisplaystyle:D + \@@_primitive:NN \crampedscriptscriptstyle + \tex_crampedscriptscriptstyle:D + \@@_primitive:NN \crampedscriptstyle \tex_crampedscriptstyle:D + \@@_primitive:NN \crampedtextstyle \tex_crampedtextstyle:D + \@@_primitive:NN \directlua \tex_directlua:D + \@@_primitive:NN \dviextension \tex_dviextension:D + \@@_primitive:NN \dvifeedback \tex_dvifeedback:D + \@@_primitive:NN \dvivariable \tex_dvivariable:D + \@@_primitive:NN \etoksapp \tex_etoksapp:D + \@@_primitive:NN \etokspre \tex_etokspre:D + \@@_primitive:NN \explicithyphenpenalty \tex_explicithyphenpenalty:D + \@@_primitive:NN \expanded \tex_expanded:D + \@@_primitive:NN \explicitdiscretionary \tex_explicitdiscretionary:D + \@@_primitive:NN \firstvalidlanguage \tex_firstvalidlanguage:D + \@@_primitive:NN \fontid \tex_fontid:D + \@@_primitive:NN \formatname \tex_formatname:D + \@@_primitive:NN \hjcode \tex_hjcode:D + \@@_primitive:NN \hpack \tex_hpack:D + \@@_primitive:NN \hyphenationbounds \tex_hyphenationbounds:D + \@@_primitive:NN \hyphenationmin \tex_hyphenationmin:D + \@@_primitive:NN \hyphenpenaltymode \tex_hyphenpenaltymode:D + \@@_primitive:NN \gleaders \tex_gleaders:D + \@@_primitive:NN \initcatcodetable \tex_initcatcodetable:D + \@@_primitive:NN \lastnamedcs \tex_lastnamedcs:D + \@@_primitive:NN \latelua \tex_latelua:D + \@@_primitive:NN \letcharcode \tex_letcharcode:D + \@@_primitive:NN \luaescapestring \tex_luaescapestring:D + \@@_primitive:NN \luafunction \tex_luafunction:D + \@@_primitive:NN \luatexbanner \tex_luatexbanner:D + \@@_primitive:NN \luatexrevision \tex_luatexrevision:D + \@@_primitive:NN \luatexversion \tex_luatexversion:D + \@@_primitive:NN \mathdelimitersmode \tex_mathdelimitersmode:D + \@@_primitive:NN \mathdisplayskipmode \tex_mathdisplayskipmode:D + \@@_primitive:NN \matheqnogapstep \tex_matheqnogapstep:D + \@@_primitive:NN \mathnolimitsmode \tex_mathnolimitsmode:D + \@@_primitive:NN \mathoption \tex_mathoption:D + \@@_primitive:NN \mathpenaltiesmode \tex_mathpenaltiesmode:D + \@@_primitive:NN \mathrulesfam \tex_mathrulesfam:D + \@@_primitive:NN \mathscriptsmode \tex_mathscriptsmode:D + \@@_primitive:NN \mathscriptboxmode \tex_mathscriptboxmode:D + \@@_primitive:NN \mathstyle \tex_mathstyle:D + \@@_primitive:NN \mathsurroundmode \tex_mathsurroundmode:D + \@@_primitive:NN \mathsurroundskip \tex_mathsurroundskip:D + \@@_primitive:NN \nohrule \tex_nohrule:D + \@@_primitive:NN \nokerns \tex_nokerns:D + \@@_primitive:NN \noligs \tex_noligs:D + \@@_primitive:NN \nospaces \tex_nospaces:D + \@@_primitive:NN \novrule \tex_novrule:D + \@@_primitive:NN \outputbox \tex_outputbox:D + \@@_primitive:NN \pagebottomoffset \tex_pagebottomoffset:D + \@@_primitive:NN \pageleftoffset \tex_pageleftoffset:D + \@@_primitive:NN \pagerightoffset \tex_pagerightoffset:D + \@@_primitive:NN \pagetopoffset \tex_pagetopoffset:D + \@@_primitive:NN \pdfextension \tex_pdfextension:D + \@@_primitive:NN \pdffeedback \tex_pdffeedback:D + \@@_primitive:NN \pdfvariable \tex_pdfvariable:D + \@@_primitive:NN \postexhyphenchar \tex_postexhyphenchar:D + \@@_primitive:NN \posthyphenchar \tex_posthyphenchar:D + \@@_primitive:NN \prebinoppenalty \tex_prebinoppenalty:D + \@@_primitive:NN \predisplaygapfactor \tex_predisplaygapfactor:D + \@@_primitive:NN \preexhyphenchar \tex_preexhyphenchar:D + \@@_primitive:NN \prehyphenchar \tex_prehyphenchar:D + \@@_primitive:NN \prerelpenalty \tex_prerelpenalty:D + \@@_primitive:NN \savecatcodetable \tex_savecatcodetable:D + \@@_primitive:NN \scantextokens \tex_scantextokens:D + \@@_primitive:NN \setfontid \tex_setfontid:D + \@@_primitive:NN \shapemode \tex_shapemode:D + \@@_primitive:NN \suppressifcsnameerror \tex_suppressifcsnameerror:D + \@@_primitive:NN \suppresslongerror \tex_suppresslongerror:D + \@@_primitive:NN \suppressmathparerror \tex_suppressmathparerror:D + \@@_primitive:NN \suppressoutererror \tex_suppressoutererror:D + \@@_primitive:NN \suppressprimitiveerror + \tex_suppressprimitiveerror:D + \@@_primitive:NN \toksapp \tex_toksapp:D + \@@_primitive:NN \tokspre \tex_tokspre:D + \@@_primitive:NN \tpack \tex_tpack:D + \@@_primitive:NN \vpack \tex_vpack:D +% \end{macrocode} +% These come from Omega/Aleph, but we do not support those engines and +% so list them here. +% \begin{macrocode} + \@@_primitive:NN \bodydir \tex_bodydir:D + \@@_primitive:NN \boxdir \tex_boxdir:D + \@@_primitive:NN \leftghost \tex_leftghost:D + \@@_primitive:NN \linedir \tex_linedir:D + \@@_primitive:NN \localbrokenpenalty \tex_localbrokenpenalty:D + \@@_primitive:NN \localinterlinepenalty \tex_localinterlinepenalty:D + \@@_primitive:NN \localleftbox \tex_localleftbox:D + \@@_primitive:NN \localrightbox \tex_localrightbox:D + \@@_primitive:NN \mathdir \tex_mathdir:D + \@@_primitive:NN \pagedir \tex_pagedir:D + \@@_primitive:NN \pardir \tex_pardir:D + \@@_primitive:NN \rightghost \tex_rightghost:D + \@@_primitive:NN \textdir \tex_textdir:D +% \end{macrocode} +% Primitives from \pdfTeX{} that \LuaTeX{} renames. +% \begin{macrocode} + \@@_primitive:NN \adjustspacing \tex_adjustspacing:D + \@@_primitive:NN \copyfont \tex_copyfont:D + \@@_primitive:NN \draftmode \tex_draftmode:D + \@@_primitive:NN \expandglyphsinfont \tex_fontexpand:D + \@@_primitive:NN \ifabsdim \tex_ifabsdim:D + \@@_primitive:NN \ifabsnum \tex_ifabsnum:D + \@@_primitive:NN \ignoreligaturesinfont \tex_ignoreligaturesinfont:D + \@@_primitive:NN \insertht \tex_insertht:D + \@@_primitive:NN \lastsavedboxresourceindex + \tex_pdflastxform:D + \@@_primitive:NN \lastsavedimageresourceindex + \tex_pdflastximage:D + \@@_primitive:NN \lastsavedimageresourcepages + \tex_pdflastximagepages:D + \@@_primitive:NN \lastxpos \tex_lastxpos:D + \@@_primitive:NN \lastypos \tex_lastypos:D + \@@_primitive:NN \normaldeviate \tex_normaldeviate:D + \@@_primitive:NN \outputmode \tex_pdfoutput:D + \@@_primitive:NN \pageheight \tex_pageheight:D + \@@_primitive:NN \pagewidth \tex_pagewith:D + \@@_primitive:NN \protrudechars \tex_protrudechars:D + \@@_primitive:NN \pxdimen \tex_pxdimen:D + \@@_primitive:NN \randomseed \tex_randomseed:D + \@@_primitive:NN \useboxresource \tex_pdfrefxform:D + \@@_primitive:NN \useimageresource \tex_pdfrefximage:D + \@@_primitive:NN \savepos \tex_savepos:D + \@@_primitive:NN \saveboxresource \tex_pdfxform:D + \@@_primitive:NN \saveimageresource \tex_pdfximage:D + \@@_primitive:NN \setrandomseed \tex_setrandomseed:D + \@@_primitive:NN \tracingfonts \tex_tracingfonts:D + \@@_primitive:NN \uniformdeviate \tex_uniformdeviate:D +% \end{macrocode} +% The set of Unicode math primitives were introduced by \XeTeX{} and \LuaTeX{} +% in a somewhat complex fashion: a few first as |\XeTeX...| which were then +% renamed with \LuaTeX{} having a lot more. These names now all start +% |\U...| and mainly |\Umath...|. +% \begin{macrocode} + \@@_primitive:NN \Uchar \tex_Uchar:D + \@@_primitive:NN \Ucharcat \tex_Ucharcat:D + \@@_primitive:NN \Udelcode \tex_Udelcode:D + \@@_primitive:NN \Udelcodenum \tex_Udelcodenum:D + \@@_primitive:NN \Udelimiter \tex_Udelimiter:D + \@@_primitive:NN \Udelimiterover \tex_Udelimiterover:D + \@@_primitive:NN \Udelimiterunder \tex_Udelimiterunder:D + \@@_primitive:NN \Uhextensible \tex_Uhextensible:D + \@@_primitive:NN \Umathaccent \tex_Umathaccent:D + \@@_primitive:NN \Umathaxis \tex_Umathaxis:D + \@@_primitive:NN \Umathbinbinspacing \tex_Umathbinbinspacing:D + \@@_primitive:NN \Umathbinclosespacing \tex_Umathbinclosespacing:D + \@@_primitive:NN \Umathbininnerspacing \tex_Umathbininnerspacing:D + \@@_primitive:NN \Umathbinopenspacing \tex_Umathbinopenspacing:D + \@@_primitive:NN \Umathbinopspacing \tex_Umathbinopspacing:D + \@@_primitive:NN \Umathbinordspacing \tex_Umathbinordspacing:D + \@@_primitive:NN \Umathbinpunctspacing \tex_Umathbinpunctspacing:D + \@@_primitive:NN \Umathbinrelspacing \tex_Umathbinrelspacing:D + \@@_primitive:NN \Umathchar \tex_Umathchar:D + \@@_primitive:NN \Umathcharclass \tex_Umathcharclass:D + \@@_primitive:NN \Umathchardef \tex_Umathchardef:D + \@@_primitive:NN \Umathcharfam \tex_Umathcharfam:D + \@@_primitive:NN \Umathcharnum \tex_Umathcharnum:D + \@@_primitive:NN \Umathcharnumdef \tex_Umathcharnumdef:D + \@@_primitive:NN \Umathcharslot \tex_Umathcharslot:D + \@@_primitive:NN \Umathclosebinspacing \tex_Umathclosebinspacing:D + \@@_primitive:NN \Umathcloseclosespacing + \tex_Umathcloseclosespacing:D + \@@_primitive:NN \Umathcloseinnerspacing + \tex_Umathcloseinnerspacing:D + \@@_primitive:NN \Umathcloseopenspacing \tex_Umathcloseopenspacing:D + \@@_primitive:NN \Umathcloseopspacing \tex_Umathcloseopspacing:D + \@@_primitive:NN \Umathcloseordspacing \tex_Umathcloseordspacing:D + \@@_primitive:NN \Umathclosepunctspacing + \tex_Umathclosepunctspacing:D + \@@_primitive:NN \Umathcloserelspacing \tex_Umathcloserelspacing:D + \@@_primitive:NN \Umathcode \tex_Umathcode:D + \@@_primitive:NN \Umathcodenum \tex_Umathcodenum:D + \@@_primitive:NN \Umathconnectoroverlapmin + \tex_Umathconnectoroverlapmin:D + \@@_primitive:NN \Umathfractiondelsize \tex_Umathfractiondelsize:D + \@@_primitive:NN \Umathfractiondenomdown + \tex_Umathfractiondenomdown:D + \@@_primitive:NN \Umathfractiondenomvgap + \tex_Umathfractiondenomvgap:D + \@@_primitive:NN \Umathfractionnumup \tex_Umathfractionnumup:D + \@@_primitive:NN \Umathfractionnumvgap \tex_Umathfractionnumvgap:D + \@@_primitive:NN \Umathfractionrule \tex_Umathfractionrule:D + \@@_primitive:NN \Umathinnerbinspacing \tex_Umathinnerbinspacing:D + \@@_primitive:NN \Umathinnerclosespacing + \tex_Umathinnerclosespacing:D + \@@_primitive:NN \Umathinnerinnerspacing + \tex_Umathinnerinnerspacing:D + \@@_primitive:NN \Umathinneropenspacing \tex_Umathinneropenspacing:D + \@@_primitive:NN \Umathinneropspacing \tex_Umathinneropspacing:D + \@@_primitive:NN \Umathinnerordspacing \tex_Umathinnerordspacing:D + \@@_primitive:NN \Umathinnerpunctspacing + \tex_Umathinnerpunctspacing:D + \@@_primitive:NN \Umathinnerrelspacing \tex_Umathinnerrelspacing:D + \@@_primitive:NN \Umathlimitabovebgap \tex_Umathlimitabovebgap:D + \@@_primitive:NN \Umathlimitabovekern \tex_Umathlimitabovekern:D + \@@_primitive:NN \Umathlimitabovevgap \tex_Umathlimitabovevgap:D + \@@_primitive:NN \Umathlimitbelowbgap \tex_Umathlimitbelowbgap:D + \@@_primitive:NN \Umathlimitbelowkern \tex_Umathlimitbelowkern:D + \@@_primitive:NN \Umathlimitbelowvgap \tex_Umathlimitbelowvgap:D + \@@_primitive:NN \Umathnolimitsubfactor \tex_Umathnolimitsubfactor:D + \@@_primitive:NN \Umathnolimitsupfactor \tex_Umathnolimitsupfactor:D + \@@_primitive:NN \Umathopbinspacing \tex_Umathopbinspacing:D + \@@_primitive:NN \Umathopclosespacing \tex_Umathopclosespacing:D + \@@_primitive:NN \Umathopenbinspacing \tex_Umathopenbinspacing:D + \@@_primitive:NN \Umathopenclosespacing \tex_Umathopenclosespacing:D + \@@_primitive:NN \Umathopeninnerspacing \tex_Umathopeninnerspacing:D + \@@_primitive:NN \Umathopenopenspacing \tex_Umathopenopenspacing:D + \@@_primitive:NN \Umathopenopspacing \tex_Umathopenopspacing:D + \@@_primitive:NN \Umathopenordspacing \tex_Umathopenordspacing:D + \@@_primitive:NN \Umathopenpunctspacing \tex_Umathopenpunctspacing:D + \@@_primitive:NN \Umathopenrelspacing \tex_Umathopenrelspacing:D + \@@_primitive:NN \Umathoperatorsize \tex_Umathoperatorsize:D + \@@_primitive:NN \Umathopinnerspacing \tex_Umathopinnerspacing:D + \@@_primitive:NN \Umathopopenspacing \tex_Umathopopenspacing:D + \@@_primitive:NN \Umathopopspacing \tex_Umathopopspacing:D + \@@_primitive:NN \Umathopordspacing \tex_Umathopordspacing:D + \@@_primitive:NN \Umathoppunctspacing \tex_Umathoppunctspacing:D + \@@_primitive:NN \Umathoprelspacing \tex_Umathoprelspacing:D + \@@_primitive:NN \Umathordbinspacing \tex_Umathordbinspacing:D + \@@_primitive:NN \Umathordclosespacing \tex_Umathordclosespacing:D + \@@_primitive:NN \Umathordinnerspacing \tex_Umathordinnerspacing:D + \@@_primitive:NN \Umathordopenspacing \tex_Umathordopenspacing:D + \@@_primitive:NN \Umathordopspacing \tex_Umathordopspacing:D + \@@_primitive:NN \Umathordordspacing \tex_Umathordordspacing:D + \@@_primitive:NN \Umathordpunctspacing \tex_Umathordpunctspacing:D + \@@_primitive:NN \Umathordrelspacing \tex_Umathordrelspacing:D + \@@_primitive:NN \Umathoverbarkern \tex_Umathoverbarkern:D + \@@_primitive:NN \Umathoverbarrule \tex_Umathoverbarrule:D + \@@_primitive:NN \Umathoverbarvgap \tex_Umathoverbarvgap:D + \@@_primitive:NN \Umathoverdelimiterbgap + \tex_Umathoverdelimiterbgap:D + \@@_primitive:NN \Umathoverdelimitervgap + \tex_Umathoverdelimitervgap:D + \@@_primitive:NN \Umathpunctbinspacing \tex_Umathpunctbinspacing:D + \@@_primitive:NN \Umathpunctclosespacing + \tex_Umathpunctclosespacing:D + \@@_primitive:NN \Umathpunctinnerspacing + \tex_Umathpunctinnerspacing:D + \@@_primitive:NN \Umathpunctopenspacing \tex_Umathpunctopenspacing:D + \@@_primitive:NN \Umathpunctopspacing \tex_Umathpunctopspacing:D + \@@_primitive:NN \Umathpunctordspacing \tex_Umathpunctordspacing:D + \@@_primitive:NN \Umathpunctpunctspacing + \tex_Umathpunctpunctspacing:D + \@@_primitive:NN \Umathpunctrelspacing \tex_Umathpunctrelspacing:D + \@@_primitive:NN \Umathquad \tex_Umathquad:D + \@@_primitive:NN \Umathradicaldegreeafter + \tex_Umathradicaldegreeafter:D + \@@_primitive:NN \Umathradicaldegreebefore + \tex_Umathradicaldegreebefore:D + \@@_primitive:NN \Umathradicaldegreeraise + \tex_Umathradicaldegreeraise:D + \@@_primitive:NN \Umathradicalkern \tex_Umathradicalkern:D + \@@_primitive:NN \Umathradicalrule \tex_Umathradicalrule:D + \@@_primitive:NN \Umathradicalvgap \tex_Umathradicalvgap:D + \@@_primitive:NN \Umathrelbinspacing \tex_Umathrelbinspacing:D + \@@_primitive:NN \Umathrelclosespacing \tex_Umathrelclosespacing:D + \@@_primitive:NN \Umathrelinnerspacing \tex_Umathrelinnerspacing:D + \@@_primitive:NN \Umathrelopenspacing \tex_Umathrelopenspacing:D + \@@_primitive:NN \Umathrelopspacing \tex_Umathrelopspacing:D + \@@_primitive:NN \Umathrelordspacing \tex_Umathrelordspacing:D + \@@_primitive:NN \Umathrelpunctspacing \tex_Umathrelpunctspacing:D + \@@_primitive:NN \Umathrelrelspacing \tex_Umathrelrelspacing:D + \@@_primitive:NN \Umathskewedfractionhgap + \tex_Umathskewedfractionhgap:D + \@@_primitive:NN \Umathskewedfractionvgap + \tex_Umathskewedfractionvgap:D + \@@_primitive:NN \Umathspaceafterscript \tex_Umathspaceafterscript:D + \@@_primitive:NN \Umathstackdenomdown \tex_Umathstackdenomdown:D + \@@_primitive:NN \Umathstacknumup \tex_Umathstacknumup:D + \@@_primitive:NN \Umathstackvgap \tex_Umathstackvgap:D + \@@_primitive:NN \Umathsubshiftdown \tex_Umathsubshiftdown:D + \@@_primitive:NN \Umathsubshiftdrop \tex_Umathsubshiftdrop:D + \@@_primitive:NN \Umathsubsupshiftdown \tex_Umathsubsupshiftdown:D + \@@_primitive:NN \Umathsubsupvgap \tex_Umathsubsupvgap:D + \@@_primitive:NN \Umathsubtopmax \tex_Umathsubtopmax:D + \@@_primitive:NN \Umathsupbottommin \tex_Umathsupbottommin:D + \@@_primitive:NN \Umathsupshiftdrop \tex_Umathsupshiftdrop:D + \@@_primitive:NN \Umathsupshiftup \tex_Umathsupshiftup:D + \@@_primitive:NN \Umathsupsubbottommax \tex_Umathsupsubbottommax:D + \@@_primitive:NN \Umathunderbarkern \tex_Umathunderbarkern:D + \@@_primitive:NN \Umathunderbarrule \tex_Umathunderbarrule:D + \@@_primitive:NN \Umathunderbarvgap \tex_Umathunderbarvgap:D + \@@_primitive:NN \Umathunderdelimiterbgap + \tex_Umathunderdelimiterbgap:D + \@@_primitive:NN \Umathunderdelimitervgap + \tex_Umathunderdelimitervgap:D + \@@_primitive:NN \Unosubscript \tex_Unosubscript:D + \@@_primitive:NN \Unosuperscript \tex_Unosuperscript:D + \@@_primitive:NN \Uoverdelimiter \tex_Uoverdelimiter:D + \@@_primitive:NN \Uradical \tex_Uradical:D + \@@_primitive:NN \Uroot \tex_Uroot:D + \@@_primitive:NN \Uskewed \tex_Uskewed:D + \@@_primitive:NN \Uskewedwithdelims \tex_Uskewedwithdelims:D + \@@_primitive:NN \Ustack \tex_Ustack:D + \@@_primitive:NN \Ustartdisplaymath \tex_Ustartdisplaymath:D + \@@_primitive:NN \Ustartmath \tex_Ustartmath:D + \@@_primitive:NN \Ustopdisplaymath \tex_Ustopdisplaymath:D + \@@_primitive:NN \Ustopmath \tex_Ustopmath:D + \@@_primitive:NN \Usubscript \tex_Usubscript:D + \@@_primitive:NN \Usuperscript \tex_Usuperscript:D + \@@_primitive:NN \Uunderdelimiter \tex_Uunderdelimiter:D + \@@_primitive:NN \Uvextensible \tex_Uvextensible:D +% \end{macrocode} +% Primitives from \pTeX{}. +% \begin{macrocode} + \@@_primitive:NN \autospacing \tex_autospacing:D + \@@_primitive:NN \autoxspacing \tex_autoxspacing:D + \@@_primitive:NN \dtou \tex_dtou:D + \@@_primitive:NN \epTeXinputencoding \tex_epTeXinputencoding:D + \@@_primitive:NN \epTeXversion \tex_epTeXversion:D + \@@_primitive:NN \euc \tex_euc:D + \@@_primitive:NN \ifdbox \tex_ifdbox:D + \@@_primitive:NN \ifddir \tex_ifddir:D + \@@_primitive:NN \ifmdir \tex_ifmdir:D + \@@_primitive:NN \iftbox \tex_iftbox:D + \@@_primitive:NN \iftdir \tex_iftdir:D + \@@_primitive:NN \ifybox \tex_ifybox:D + \@@_primitive:NN \ifydir \tex_ifydir:D + \@@_primitive:NN \inhibitglue \tex_inhibitglue:D + \@@_primitive:NN \inhibitxspcode \tex_inhibitxspcode:D + \@@_primitive:NN \jcharwidowpenalty \tex_jcharwidowpenalty:D + \@@_primitive:NN \jfam \tex_jfam:D + \@@_primitive:NN \jfont \tex_jfont:D + \@@_primitive:NN \jis \tex_jis:D + \@@_primitive:NN \kanjiskip \tex_kanjiskip:D + \@@_primitive:NN \kansuji \tex_kansuji:D + \@@_primitive:NN \kansujichar \tex_kansujichar:D + \@@_primitive:NN \kcatcode \tex_kcatcode:D + \@@_primitive:NN \kuten \tex_kuten:D + \@@_primitive:NN \noautospacing \tex_noautospacing:D + \@@_primitive:NN \noautoxspacing \tex_noautoxspacing:D + \@@_primitive:NN \postbreakpenalty \tex_postbreakpenalty:D + \@@_primitive:NN \prebreakpenalty \tex_prebreakpenalty:D + \@@_primitive:NN \ptexminorversion \tex_ptexminorversion:D + \@@_primitive:NN \ptexrevision \tex_ptexrevision:D + \@@_primitive:NN \ptexversion \tex_ptexversion:D + \@@_primitive:NN \showmode \tex_showmode:D + \@@_primitive:NN \sjis \tex_sjis:D + \@@_primitive:NN \tate \tex_tate:D + \@@_primitive:NN \tbaselineshift \tex_tbaselineshift:D + \@@_primitive:NN \tfont \tex_tfont:D + \@@_primitive:NN \xkanjiskip \tex_xkanjiskip:D + \@@_primitive:NN \xspcode \tex_xspcode:D + \@@_primitive:NN \ybaselineshift \tex_ybaselineshift:D + \@@_primitive:NN \yoko \tex_yoko:D +% \end{macrocode} +% Primitives from \upTeX{}. +% \begin{macrocode} + \@@_primitive:NN \disablecjktoken \tex_disablecjktoken:D + \@@_primitive:NN \enablecjktoken \tex_enablecjktoken:D + \@@_primitive:NN \forcecjktoken \tex_forcecjktoken:D + \@@_primitive:NN \kchar \tex_kchar:D + \@@_primitive:NN \kchardef \tex_kchardef:D + \@@_primitive:NN \kuten \tex_kuten:D + \@@_primitive:NN \ucs \tex_ucs:D + \@@_primitive:NN \uptexrevision \tex_uptexrevision:D + \@@_primitive:NN \uptexversion \tex_uptexversion:D +% \end{macrocode} +% End of the \enquote{just the names} part of the source. +% \begin{macrocode} +%</initex|names|package> +%<*initex|package> +% \end{macrocode} +% +% The job is done: close the group (using the primitive renamed!). +% \begin{macrocode} +\tex_endgroup:D +% \end{macrocode} +% +% \LaTeXe{} moves a few primitives, so these are sorted out. +% A convenient test for \LaTeXe{} is the \cs{@@@@end} saved primitive. +% \begin{macrocode} +%<*package> +\tex_ifdefined:D \@@@@end + \tex_let:D \tex_end:D \@@@@end + \tex_let:D \tex_everydisplay:D \frozen@everydisplay + \tex_let:D \tex_everymath:D \frozen@everymath + \tex_let:D \tex_hyphen:D \@@@@hyph + \tex_let:D \tex_input:D \@@@@input + \tex_let:D \tex_italiccorrection:D \@@@@italiccorr + \tex_let:D \tex_underline:D \@@@@underline +% \end{macrocode} +% The \tn{shipout} primitive is particularly tricky as a number of packages +% want to hook in here. First, we see if a sufficiently-new kernel has saved +% a copy: if it has, just use that. Otherwise, we need to check each of the +% possible packages/classes that might move it: here, we are looking for those +% which do \emph{not} delay action to the \tn{AtBeginDocument} hook. (We +% cannot use \tn{primitive} as that doesn't +% allow us to make a direct copy of the primitive \emph{itself}.) As we know +% that \LaTeXe{} is in use, we use it's \tn{@tfor} loop here. +% \begin{macrocode} + \tex_ifdefined:D \@@@@shipout + \tex_let:D \tex_shipout:D \@@@@shipout + \tex_fi:D + \tex_begingroup:D + \tex_edef:D \l_tmpa_tl { \tex_string:D \shipout } + \tex_edef:D \l_tmpb_tl { \tex_meaning:D \shipout } + \tex_ifx:D \l_tmpa_tl \l_tmpb_tl + \tex_else:D + \tex_expandafter:D \@tfor \tex_expandafter:D \@tempa \tex_string:D := + \CROP@shipout + \dup@shipout + \GPTorg@shipout + \LL@shipout + \mem@oldshipout + \opem@shipout + \pgfpages@originalshipout + \pr@shipout + \Shipout + \verso@orig@shipout + \do + { + \tex_edef:D \l_tmpb_tl + { \tex_expandafter:D \tex_meaning:D \@tempa } + \tex_ifx:D \l_tmpa_tl \l_tmpb_tl + \tex_global:D \tex_expandafter:D \tex_let:D + \tex_expandafter:D \tex_shipout:D \@tempa + \tex_fi:D + } + \tex_fi:D + \tex_endgroup:D +% \end{macrocode} +% Some tidying up is needed for \tn[index=tracingfonts]{(pdf)tracingfonts}. +% Newer \LuaTeX{} has +% this simply as \tn{tracingfonts}, but that is overwritten by +% the \LaTeXe{} kernel. So any spurious definition has to be removed, then +% the real version saved either from the \pdfTeX{} name or from \LuaTeX{}. +% In the latter case, we leave \tn{@@tracingfonts} available: this might +% be useful and almost all \LaTeXe{} users will have \pkg{expl3} loaded by +% \pkg{fontspec}. (We follow the usual kernel convention that |@@| is used +% for saved primitives.) +% \begin{macrocode} + \tex_let:D \tex_tracingfonts:D \tex_undefined:D + \tex_ifdefined:D \pdftracingfonts + \tex_let:D \tex_tracingfonts:D \pdftracingfonts + \tex_else:D + \tex_ifdefined:D \tex_directlua:D + \tex_directlua:D { tex.enableprimitives("@@@@", {"tracingfonts"}) } + \tex_let:D \tex_tracingfonts:D \luatextracingfonts + \tex_fi:D + \tex_fi:D +\tex_fi:D +% \end{macrocode} +% That is also true for the \LuaTeX{} primitives under \LaTeXe{} +% (depending on the format-building date). There are a few primitives +% that get the right names anyway so are missing here! +% \begin{macrocode} +\tex_ifdefined:D \luatexsuppressfontnotfounderror + \tex_let:D \tex_alignmark:D \luatexalignmark + \tex_let:D \tex_aligntab:D \luatexaligntab + \tex_let:D \tex_attribute:D \luatexattribute + \tex_let:D \tex_attributedef:D \luatexattributedef + \tex_let:D \tex_catcodetable:D \luatexcatcodetable + \tex_let:D \tex_clearmarks:D \luatexclearmarks + \tex_let:D \tex_crampeddisplaystyle:D \luatexcrampeddisplaystyle + \tex_let:D \tex_crampedscriptscriptstyle:D + \luatexcrampedscriptscriptstyle + \tex_let:D \tex_crampedscriptstyle:D \luatexcrampedscriptstyle + \tex_let:D \tex_crampedtextstyle:D \luatexcrampedtextstyle + \tex_let:D \tex_fontid:D \luatexfontid + \tex_let:D \tex_formatname:D \luatexformatname + \tex_let:D \tex_gleaders:D \luatexgleaders + \tex_let:D \tex_initcatcodetable:D \luatexinitcatcodetable + \tex_let:D \tex_latelua:D \luatexlatelua + \tex_let:D \tex_luaescapestring:D \luatexluaescapestring + \tex_let:D \tex_luafunction:D \luatexluafunction + \tex_let:D \tex_mathstyle:D \luatexmathstyle + \tex_let:D \tex_nokerns:D \luatexnokerns + \tex_let:D \tex_noligs:D \luatexnoligs + \tex_let:D \tex_outputbox:D \luatexoutputbox + \tex_let:D \tex_pageleftoffset:D \luatexpageleftoffset + \tex_let:D \tex_pagetopoffset:D \luatexpagetopoffset + \tex_let:D \tex_postexhyphenchar:D \luatexpostexhyphenchar + \tex_let:D \tex_posthyphenchar:D \luatexposthyphenchar + \tex_let:D \tex_preexhyphenchar:D \luatexpreexhyphenchar + \tex_let:D \tex_prehyphenchar:D \luatexprehyphenchar + \tex_let:D \tex_savecatcodetable:D \luatexsavecatcodetable + \tex_let:D \tex_scantextokens:D \luatexscantextokens + \tex_let:D \tex_suppressifcsnameerror:D + \luatexsuppressifcsnameerror + \tex_let:D \tex_suppresslongerror:D \luatexsuppresslongerror + \tex_let:D \tex_suppressmathparerror:D + \luatexsuppressmathparerror + \tex_let:D \tex_suppressoutererror:D \luatexsuppressoutererror + \tex_let:D \tex_Uchar:D \luatexUchar + \tex_let:D \tex_suppressfontnotfounderror:D + \luatexsuppressfontnotfounderror +% \end{macrocode} +% Which also covers those slightly odd ones. +% \begin{macrocode} + \tex_let:D \tex_bodydir:D \luatexbodydir + \tex_let:D \tex_boxdir:D \luatexboxdir + \tex_let:D \tex_leftghost:D \luatexleftghost + \tex_let:D \tex_localbrokenpenalty:D \luatexlocalbrokenpenalty + \tex_let:D \tex_localinterlinepenalty:D + \luatexlocalinterlinepenalty + \tex_let:D \tex_localleftbox:D \luatexlocalleftbox + \tex_let:D \tex_localrightbox:D \luatexlocalrightbox + \tex_let:D \tex_mathdir:D \luatexmathdir + \tex_let:D \tex_pagebottomoffset:D \luatexpagebottomoffset + \tex_let:D \tex_pagedir:D \luatexpagedir + \tex_let:D \tex_pageheight:D \luatexpageheight + \tex_let:D \tex_pagerightoffset:D \luatexpagerightoffset + \tex_let:D \tex_pagewidth:D \luatexpagewidth + \tex_let:D \tex_pardir:D \luatexpardir + \tex_let:D \tex_rightghost:D \luatexrightghost + \tex_let:D \tex_textdir:D \luatextextdir +\tex_fi:D +% \end{macrocode} +% Only \pdfTeX{} and \LuaTeX{} define \tn{pdfmapfile} and \tn{pdfmapline}: +% Tidy up the fact that some format-building processes leave +% a couple of questionable decisions about that! +% \begin{macrocode} +\tex_ifnum:D 0 + \tex_ifdefined:D \tex_pdftexversion:D 1 \tex_fi:D + \tex_ifdefined:D \tex_luatexversion:D 1 \tex_fi:D + = 0 % + \tex_let:D \tex_mapfile:D \tex_undefined:D + \tex_let:D \tex_mapline:D \tex_undefined:D +\tex_fi:D +%</package> +% \end{macrocode} +% Up to v0.80, \LuaTeX{} defines the \pdfTeX{} version data: rather +% confusing. Removing them means that \cs{tex_pdftexversion:D} is +% a marker for \pdfTeX{} alone: useful in engine-dependent code later. +% \begin{macrocode} +%<*initex|package> +\tex_ifdefined:D \tex_luatexversion:D + \tex_let:D \tex_pdftexbanner:D \tex_undefined:D + \tex_let:D \tex_pdftexrevision:D \tex_undefined:D + \tex_let:D \tex_pdftexversion:D \tex_undefined:D +\tex_fi:D +%</initex|package> +% \end{macrocode} +% +% For \ConTeXt{}, two tests are needed. Both Mark~II and Mark~IV move several +% primitives: these are all covered by the first test, again using \cs{end} +% as a marker. For Mark~IV, a few more primitives are moved: they are +% implemented using some Lua code in the current \ConTeXt{}. +% \begin{macrocode} +%<*package> +\tex_ifdefined:D \normalend + \tex_let:D \tex_end:D \normalend + \tex_let:D \tex_everyjob:D \normaleveryjob + \tex_let:D \tex_input:D \normalinput + \tex_let:D \tex_language:D \normallanguage + \tex_let:D \tex_mathop:D \normalmathop + \tex_let:D \tex_month:D \normalmonth + \tex_let:D \tex_outer:D \normalouter + \tex_let:D \tex_over:D \normalover + \tex_let:D \tex_vcenter:D \normalvcenter + \tex_let:D \tex_unexpanded:D \normalunexpanded + \tex_let:D \tex_expanded:D \normalexpanded +\tex_fi:D +\tex_ifdefined:D \normalitaliccorrection + \tex_let:D \tex_hoffset:D \normalhoffset + \tex_let:D \tex_italiccorrection:D \normalitaliccorrection + \tex_let:D \tex_voffset:D \normalvoffset + \tex_let:D \tex_showtokens:D \normalshowtokens + \tex_let:D \tex_bodydir:D \spac_directions_normal_body_dir + \tex_let:D \tex_pagedir:D \spac_directions_normal_page_dir +\tex_fi:D +\tex_ifdefined:D \normalleft + \tex_let:D \tex_left:D \normalleft + \tex_let:D \tex_middle:D \normalmiddle + \tex_let:D \tex_right:D \normalright +\tex_fi:D +%</package> +% \end{macrocode} +% +% \subsection{Deprecated functions} +% +% Older versions of \pkg{expl3} divided up primitives by \enquote{source}: that +% becomes very tricky with multiple parallel engine developments, so has been +% dropped. To cover the transition, we provide the older names here for a +% limited period (until the end of 2019). +% +% To allow \cs{debug_on:n} \Arg{deprecation} to work we save the list of +% primitives into \cs{@@_primitives:} +% \begin{macrocode} +%<*package> +\tex_begingroup:D + \tex_long:D \tex_def:D \use_ii:nn #1#2 {#2} + \tex_long:D \tex_def:D \use_none:n #1 { } + \tex_long:D \tex_def:D \@@_primitive:NN #1#2 + { + \tex_ifdefined:D #1 + \tex_expandafter:D \use_ii:nn + \tex_fi:D + \use_none:n { \tex_global:D \tex_let:D #2 #1 } + } + \tex_xdef:D \@@_primitives: + { + \tex_unexpanded:D + { \@@_primitive:NN \beginL \etex_beginL:D \@@_primitive:NN \beginR \etex_beginR:D \@@_primitive:NN \botmarks \etex_botmarks:D @@ -536,16 +1444,6 @@ \@@_primitive:NN \unexpanded \etex_unexpanded:D \@@_primitive:NN \unless \etex_unless:D \@@_primitive:NN \widowpenalties \etex_widowpenalties:D -% \end{macrocode} -% The newer primitives are more complex: there are an awful lot of them, -% and we don't use them all at the moment. So the following is selective, -% based on those also available in \LuaTeX{} or used in \pkg{expl3}. -% In the case of the \pdfTeX{} primitives, we retain |pdf| at the start -% of the names \emph{only} for directly PDF-related primitives, as -% there are a lot of \pdfTeX{} primitives that start \cs[no-index]{pdf\ldots} but -% are not related to PDF output. These ones related to PDF output or only -% work in PDF mode. -% \begin{macrocode} \@@_primitive:NN \pdfannot \pdftex_pdfannot:D \@@_primitive:NN \pdfcatalog \pdftex_pdfcatalog:D \@@_primitive:NN \pdfcompresslevel \pdftex_pdfcompresslevel:D @@ -575,7 +1473,7 @@ \pdftex_pdfinclusionerrorlevel:D \@@_primitive:NN \pdfinfo \pdftex_pdfinfo:D \@@_primitive:NN \pdflastannot \pdftex_pdflastannot:D - \@@_primitive:NN \pdflastlink \pfdftex_pdflastlink:D + \@@_primitive:NN \pdflastlink \pdftex_pdflastlink:D \@@_primitive:NN \pdflastobj \pdftex_pdflastobj:D \@@_primitive:NN \pdflastxform \pdftex_pdflastxform:D \@@_primitive:NN \pdflastximage \pdftex_pdflastximage:D @@ -618,9 +1516,6 @@ \@@_primitive:NN \pdfxformresources \pdftex_pdfxformresources:D \@@_primitive:NN \pdfximage \pdftex_pdfximage:D \@@_primitive:NN \pdfximagebbox \pdftex_pdfximagebbox:D -% \end{macrocode} -% While these are not. -% \begin{macrocode} \@@_primitive:NN \ifpdfabsdim \pdftex_ifabsdim:D \@@_primitive:NN \ifpdfabsnum \pdftex_ifabsnum:D \@@_primitive:NN \ifpdfprimitive \pdftex_ifprimitive:D @@ -631,7 +1526,7 @@ \@@_primitive:NN \pdfeachlineheight \pdftex_eachlineheight:D \@@_primitive:NN \pdffilemoddate \pdftex_filemoddate:D \@@_primitive:NN \pdffilesize \pdftex_filesize:D - \@@_primitive:NN \pdffirstlineheigh \pdftex_firstlineheight:D + \@@_primitive:NN \pdffirstlineheight \pdftex_firstlineheight:D \@@_primitive:NN \pdffontexpand \pdftex_fontexpand:D \@@_primitive:NN \pdffontsize \pdftex_fontsize:D \@@_primitive:NN \pdfignoreddimen \pdftex_ignoreddimen:D @@ -658,17 +1553,9 @@ \@@_primitive:NN \pdfshellescape \pdftex_shellescape:D \@@_primitive:NN \pdftracingfonts \pdftex_tracingfonts:D \@@_primitive:NN \pdfuniformdeviate \pdftex_uniformdeviate:D -% \end{macrocode} -% The version primitives are not related to PDF mode but are related to -% \pdfTeX{} so retain the full prefix. -% \begin{macrocode} \@@_primitive:NN \pdftexbanner \pdftex_pdftexbanner:D \@@_primitive:NN \pdftexrevision \pdftex_pdftexrevision:D \@@_primitive:NN \pdftexversion \pdftex_pdftexversion:D -% \end{macrocode} -% These ones appear in \pdfTeX{} but don't have |pdf| in the name at all. -% (\tn{synctex} is odd as it's really not from \pdfTeX{} but from SyncTeX!) -% \begin{macrocode} \@@_primitive:NN \efcode \pdftex_efcode:D \@@_primitive:NN \ifincsname \pdftex_ifincsname:D \@@_primitive:NN \leftmarginkern \pdftex_leftmarginkern:D @@ -679,35 +1566,42 @@ \@@_primitive:NN \rpcode \pdftex_rpcode:D \@@_primitive:NN \synctex \pdftex_synctex:D \@@_primitive:NN \tagcode \pdftex_tagcode:D -% \end{macrocode} -% Post \pdfTeX{} primitive availability gets more complex. Both \XeTeX{} and -% \LuaTeX{} have varying names for some primitives from \pdfTeX{}. Particularly -% for \LuaTeX{} tracking all of that would be hard. Instead, we now check that -% we only save primitives if they actually exist. -% \begin{macrocode} -%</initex|names|package> -%<*initex|package> - \tex_long:D \tex_def:D \use_ii:nn #1#2 {#2} - \tex_long:D \tex_def:D \use_none:n #1 { } - \tex_long:D \tex_def:D \@@_primitive:NN #1#2 - { - \etex_ifdefined:D #1 - \tex_expandafter:D \use_ii:nn - \tex_fi:D - \use_none:n { \tex_global:D \tex_let:D #2 #1 } -%<*initex> - \tex_global:D \tex_let:D #1 \tex_undefined:D -%</initex> - } -%</initex|package> -%<*initex|names|package> -% \end{macrocode} -% \XeTeX{}-specific primitives. Note that \XeTeX{}'s \tn{strcmp} is -% handled earlier and is \enquote{rolled up} into \tn{pdfstrcmp}. With -% the exception of the version primitives these don't carry |XeTeX| through -% into the \enquote{base} name. A few cross-compatibility names which lack -% the |pdf| of the original are handled later. -% \begin{macrocode} + \@@_primitive:NN \mdfivesum \pdftex_mdfivesum:D + \@@_primitive:NN \ifprimitive \pdftex_ifprimitive:D + \@@_primitive:NN \primitive \pdftex_primitive:D + \@@_primitive:NN \shellescape \pdftex_shellescape:D + \@@_primitive:NN \adjustspacing \pdftex_adjustspacing:D + \@@_primitive:NN \copyfont \pdftex_copyfont:D + \@@_primitive:NN \draftmode \pdftex_draftmode:D + \@@_primitive:NN \expandglyphsinfont \pdftex_fontexpand:D + \@@_primitive:NN \ifabsdim \pdftex_ifabsdim:D + \@@_primitive:NN \ifabsnum \pdftex_ifabsnum:D + \@@_primitive:NN \ignoreligaturesinfont + \pdftex_ignoreligaturesinfont:D + \@@_primitive:NN \insertht \pdftex_insertht:D + \@@_primitive:NN \lastsavedboxresourceindex + \pdftex_pdflastxform:D + \@@_primitive:NN \lastsavedimageresourceindex + \pdftex_pdflastximage:D + \@@_primitive:NN \lastsavedimageresourcepages + \pdftex_pdflastximagepages:D + \@@_primitive:NN \lastxpos \pdftex_lastxpos:D + \@@_primitive:NN \lastypos \pdftex_lastypos:D + \@@_primitive:NN \normaldeviate \pdftex_normaldeviate:D + \@@_primitive:NN \outputmode \pdftex_pdfoutput:D + \@@_primitive:NN \pageheight \pdftex_pageheight:D + \@@_primitive:NN \pagewidth \pdftex_pagewith:D + \@@_primitive:NN \protrudechars \pdftex_protrudechars:D + \@@_primitive:NN \pxdimen \pdftex_pxdimen:D + \@@_primitive:NN \randomseed \pdftex_randomseed:D + \@@_primitive:NN \useboxresource \pdftex_pdfrefxform:D + \@@_primitive:NN \useimageresource \pdftex_pdfrefximage:D + \@@_primitive:NN \savepos \pdftex_savepos:D + \@@_primitive:NN \saveboxresource \pdftex_pdfxform:D + \@@_primitive:NN \saveimageresource \pdftex_pdfximage:D + \@@_primitive:NN \setrandomseed \pdftex_setrandomseed:D + \@@_primitive:NN \tracingfonts \pdftex_tracingfonts:D + \@@_primitive:NN \uniformdeviate \pdftex_uniformdeviate:D \@@_primitive:NN \suppressfontnotfounderror \xetex_suppressfontnotfounderror:D \@@_primitive:NN \XeTeXcharclass \xetex_charclass:D @@ -766,24 +1660,8 @@ \@@_primitive:NN \XeTeXvariationmax \xetex_variationmax:D \@@_primitive:NN \XeTeXvariationmin \xetex_variationmin:D \@@_primitive:NN \XeTeXvariationname \xetex_variationname:D -% \end{macrocode} -% The version primitives retain |XeTeX|. -% \begin{macrocode} \@@_primitive:NN \XeTeXrevision \xetex_XeTeXrevision:D \@@_primitive:NN \XeTeXversion \xetex_XeTeXversion:D -% \end{macrocode} -% Primitives from \pdfTeX{} that \XeTeX{} renames: also helps with -% \LuaTeX{}. -% \begin{macrocode} - \@@_primitive:NN \mdfivesum \pdftex_mdfivesum:D - \@@_primitive:NN \ifprimitive \pdftex_ifprimitive:D - \@@_primitive:NN \primitive \pdftex_primitive:D - \@@_primitive:NN \shellescape \pdftex_shellescape:D -% \end{macrocode} -% Primitives from \LuaTeX{}, some of which have been ported back to -% \XeTeX{}. Notice that \tn{expanded} was intended for \pdfTeX{}~1.50 but -% as that was not released we call this a \LuaTeX{} primitive. -% \begin{macrocode} \@@_primitive:NN \alignmark \luatex_alignmark:D \@@_primitive:NN \aligntab \luatex_aligntab:D \@@_primitive:NN \attribute \luatex_attribute:D @@ -883,12 +1761,6 @@ \@@_primitive:NN \tokspre \luatex_tokspre:D \@@_primitive:NN \tpack \luatex_tpack:D \@@_primitive:NN \vpack \luatex_vpack:D -% \end{macrocode} -% Slightly more awkward are the directional primitives in \LuaTeX{}. These -% come from Omega/Aleph, but we do not support those engines and -% so it seems most sensible to treat them as \LuaTeX{} primitives for prefix -% purposes. One here is \enquote{new} but fits into the general set. -% \begin{macrocode} \@@_primitive:NN \bodydir \luatex_bodydir:D \@@_primitive:NN \boxdir \luatex_boxdir:D \@@_primitive:NN \leftghost \luatex_leftghost:D @@ -903,50 +1775,6 @@ \@@_primitive:NN \pardir \luatex_pardir:D \@@_primitive:NN \rightghost \luatex_rightghost:D \@@_primitive:NN \textdir \luatex_textdir:D -% \end{macrocode} -% Primitives from \pdfTeX{} that \LuaTeX{} renames. -% \begin{macrocode} - \@@_primitive:NN \adjustspacing \pdftex_adjustspacing:D - \@@_primitive:NN \copyfont \pdftex_copyfont:D - \@@_primitive:NN \draftmode \pdftex_draftmode:D - \@@_primitive:NN \expandglyphsinfont \pdftex_fontexpand:D - \@@_primitive:NN \ifabsdim \pdftex_ifabsdim:D - \@@_primitive:NN \ifabsnum \pdftex_ifabsnum:D - \@@_primitive:NN \ignoreligaturesinfont - \pdftex_ignoreligaturesinfont:D - \@@_primitive:NN \insertht \pdftex_insertht:D - \@@_primitive:NN \lastsavedboxresourceindex - \pdftex_pdflastxform:D - \@@_primitive:NN \lastsavedimageresourceindex - \pdftex_pdflastximage:D - \@@_primitive:NN \lastsavedimageresourcepages - \pdftex_pdflastximagepages:D - \@@_primitive:NN \lastxpos \pdftex_lastxpos:D - \@@_primitive:NN \lastypos \pdftex_lastypos:D - \@@_primitive:NN \normaldeviate \pdftex_normaldeviate:D - \@@_primitive:NN \outputmode \pdftex_pdfoutput:D - \@@_primitive:NN \pageheight \pdftex_pageheight:D - \@@_primitive:NN \pagewidth \pdftex_pagewith:D - \@@_primitive:NN \protrudechars \pdftex_protrudechars:D - \@@_primitive:NN \pxdimen \pdftex_pxdimen:D - \@@_primitive:NN \randomseed \pdftex_randomseed:D - \@@_primitive:NN \useboxresource \pdftex_pdfrefxform:D - \@@_primitive:NN \useimageresource \pdftex_pdfrefximage:D - \@@_primitive:NN \savepos \pdftex_savepos:D - \@@_primitive:NN \saveboxresource \pdftex_pdfxform:D - \@@_primitive:NN \saveimageresource \pdftex_pdfximage:D - \@@_primitive:NN \setrandomseed \pdftex_setrandomseed:D - \@@_primitive:NN \tracingfonts \pdftex_tracingfonts:D - \@@_primitive:NN \uniformdeviate \pdftex_uniformdeviate:D -% \end{macrocode} -% The set of Unicode math primitives were introduced by \XeTeX{} and \LuaTeX{} -% in a somewhat complex fashion: a few first as |\XeTeX...| which were then -% renamed with \LuaTeX{} having a lot more. These names now all start -% |\U...| and mainly |\Umath...|. To keep things somewhat clear we therefore -% prefix all of these as |\utex...| (introduced by a Unicode \TeX{} engine) -% and drop |\U(math)| from the names. Where there is a related \TeX{}90 -% primitive or where it really seems required we keep the |math| part of the name. -% \begin{macrocode} \@@_primitive:NN \Uchar \utex_char:D \@@_primitive:NN \Ucharcat \utex_charcat:D \@@_primitive:NN \Udelcode \utex_delcode:D @@ -1114,9 +1942,6 @@ \@@_primitive:NN \Usuperscript \utex_superscript:D \@@_primitive:NN \Uunderdelimiter \utex_underdelimiter:D \@@_primitive:NN \Uvextensible \utex_vextensible:D -% \end{macrocode} -% Primitives from \pTeX{}. -% \begin{macrocode} \@@_primitive:NN \autospacing \ptex_autospacing:D \@@_primitive:NN \autoxspacing \ptex_autoxspacing:D \@@_primitive:NN \dtou \ptex_dtou:D @@ -1145,6 +1970,8 @@ \@@_primitive:NN \noautoxspacing \ptex_noautoxspacing:D \@@_primitive:NN \postbreakpenalty \ptex_postbreakpenalty:D \@@_primitive:NN \prebreakpenalty \ptex_prebreakpenalty:D + \@@_primitive:NN \ptexminorversion \ptex_ptexminorversion:D + \@@_primitive:NN \ptexrevision \ptex_ptexrevision:D \@@_primitive:NN \ptexversion \ptex_ptexversion:D \@@_primitive:NN \showmode \ptex_showmode:D \@@_primitive:NN \sjis \ptex_sjis:D @@ -1155,9 +1982,6 @@ \@@_primitive:NN \xspcode \ptex_xspcode:D \@@_primitive:NN \ybaselineshift \ptex_ybaselineshift:D \@@_primitive:NN \yoko \ptex_yoko:D -% \end{macrocode} -% Primitives from \upTeX{}. -% \begin{macrocode} \@@_primitive:NN \disablecjktoken \uptex_disablecjktoken:D \@@_primitive:NN \enablecjktoken \uptex_enablecjktoken:D \@@_primitive:NN \forcecjktoken \uptex_forcecjktoken:D @@ -1165,234 +1989,12 @@ \@@_primitive:NN \kchardef \uptex_kchardef:D \@@_primitive:NN \kuten \uptex_kuten:D \@@_primitive:NN \ucs \uptex_ucs:D + \@@_primitive:NN \uptexrevision \uptex_uptexrevision:D \@@_primitive:NN \uptexversion \uptex_uptexversion:D -% \end{macrocode} -% End of the \enquote{just the names} part of the source. -% \begin{macrocode} -%</initex|names|package> -%<*initex|package> -% \end{macrocode} -% -% The job is done: close the group (using the primitive renamed!). -% \begin{macrocode} + } + } + \@@_primitives: \tex_endgroup:D -% \end{macrocode} -% -% \LaTeXe{} moves a few primitives, so these are sorted out. -% A convenient test for \LaTeXe{} is the \cs{@@@@end} saved primitive. -% \begin{macrocode} -%<*package> -\etex_ifdefined:D \@@@@end - \tex_let:D \tex_end:D \@@@@end - \tex_let:D \tex_everydisplay:D \frozen@everydisplay - \tex_let:D \tex_everymath:D \frozen@everymath - \tex_let:D \tex_hyphen:D \@@@@hyph - \tex_let:D \tex_input:D \@@@@input - \tex_let:D \tex_italiccorrection:D \@@@@italiccorr - \tex_let:D \tex_underline:D \@@@@underline -% \end{macrocode} -% The \tn{shipout} primitive is particularly tricky as a number of packages -% want to hook in here. First, we see if a sufficiently-new kernel has saved -% a copy: if it has, just use that. Otherwise, we need to check each of the -% possible packages/classes that might move it: here, we are looking for those -% which do \emph{not} delay action to the \tn{AtBeginDocument} hook. (We -% cannot use \tn{primitive} a (u)\pTeX{} doesn't offer it and as that doesn't -% allow us to make a direct copy of the primitive \emph{itself}.) As we know -% that \LaTeXe{} is in use, we use it's \tn{@tfor} loop here. -% \begin{macrocode} - \etex_ifdefined:D \@@@@shipout - \tex_let:D \tex_shipout:D \@@@@shipout - \tex_fi:D - \tex_begingroup:D - \tex_edef:D \l_tmpa_tl { \tex_string:D \shipout } - \tex_edef:D \l_tmpb_tl { \tex_meaning:D \shipout } - \tex_ifx:D \l_tmpa_tl \l_tmpb_tl - \tex_else:D - \tex_expandafter:D \@tfor \tex_expandafter:D \@tempa \tex_string:D := - \CROP@shipout - \dup@shipout - \GPTorg@shipout - \LL@shipout - \mem@oldshipout - \opem@shipout - \pgfpages@originalshipout - \pr@shipout - \Shipout - \verso@orig@shipout - \do - { - \tex_edef:D \l_tmpb_tl - { \tex_expandafter:D \tex_meaning:D \@tempa } - \tex_ifx:D \l_tmpa_tl \l_tmpb_tl - \tex_global:D \tex_expandafter:D \tex_let:D - \tex_expandafter:D \tex_shipout:D \@tempa - \tex_fi:D - } - \tex_fi:D - \tex_endgroup:D -% \end{macrocode} -% Some tidying up is needed for \tn[index=tracingfonts]{(pdf)tracingfonts}. -% Newer \LuaTeX{} has -% this simply as \tn{tracingfonts}, but that is overwritten by -% the \LaTeXe{} kernel. So any spurious definition has to be removed, then -% the real version saved either from the \pdfTeX{} name or from \LuaTeX{}. -% In the latter case, we leave \tn{@@tracingfonts} available: this might -% be useful and almost all \LaTeXe{} users will have \pkg{expl3} loaded by -% \pkg{fontspec}. (We follow the usual kernel convention that |@@| is used -% for saved primitives.) -% \begin{macrocode} - \tex_let:D \pdftex_tracingfonts:D \tex_undefined:D - \etex_ifdefined:D \pdftracingfonts - \tex_let:D \pdftex_tracingfonts:D \pdftracingfonts - \tex_else:D - \etex_ifdefined:D \luatex_directlua:D - \luatex_directlua:D { tex.enableprimitives("@@@@", {"tracingfonts"}) } - \tex_let:D \pdftex_tracingfonts:D \luatextracingfonts - \tex_fi:D - \tex_fi:D -\tex_fi:D -% \end{macrocode} -% That is also true for the \LuaTeX{} primitives under \LaTeXe{} -% (depending on the format-building date). There are a few primitives -% that get the right names anyway so are missing here! -% \begin{macrocode} -\etex_ifdefined:D \luatexsuppressfontnotfounderror - \tex_let:D \luatex_alignmark:D \luatexalignmark - \tex_let:D \luatex_aligntab:D \luatexaligntab - \tex_let:D \luatex_attribute:D \luatexattribute - \tex_let:D \luatex_attributedef:D \luatexattributedef - \tex_let:D \luatex_catcodetable:D \luatexcatcodetable - \tex_let:D \luatex_clearmarks:D \luatexclearmarks - \tex_let:D \luatex_crampeddisplaystyle:D \luatexcrampeddisplaystyle - \tex_let:D \luatex_crampedscriptscriptstyle:D - \luatexcrampedscriptscriptstyle - \tex_let:D \luatex_crampedscriptstyle:D \luatexcrampedscriptstyle - \tex_let:D \luatex_crampedtextstyle:D \luatexcrampedtextstyle - \tex_let:D \luatex_fontid:D \luatexfontid - \tex_let:D \luatex_formatname:D \luatexformatname - \tex_let:D \luatex_gleaders:D \luatexgleaders - \tex_let:D \luatex_initcatcodetable:D \luatexinitcatcodetable - \tex_let:D \luatex_latelua:D \luatexlatelua - \tex_let:D \luatex_luaescapestring:D \luatexluaescapestring - \tex_let:D \luatex_luafunction:D \luatexluafunction - \tex_let:D \luatex_mathstyle:D \luatexmathstyle - \tex_let:D \luatex_nokerns:D \luatexnokerns - \tex_let:D \luatex_noligs:D \luatexnoligs - \tex_let:D \luatex_outputbox:D \luatexoutputbox - \tex_let:D \luatex_pageleftoffset:D \luatexpageleftoffset - \tex_let:D \luatex_pagetopoffset:D \luatexpagetopoffset - \tex_let:D \luatex_postexhyphenchar:D \luatexpostexhyphenchar - \tex_let:D \luatex_posthyphenchar:D \luatexposthyphenchar - \tex_let:D \luatex_preexhyphenchar:D \luatexpreexhyphenchar - \tex_let:D \luatex_prehyphenchar:D \luatexprehyphenchar - \tex_let:D \luatex_savecatcodetable:D \luatexsavecatcodetable - \tex_let:D \luatex_scantextokens:D \luatexscantextokens - \tex_let:D \luatex_suppressifcsnameerror:D - \luatexsuppressifcsnameerror - \tex_let:D \luatex_suppresslongerror:D \luatexsuppresslongerror - \tex_let:D \luatex_suppressmathparerror:D - \luatexsuppressmathparerror - \tex_let:D \luatex_suppressoutererror:D \luatexsuppressoutererror - \tex_let:D \utex_char:D \luatexUchar - \tex_let:D \xetex_suppressfontnotfounderror:D - \luatexsuppressfontnotfounderror -% \end{macrocode} -% Which also covers those slightly odd ones. -% \begin{macrocode} - \tex_let:D \luatex_bodydir:D \luatexbodydir - \tex_let:D \luatex_boxdir:D \luatexboxdir - \tex_let:D \luatex_leftghost:D \luatexleftghost - \tex_let:D \luatex_localbrokenpenalty:D \luatexlocalbrokenpenalty - \tex_let:D \luatex_localinterlinepenalty:D - \luatexlocalinterlinepenalty - \tex_let:D \luatex_localleftbox:D \luatexlocalleftbox - \tex_let:D \luatex_localrightbox:D \luatexlocalrightbox - \tex_let:D \luatex_mathdir:D \luatexmathdir - \tex_let:D \luatex_pagebottomoffset:D \luatexpagebottomoffset - \tex_let:D \luatex_pagedir:D \luatexpagedir - \tex_let:D \pdftex_pageheight:D \luatexpageheight - \tex_let:D \luatex_pagerightoffset:D \luatexpagerightoffset - \tex_let:D \pdftex_pagewidth:D \luatexpagewidth - \tex_let:D \luatex_pardir:D \luatexpardir - \tex_let:D \luatex_rightghost:D \luatexrightghost - \tex_let:D \luatex_textdir:D \luatextextdir -\tex_fi:D -% \end{macrocode} -% Only \pdfTeX{} and \LuaTeX{} define \tn{pdfmapfile} and \tn{pdfmapline}: -% Tidy up the fact that some format-building processes leave -% a couple of questionable decisions about that! -% \begin{macrocode} -\tex_ifnum:D 0 - \etex_ifdefined:D \pdftex_pdftexversion:D 1 \tex_fi:D - \etex_ifdefined:D \luatex_luatexversion:D 1 \tex_fi:D - = 0 % - \tex_let:D \pdftex_mapfile:D \tex_undefined:D - \tex_let:D \pdftex_mapline:D \tex_undefined:D -\tex_fi:D -%</package> -% \end{macrocode} -% Older \XeTeX{} versions use |\XeTeX| as the prefix for the Unicode math -% primitives it knows. That is tided up here (we support \XeTeX{} versions -% from 0.9994 but this change was in 0.9999). -% \begin{macrocode} -%<*initex|package> -\etex_ifdefined:D \XeTeXdelcode - \tex_let:D \utex_delcode:D \XeTeXdelcode - \tex_let:D \utex_delcodenum:D \XeTeXdelcodenum - \tex_let:D \utex_delimiter:D \XeTeXdelimiter - \tex_let:D \utex_mathaccent:D \XeTeXmathaccent - \tex_let:D \utex_mathchar:D \XeTeXmathchar - \tex_let:D \utex_mathchardef:D \XeTeXmathchardef - \tex_let:D \utex_mathcharnum:D \XeTeXmathcharnum - \tex_let:D \utex_mathcharnumdef:D \XeTeXmathcharnumdef - \tex_let:D \utex_mathcode:D \XeTeXmathcode - \tex_let:D \utex_mathcodenum:D \XeTeXmathcodenum -\tex_fi:D -% \end{macrocode} -% Up to v0.80, \LuaTeX{} defines the \pdfTeX{} version data: rather -% confusing. Removing them means that \cs{pdftex_pdftexversion:D} is -% a marker for \pdfTeX{} alone: useful in engine-dependent code later. -% \begin{macrocode} -\etex_ifdefined:D \luatex_luatexversion:D - \tex_let:D \pdftex_pdftexbanner:D \tex_undefined:D - \tex_let:D \pdftex_pdftexrevision:D \tex_undefined:D - \tex_let:D \pdftex_pdftexversion:D \tex_undefined:D -\tex_fi:D -%</initex|package> -% \end{macrocode} -% -% For \ConTeXt{}, two tests are needed. Both Mark~II and Mark~IV move several -% primitives: these are all covered by the first test, again using \cs{end} -% as a marker. For Mark~IV, a few more primitives are moved: they are -% implemented using some Lua code in the current \ConTeXt{}. -% \begin{macrocode} -%<*package> -\etex_ifdefined:D \normalend - \tex_let:D \tex_end:D \normalend - \tex_let:D \tex_everyjob:D \normaleveryjob - \tex_let:D \tex_input:D \normalinput - \tex_let:D \tex_language:D \normallanguage - \tex_let:D \tex_mathop:D \normalmathop - \tex_let:D \tex_month:D \normalmonth - \tex_let:D \tex_outer:D \normalouter - \tex_let:D \tex_over:D \normalover - \tex_let:D \tex_vcenter:D \normalvcenter - \tex_let:D \etex_unexpanded:D \normalunexpanded - \tex_let:D \luatex_expanded:D \normalexpanded -\tex_fi:D -\etex_ifdefined:D \normalitaliccorrection - \tex_let:D \tex_hoffset:D \normalhoffset - \tex_let:D \tex_italiccorrection:D \normalitaliccorrection - \tex_let:D \tex_voffset:D \normalvoffset - \tex_let:D \etex_showtokens:D \normalshowtokens - \tex_let:D \luatex_bodydir:D \spac_directions_normal_body_dir - \tex_let:D \luatex_pagedir:D \spac_directions_normal_page_dir -\tex_fi:D -\etex_ifdefined:D \normalleft - \tex_let:D \tex_left:D \normalleft - \tex_let:D \tex_middle:D \normalmiddle - \tex_let:D \tex_right:D \normalright -\tex_fi:D %</package> % \end{macrocode} % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3oldmodules.dtx b/Master/texmf-dist/source/latex/l3kernel/l3oldmodules.dtx index 77e3c46c775..6bf16f942fe 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3oldmodules.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3oldmodules.dtx @@ -42,7 +42,7 @@ % } % % -% \date{Released 2018-04-30} +% \date{Released 2018-05-12} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3prg.dtx b/Master/texmf-dist/source/latex/l3kernel/l3prg.dtx index 74accffcc5c..6717b23a484 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3prg.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3prg.dtx @@ -41,7 +41,7 @@ % }^^A % } % -% \date{Released 2018-04-30} +% \date{Released 2018-05-12} % % \maketitle % @@ -484,13 +484,13 @@ % expression. % \end{function} % -% \begin{function}[EXP, updated = 2017-07-15]{\bool_xor_p:nn} +% \begin{function}[EXP, pTF, added = 2018-05-09]{\bool_xor:nn} % \begin{syntax} % \cs{bool_xor_p:nn} \Arg{boolexpr_1} \Arg{boolexpr_2} +% \cs{bool_xor:nnTF} \Arg{boolexpr_1} \Arg{boolexpr_2} \Arg{true code} \Arg{false code} % \end{syntax} % Implements an \enquote{exclusive or} operation between two boolean -% expressions. There is no infix operation for this logical -% operator. +% expressions. There is no infix operation for this logical operation. % \end{function} % % \section{Logical loops} @@ -862,15 +862,24 @@ % \begin{macro}{\bool_set:Nn, \bool_set:cn} % \begin{macro}{\bool_gset:Nn, \bool_gset:cn} % This function evaluates a boolean expression and assigns the first -% argument the meaning \cs{c_true_bool} or \cs{c_false_bool}. -% Again, we include some checking code. +% argument the meaning \cs{c_true_bool} or \cs{c_false_bool}. Again, +% we include some checking code. It is important to evaluate the +% expression before applying the \tn{chardef} primitive, because that +% primitive sets the left-hand side to \cs{scan_stop:} before looking +% for the right-hand side. % \begin{macrocode} \__kernel_patch:nnNNpn { \__kernel_chk_var_local:N #1 } { } \cs_new_protected:Npn \bool_set:Nn #1#2 - { \tex_chardef:D #1 = \bool_if_p:n {#2} } + { + \exp_last_unbraced:NNNf + \tex_chardef:D #1 = { \bool_if_p:n {#2} } + } \__kernel_patch:nnNNpn { \__kernel_chk_var_global:N #1 } { } \cs_new_protected:Npn \bool_gset:Nn #1#2 - { \tex_global:D \tex_chardef:D #1 = \bool_if_p:n {#2} } + { + \exp_last_unbraced:NNNNf + \tex_global:D \tex_chardef:D #1 = { \bool_if_p:n {#2} } + } \cs_generate_variant:Nn \bool_set:Nn { c } \cs_generate_variant:Nn \bool_gset:Nn { c } % \end{macrocode} @@ -1004,21 +1013,31 @@ % \end{macrocode} % \end{macro} % -% \begin{macro}[EXP]{\bool_if_p:n} -% First issue a \cs{group_align_safe_begin:} as we are using |&&| as +% \begin{macro}[EXP]{\bool_if_p:n, \@@_if_p:n, \@@_if_p_aux:w} +% To speed up the case of a single predicate, \texttt{f}-expand and +% check whether the result is one token (possibly surrounded by +% spaces), which must be \cs{c_true_bool} or \cs{c_false_bool}. We +% use a version of \cs{tl_if_single:nTF} optimized for speed since we +% know that an empty~|#1| is an error. The auxiliary +% \cs{@@_if_p_aux:w} removes the trailing parenthesis and gets rid of +% any space. For the general case, first issue a +% \cs{group_align_safe_begin:} as we are using |&&| as % syntax shorthand for the And operation and we need to hide it for % \TeX{}. This group is closed after \cs{@@_get_next:NN} returns % \cs{c_true_bool} or \cs{c_false_bool}. That function requires the % trailing parenthesis to know where the expression ends. % \begin{macrocode} -\cs_new:Npn \bool_if_p:n #1 +\cs_new:Npn \bool_if_p:n { \exp_args:Nf \@@_if_p:n } +\cs_new:Npn \@@_if_p:n #1 { + \tl_if_empty:oT { \use_none:nn #1 . } { \@@_if_p_aux:w } \group_align_safe_begin: \exp_after:wN \group_align_safe_end: \exp:w \exp_end_continue_f:w % ( \@@_get_next:NN \use_i:nnnn #1 ) } +\cs_new:Npn \@@_if_p_aux:w #1 \use_i:nnnn #2#3 {#2} % \end{macrocode} % \end{macro} % @@ -1163,13 +1182,21 @@ % is \texttt{false}. If the end is reached without finding any % \texttt{false} expression, then the result is \texttt{true}. % \begin{macrocode} -\prg_new_conditional:Npnn \bool_lazy_all:n #1 { p , T , F , TF } +\cs_new:Npn \bool_lazy_all_p:n #1 { \@@_lazy_all:n #1 \q_recursion_tail \q_recursion_stop } +\prg_new_conditional:Npnn \bool_lazy_all:n #1 { T , F , TF } + { + \if_predicate:w \bool_lazy_all_p:n {#1} + \prg_return_true: + \else: + \prg_return_false: + \fi: + } \cs_new:Npn \@@_lazy_all:n #1 { - \quark_if_recursion_tail_stop_do:nn {#1} { \prg_return_true: } + \quark_if_recursion_tail_stop_do:nn {#1} { \c_true_bool } \bool_if:nF {#1} - { \use_i_delimit_by_q_recursion_stop:nw { \prg_return_false: } } + { \use_i_delimit_by_q_recursion_stop:nw { \c_false_bool } } \@@_lazy_all:n } % \end{macrocode} @@ -1179,12 +1206,18 @@ % \begin{macro}[pTF]{\bool_lazy_and:nn} % \UnitTested % Only evaluate the second expression if the first is \texttt{true}. +% Note that |#2| must be removed as an argument, not just by skipping +% to the \cs{else:} branch of the conditional since |#2| may contain +% unbalanced \TeX{} conditionals. % \begin{macrocode} \prg_new_conditional:Npnn \bool_lazy_and:nn #1#2 { p , T , F , TF } { - \bool_if:nTF {#1} - { \bool_if:nTF {#2} { \prg_return_true: } { \prg_return_false: } } - { \prg_return_false: } + \if_predicate:w + \bool_if:nTF {#1} { \bool_if_p:n {#2} } { \c_false_bool } + \prg_return_true: + \else: + \prg_return_false: + \fi: } % \end{macrocode} % \end{macro} @@ -1196,13 +1229,21 @@ % is \texttt{true}. If the end is reached without finding any % \texttt{true} expression, then the result is \texttt{false}. % \begin{macrocode} -\prg_new_conditional:Npnn \bool_lazy_any:n #1 { p , T , F , TF } +\cs_new:Npn \bool_lazy_any_p:n #1 { \@@_lazy_any:n #1 \q_recursion_tail \q_recursion_stop } +\prg_new_conditional:Npnn \bool_lazy_any:n #1 { T , F , TF } + { + \if_predicate:w \bool_lazy_any_p:n {#1} + \prg_return_true: + \else: + \prg_return_false: + \fi: + } \cs_new:Npn \@@_lazy_any:n #1 { - \quark_if_recursion_tail_stop_do:nn {#1} { \prg_return_false: } + \quark_if_recursion_tail_stop_do:nn {#1} { \c_false_bool } \bool_if:nT {#1} - { \use_i_delimit_by_q_recursion_stop:nw { \prg_return_true: } } + { \use_i_delimit_by_q_recursion_stop:nw { \c_true_bool } } \@@_lazy_any:n } % \end{macrocode} @@ -1215,9 +1256,12 @@ % \begin{macrocode} \prg_new_conditional:Npnn \bool_lazy_or:nn #1#2 { p , T , F , TF } { - \bool_if:nTF {#1} - { \prg_return_true: } - { \bool_if:nTF {#2} { \prg_return_true: } { \prg_return_false: } } + \if_predicate:w + \bool_if:nTF {#1} { \c_true_bool } { \bool_if_p:n {#2} } + \prg_return_true: + \else: + \prg_return_false: + \fi: } % \end{macrocode} % \end{macro} @@ -1233,16 +1277,19 @@ % \end{macrocode} % \end{macro} % -% \begin{macro}{\bool_xor_p:nn} +% \begin{macro}[pTF]{\bool_xor:nn} % \UnitTested % Exclusive or. If the boolean expressions have same truth value, % return \texttt{false}, otherwise return \texttt{true}. % \begin{macrocode} -\cs_new:Npn \bool_xor_p:nn #1#2 +\prg_new_conditional:Npnn \bool_xor:nn #1#2 { p , T , F , TF } { - \int_compare:nNnTF { \bool_if_p:n {#1} } = { \bool_if_p:n {#2} } - \c_false_bool - \c_true_bool + \bool_if:nT {#1} \reverse_if:N + \if_predicate:w \bool_if_p:n {#2} + \prg_return_true: + \else: + \prg_return_false: + \fi: } % \end{macrocode} % \end{macro} @@ -1523,9 +1570,9 @@ % are always brace balanced. % \begin{macrocode} \cs_new:Npn \group_align_safe_begin: - { \if_int_compare:w \if_false: { \fi: `} = \c_zero \fi: } + { \if_int_compare:w \if_false: { \fi: `} = \c_zero_int \fi: } \cs_new:Npn \group_align_safe_end: - { \if_int_compare:w `{ = \c_zero } \fi: } + { \if_int_compare:w `{ = \c_zero_int } \fi: } % \end{macrocode} % \end{macro} % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3prop.dtx b/Master/texmf-dist/source/latex/l3kernel/l3prop.dtx index 0ce5f6b2b20..7ac71b02a67 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3prop.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3prop.dtx @@ -41,7 +41,7 @@ % }^^A % } % -% \date{Released 2018-04-30} +% \date{Released 2018-05-12} % % \maketitle % @@ -335,7 +335,7 @@ % \cs{prop_map_function:NN} \meta{property list} \meta{function} % \end{syntax} % Applies \meta{function} to every \meta{entry} stored in the -% \meta{property list}. The \meta{function} receives two argument for +% \meta{property list}. The \meta{function} receives two arguments for % each iteration: the \meta{key} and associated \meta{value}. % The order in which \meta{entries} are returned is not defined and % should not be relied upon. diff --git a/Master/texmf-dist/source/latex/l3kernel/l3quark.dtx b/Master/texmf-dist/source/latex/l3kernel/l3quark.dtx index b42d4ebc67a..612e1ab8af4 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3quark.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3quark.dtx @@ -41,7 +41,7 @@ % }^^A % } % -% \date{Released 2018-04-30} +% \date{Released 2018-05-12} % % \maketitle % @@ -522,7 +522,7 @@ % \begin{macro}[pTF]{\quark_if_no_value:n} % \UnitTested % \begin{macro}{\@@_if_nil:w, \@@_if_no_value:w} -% \begin{macro}[EXP]{\@@_if_empty_return:o} +% \begin{macro}[EXP]{\@@_if_empty_if:o} % Let us explain |\quark_if_nil:n(TF)|. Expanding \cs{@@_if_nil:w} % once is safe thanks to the trailing \cs{q_nil} |??!|. The result of % expanding once is empty if and only if both delimited arguments |#1| @@ -537,31 +537,35 @@ % final~|?!|, and the test returns \texttt{true} as wanted. In the % second case, the result is not empty since the first~|?!| in the % definition of \cs{quark_if_nil:n} stop~|#3|. The auxiliary here -% is the same as \cs{__tl_if_empty_return:o}, with the same comments +% is the same as \cs{__tl_if_empty_if:o}, with the same comments % applying. % \begin{macrocode} \prg_new_conditional:Npnn \quark_if_nil:n #1 { p, T , F , TF } { - \@@_if_empty_return:o + \@@_if_empty_if:o { \@@_if_nil:w {} #1 {} ? ! \q_nil ? ? ! } + \prg_return_true: + \else: + \prg_return_false: + \fi: } \cs_new:Npn \@@_if_nil:w #1 \q_nil #2 ? #3 ? ! { #1 #2 } \prg_new_conditional:Npnn \quark_if_no_value:n #1 { p, T , F , TF } { - \@@_if_empty_return:o + \@@_if_empty_if:o { \@@_if_no_value:w {} #1 {} ? ! \q_no_value ? ? ! } + \prg_return_true: + \else: + \prg_return_false: + \fi: } \cs_new:Npn \@@_if_no_value:w #1 \q_no_value #2 ? #3 ? ! { #1 #2 } \prg_generate_conditional_variant:Nnn \quark_if_nil:n { V , o } { p , TF , T , F } -\cs_new:Npn \@@_if_empty_return:o #1 +\cs_new:Npn \@@_if_empty_if:o #1 { \exp_after:wN \if_meaning:w \exp_after:wN \q_nil \__kernel_tl_to_str:w \exp_after:wN {#1} \q_nil - \prg_return_true: - \else: - \prg_return_false: - \fi: } % \end{macrocode} % \end{macro} diff --git a/Master/texmf-dist/source/latex/l3kernel/l3regex.dtx b/Master/texmf-dist/source/latex/l3kernel/l3regex.dtx index 0c0434054d7..859763a12fb 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3regex.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3regex.dtx @@ -41,7 +41,7 @@ % }^^A % } % -% \date{Released 2018-04-30} +% \date{Released 2018-05-12} % % \maketitle % @@ -920,7 +920,7 @@ % Access the primitive: performance is key here, so we do not use % the slower route \emph{via} \cs{int_eval:n}. % \begin{macrocode} -\cs_new_eq:NN \@@_int_eval:w \etex_numexpr:D +\cs_new_eq:NN \@@_int_eval:w \tex_numexpr:D % \end{macrocode} % \end{macro} % @@ -1924,6 +1924,28 @@ % % \subsubsection{Generic helpers used when compiling} % +% \begin{macro}{\@@_two_if_eq:NNNNTF} +% Used to compare pairs of things like \cs{@@_compile_special:N} |?| +% together. It's often inconvenient to get the catcodes of the +% character to match so we just compare the character code. +% Besides, the expanding behaviour of \cs{if:w} is very useful as that +% means we can use \cs{c_left_brace_str} and the like. +% \begin{macrocode} +\prg_new_conditional:Npnn \@@_two_if_eq:NNNN #1#2#3#4 { TF } + { + \if_meaning:w #1 #3 + \if:w #2 #4 + \prg_return_true: + \else: + \prg_return_false: + \fi: + \else: + \prg_return_false: + \fi: + } +% \end{macrocode} +% \end{macro} +% % \begin{macro}{\@@_get_digits:NTFw} % \begin{macro}[rEXP]{\@@_get_digits_loop:w} % If followed by some raw digits, collect them one by one in the @@ -2340,7 +2362,7 @@ % \begin{macrocode} \cs_new_protected:Npn \@@_compile_quantifier_lazyness:nnNN #1#2#3#4 { - \str_if_eq:nnTF { #3 #4 } { \@@_compile_special:N ? } + \@@_two_if_eq:NNNNTF #3 #4 \@@_compile_special:N ? { \tl_build_put_right:Nn \l_@@_build_tl { \if_false: { \fi: } { #1 } { #2 } \c_true_bool } @@ -2421,8 +2443,7 @@ } \cs_new_protected:Npn \@@_compile_quantifier_braced_auxii:w #1#2 { - \str_if_eq_x:nnTF - { #1 #2 } { \@@_compile_special:N \c_right_brace_str } + \@@_two_if_eq:NNNNTF #1 #2 \@@_compile_special:N \c_right_brace_str { \exp_args:No \@@_compile_quantifier_lazyness:nnNN { \int_use:N \l_@@_internal_a_int } { -1 } @@ -2435,8 +2456,7 @@ } \cs_new_protected:Npn \@@_compile_quantifier_braced_auxiii:w #1#2 { - \str_if_eq_x:nnTF - { #1 #2 } { \@@_compile_special:N \c_right_brace_str } + \@@_two_if_eq:NNNNTF #1 #2 \@@_compile_special:N \c_right_brace_str { \if_int_compare:w \l_@@_internal_a_int > \l_@@_internal_b_int @@ -2489,7 +2509,7 @@ { \@@_if_in_class:TF { - \str_if_eq:nnTF {#2#3} { \@@_compile_special:N - } + \@@_two_if_eq:NNNNTF #2 #3 \@@_compile_special:N - { \@@_compile_range:Nw #1 } { \@@_compile_one:n @@ -2785,7 +2805,7 @@ \cs_new_protected:Npn \@@_compile_class:TFNN #1#2#3#4 { \l_@@_mode_int = \int_value:w \l_@@_mode_int 3 \exp_stop_f: - \str_if_eq:nnTF { #3 #4 } { \@@_compile_special:N ^ } + \@@_two_if_eq:NNNNTF #3 #4 \@@_compile_special:N ^ { \tl_build_put_right:Nn \l_@@_build_tl { #2 { \if_false: } \fi: } \@@_compile_class:NN @@ -2840,7 +2860,7 @@ } \cs_new_protected:Npn \@@_compile_class_posix:NNNNw #1#2#3#4#5#6 { - \str_if_eq:nnTF { #5 #6 } { \@@_compile_special:N ^ } + \@@_two_if_eq:NNNNTF #5 #6 \@@_compile_special:N ^ { \bool_set_false:N \l_@@_internal_bool \tl_set:Nx \l_@@_internal_a_tl { \if_false: } \fi: @@ -2860,8 +2880,9 @@ } \cs_new_protected:Npn \@@_compile_class_posix_end:w #1#2#3#4 { - \str_if_eq:nnTF { #1 #2 #3 #4 } - { \@@_compile_special:N : \@@_compile_special:N ] } + \@@_two_if_eq:NNNNTF #1 #2 \@@_compile_special:N : + { \@@_two_if_eq:NNNNTF #3 #4 \@@_compile_special:N ] } + { \use_ii:nn } { \cs_if_exist:cTF { @@_posix_ \l_@@_internal_a_tl : } { @@ -2956,7 +2977,7 @@ } \cs_new_protected:Npn \@@_compile_lparen:w #1#2#3#4 { - \str_if_eq:nnTF { #1 #2 } { \@@_compile_special:N ? } + \@@_two_if_eq:NNNNTF #1 #2 \@@_compile_special:N ? { \cs_if_exist_use:cF { @@_compile_special_group_\token_to_str:N #4 :w } @@ -3022,7 +3043,7 @@ % \begin{macrocode} \cs_new_protected:Npn \@@_compile_special_group_i:w #1#2 { - \str_if_eq:nnTF { #1 #2 } { \@@_compile_special:N ) } + \@@_two_if_eq:NNNNTF #1 #2 \@@_compile_special:N ) { \cs_set:Npn \@@_item_equal:n { \@@_item_caseless_equal:n } @@ -3039,8 +3060,9 @@ } \cs_new_protected:cpn { @@_compile_special_group_-:w } #1#2#3#4 { - \str_if_eq:nnTF { #1 #2 #3 #4 } - { \@@_compile_raw:N i \@@_compile_special:N ) } + \@@_two_if_eq:NNNNTF #1 #2 \@@_compile_raw:N i + { \@@_two_if_eq:NNNNTF #3 #4 \@@_compile_special:N ) } + { \use_ii:nn } { \cs_set:Npn \@@_item_equal:n { \@@_item_caseful_equal:n } @@ -3134,7 +3156,7 @@ \c_@@_catcode_in_class_mode_int \fi: \int_zero:N \l_@@_catcodes_int - \str_if_eq:nnTF { #1 #2 } { \@@_compile_special:N ^ } + \@@_two_if_eq:NNNNTF #1 #2 \@@_compile_special:N ^ { \bool_set_false:N \l_@@_catcodes_bool \@@_compile_c_lbrack_loop:NN @@ -3304,8 +3326,7 @@ \@@_if_in_class_or_catcode:TF { \@@_compile_raw_error:N u #1 #2 } { - \str_if_eq_x:nnTF {#1#2} - { \@@_compile_special:N \c_left_brace_str } + \@@_two_if_eq:NNNNTF #1 #2 \@@_compile_special:N \c_left_brace_str { \tl_set:Nx \l_@@_internal_a_tl { \if_false: } \fi: \@@_compile_u_loop:NN @@ -5356,9 +5377,8 @@ % \begin{macrocode} \cs_new_protected:Npn \@@_replacement_g:w #1#2 { - \str_if_eq_x:nnTF - { #1#2 } - { \@@_replacement_normal:n \c_left_brace_str } + \@@_two_if_eq:NNNNTF + #1 #2 \@@_replacement_normal:n \c_left_brace_str { \l_@@_internal_a_int = \@@_replacement_g_digits:NN } { \@@_replacement_error:NNN g #1 #2 } } @@ -5447,9 +5467,8 @@ % \begin{macrocode} \cs_new_protected:Npn \@@_replacement_u:w #1#2 { - \str_if_eq_x:nnTF - { #1#2 } - { \@@_replacement_normal:n \c_left_brace_str } + \@@_two_if_eq:NNNNTF + #1 #2 \@@_replacement_normal:n \c_left_brace_str { \@@_replacement_cu_aux:Nw \exp_not:V } { \@@_replacement_error:NNN u #1#2 } } @@ -5495,11 +5514,7 @@ #2 #3 } { - \str_if_eq:nnTF - { #2#3 } - { - \@@_replacement_normal:n ( % ) - } + \@@_two_if_eq:NNNNTF #2 #3 \@@_replacement_normal:n ( { \seq_push:NV \l_@@_replacement_category_seq \l_@@_replacement_category_tl diff --git a/Master/texmf-dist/source/latex/l3kernel/l3seq.dtx b/Master/texmf-dist/source/latex/l3kernel/l3seq.dtx index 0a8c475fd57..50c909a6d30 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3seq.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3seq.dtx @@ -41,7 +41,7 @@ % }^^A % } % -% \date{Released 2018-04-30} +% \date{Released 2018-05-12} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3skip.dtx b/Master/texmf-dist/source/latex/l3kernel/l3skip.dtx index 4dd819ce073..c3bbead79ac 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3skip.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3skip.dtx @@ -42,7 +42,7 @@ % }^^A % } % -% \date{Released 2018-04-30} +% \date{Released 2018-05-12} % % \maketitle % @@ -1064,7 +1064,7 @@ % Primitives renamed. % \begin{macrocode} \cs_new_eq:NN \if_dim:w \tex_ifdim:D -\cs_new_eq:NN \@@_eval:w \etex_dimexpr:D +\cs_new_eq:NN \@@_eval:w \tex_dimexpr:D \cs_new_eq:NN \@@_eval_end: \tex_relax:D % \end{macrocode} % \end{macro} @@ -1394,7 +1394,7 @@ { #1 \prg_return_false: \else: \prg_return_true: \fi: } \cs_new_protected:Npn \@@_compare_error: { - \if_int_compare:w \c_zero \c_zero \fi: + \if_int_compare:w \c_zero_int \c_zero_int \fi: = \@@_compare_error: } @@ -1871,7 +1871,7 @@ \__kernel_patch_args:nnnNNpn { #1 ##1 } { } - { {##1} { \__kernel_chk_expr:nNnN {##2} \etex_glueexpr:D { } #3 } } + { {##1} { \__kernel_chk_expr:nNnN {##2} \tex_glueexpr:D { } #3 } } #2 #3 } % \end{macrocode} @@ -1882,10 +1882,10 @@ % \begin{macrocode} \@@_tmp:w \__kernel_chk_var_local:N \cs_new_protected:Npn \skip_set:Nn #1#2 - { #1 ~ \etex_glueexpr:D #2 \scan_stop: } + { #1 ~ \tex_glueexpr:D #2 \scan_stop: } \@@_tmp:w \__kernel_chk_var_global:N \cs_new_protected:Npn \skip_gset:Nn #1#2 - { \tex_global:D #1 ~ \etex_glueexpr:D #2 \scan_stop: } + { \tex_global:D #1 ~ \tex_glueexpr:D #2 \scan_stop: } \cs_generate_variant:Nn \skip_set:Nn { c } \cs_generate_variant:Nn \skip_gset:Nn { c } % \end{macrocode} @@ -1914,18 +1914,18 @@ % \begin{macrocode} \@@_tmp:w \__kernel_chk_var_local:N \cs_new_protected:Npn \skip_add:Nn #1#2 - { \tex_advance:D #1 by \etex_glueexpr:D #2 \scan_stop: } + { \tex_advance:D #1 by \tex_glueexpr:D #2 \scan_stop: } \@@_tmp:w \__kernel_chk_var_global:N \cs_new_protected:Npn \skip_gadd:Nn #1#2 - { \tex_global:D \tex_advance:D #1 by \etex_glueexpr:D #2 \scan_stop: } + { \tex_global:D \tex_advance:D #1 by \tex_glueexpr:D #2 \scan_stop: } \cs_generate_variant:Nn \skip_add:Nn { c } \cs_generate_variant:Nn \skip_gadd:Nn { c } \@@_tmp:w \__kernel_chk_var_local:N \cs_new_protected:Npn \skip_sub:Nn #1#2 - { \tex_advance:D #1 by - \etex_glueexpr:D #2 \scan_stop: } + { \tex_advance:D #1 by - \tex_glueexpr:D #2 \scan_stop: } \@@_tmp:w \__kernel_chk_var_global:N \cs_new_protected:Npn \skip_gsub:Nn #1#2 - { \tex_global:D \tex_advance:D #1 by - \etex_glueexpr:D #2 \scan_stop: } + { \tex_global:D \tex_advance:D #1 by - \tex_glueexpr:D #2 \scan_stop: } \cs_generate_variant:Nn \skip_sub:Nn { c } \cs_generate_variant:Nn \skip_gsub:Nn { c } % \end{macrocode} @@ -1965,13 +1965,13 @@ { { \__kernel_chk_expr:nNnN - {##1} \etex_glueexpr:D { } \skip_if_finite:n + {##1} \tex_glueexpr:D { } \skip_if_finite:n } } \prg_new_conditional:Npnn \skip_if_finite:n ##1 { p , T , F , TF } { \exp_after:wN \@@_if_finite:wwNw - \skip_use:N \etex_glueexpr:D ##1 ; \prg_return_false: + \skip_use:N \tex_glueexpr:D ##1 ; \prg_return_false: #1 ; \prg_return_true: \q_stop } \cs_new:Npn \@@_if_finite:wwNw ##1 #1 ##2 ; ##3 ##4 \q_stop {##3} @@ -1987,9 +1987,9 @@ % Evaluating a skip expression expandably. % \begin{macrocode} \__kernel_patch_args:nNNpn - { { \__kernel_chk_expr:nNnN {#1} \etex_glueexpr:D { } \skip_eval:n } } + { { \__kernel_chk_expr:nNnN {#1} \tex_glueexpr:D { } \skip_eval:n } } \cs_new:Npn \skip_eval:n #1 - { \skip_use:N \etex_glueexpr:D #1 \scan_stop: } + { \skip_use:N \tex_glueexpr:D #1 \scan_stop: } % \end{macrocode} % \end{macro} % @@ -2012,22 +2012,22 @@ \__kernel_patch_args:nNNpn { { - \__kernel_chk_expr:nNnN {#1} \etex_glueexpr:D { } + \__kernel_chk_expr:nNnN {#1} \tex_glueexpr:D { } \skip_horizontal:n } } \cs_new:Npn \skip_horizontal:n #1 - { \skip_horizontal:N \etex_glueexpr:D #1 \scan_stop: } + { \skip_horizontal:N \tex_glueexpr:D #1 \scan_stop: } \cs_new_eq:NN \skip_vertical:N \tex_vskip:D \__kernel_patch_args:nNNpn { { - \__kernel_chk_expr:nNnN {#1} \etex_glueexpr:D { } + \__kernel_chk_expr:nNnN {#1} \tex_glueexpr:D { } \skip_vertical:n } } \cs_new:Npn \skip_vertical:n #1 - { \skip_vertical:N \etex_glueexpr:D #1 \scan_stop: } + { \skip_vertical:N \tex_glueexpr:D #1 \scan_stop: } \cs_generate_variant:Nn \skip_horizontal:N { c } \cs_generate_variant:Nn \skip_vertical:N { c } % \end{macrocode} @@ -2173,7 +2173,7 @@ {##1} { \__kernel_chk_expr:nNnN {##2} - \etex_muexpr:D { \etex_mutoglue:D } #3 + \tex_muexpr:D { \tex_mutoglue:D } #3 } } #2 #3 @@ -2186,10 +2186,10 @@ % \begin{macrocode} \@@_tmp:w \__kernel_chk_var_local:N \cs_new_protected:Npn \muskip_set:Nn #1#2 - { #1 ~ \etex_muexpr:D #2 \scan_stop: } + { #1 ~ \tex_muexpr:D #2 \scan_stop: } \@@_tmp:w \__kernel_chk_var_global:N \cs_new_protected:Npn \muskip_gset:Nn #1#2 - { \tex_global:D #1 ~ \etex_muexpr:D #2 \scan_stop: } + { \tex_global:D #1 ~ \tex_muexpr:D #2 \scan_stop: } \cs_generate_variant:Nn \muskip_set:Nn { c } \cs_generate_variant:Nn \muskip_gset:Nn { c } % \end{macrocode} @@ -2226,18 +2226,18 @@ % \begin{macrocode} \@@_tmp:w \__kernel_chk_var_local:N \cs_new_protected:Npn \muskip_add:Nn #1#2 - { \tex_advance:D #1 by \etex_muexpr:D #2 \scan_stop: } + { \tex_advance:D #1 by \tex_muexpr:D #2 \scan_stop: } \@@_tmp:w \__kernel_chk_var_global:N \cs_new_protected:Npn \muskip_gadd:Nn #1#2 - { \tex_global:D \tex_advance:D #1 by \etex_muexpr:D #2 \scan_stop: } + { \tex_global:D \tex_advance:D #1 by \tex_muexpr:D #2 \scan_stop: } \cs_generate_variant:Nn \muskip_add:Nn { c } \cs_generate_variant:Nn \muskip_gadd:Nn { c } \@@_tmp:w \__kernel_chk_var_local:N \cs_new_protected:Npn \muskip_sub:Nn #1#2 - { \tex_advance:D #1 by - \etex_muexpr:D #2 \scan_stop: } + { \tex_advance:D #1 by - \tex_muexpr:D #2 \scan_stop: } \@@_tmp:w \__kernel_chk_var_global:N \cs_new_protected:Npn \muskip_gsub:Nn #1#2 - { \tex_global:D \tex_advance:D #1 by - \etex_muexpr:D #2 \scan_stop: } + { \tex_global:D \tex_advance:D #1 by - \tex_muexpr:D #2 \scan_stop: } \cs_generate_variant:Nn \muskip_sub:Nn { c } \cs_generate_variant:Nn \muskip_gsub:Nn { c } % \end{macrocode} @@ -2254,12 +2254,12 @@ \__kernel_patch_args:nNNpn { { - \__kernel_chk_expr:nNnN {#1} \etex_muexpr:D - { \etex_mutoglue:D } \muskip_eval:n + \__kernel_chk_expr:nNnN {#1} \tex_muexpr:D + { \tex_mutoglue:D } \muskip_eval:n } } \cs_new:Npn \muskip_eval:n #1 - { \muskip_use:N \etex_muexpr:D #1 \scan_stop: } + { \muskip_use:N \tex_muexpr:D #1 \scan_stop: } % \end{macrocode} % \end{macro} % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3sort.dtx b/Master/texmf-dist/source/latex/l3kernel/l3sort.dtx index 45982d61328..9afcc51901d 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3sort.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3sort.dtx @@ -41,7 +41,7 @@ % }^^A % } % -% \date{Released 2018-04-30} +% \date{Released 2018-05-12} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3str.dtx b/Master/texmf-dist/source/latex/l3kernel/l3str.dtx index 4cf93f4d10b..94bafe7e20e 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3str.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3str.dtx @@ -41,7 +41,7 @@ % }^^A % } % -% \date{Released 2018-04-30} +% \date{Released 2018-05-12} % % \maketitle % @@ -1040,14 +1040,14 @@ % The need to detokenize and force % expansion of input arises from the case where a |#| token is used in the % input, \emph{e.g.}~|\__str_if_eq_x:nn {#} { \tl_to_str:n {#} }|, which -% otherwise would fail as \cs{luatex_luaescapestring:D} does not double +% otherwise would fail as \cs{tex_luaescapestring:D} does not double % such tokens. % \begin{macrocode} -\cs_new:Npn \@@_if_eq_x:nn #1#2 { \pdftex_strcmp:D {#1} {#2} } -\cs_if_exist:NT \luatex_luatexversion:D +\cs_new:Npn \@@_if_eq_x:nn #1#2 { \tex_strcmp:D {#1} {#2} } +\cs_if_exist:NT \tex_luatexversion:D { - \cs_set_eq:NN \lua_escape_x:n \luatex_luaescapestring:D - \cs_set_eq:NN \lua_now_x:n \luatex_directlua:D + \cs_set_eq:NN \lua_escape_x:n \tex_luaescapestring:D + \cs_set_eq:NN \lua_now_x:n \tex_directlua:D \cs_set:Npn \@@_if_eq_x:nn #1#2 { \lua_now_x:n diff --git a/Master/texmf-dist/source/latex/l3kernel/l3sys.dtx b/Master/texmf-dist/source/latex/l3kernel/l3sys.dtx index 21a8aed75c5..d40ff5ea8d1 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3sys.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3sys.dtx @@ -41,7 +41,7 @@ % }^^A % } % -% \date{Released 2018-04-30} +% \date{Released 2018-05-12} % % \maketitle % @@ -222,17 +222,17 @@ % \begin{macrocode} \str_const:Nx \c_sys_engine_str { - \cs_if_exist:NT \luatex_luatexversion:D { luatex } - \cs_if_exist:NT \pdftex_pdftexversion:D { pdftex } - \cs_if_exist:NT \ptex_kanjiskip:D + \cs_if_exist:NT \tex_luatexversion:D { luatex } + \cs_if_exist:NT \tex_pdftexversion:D { pdftex } + \cs_if_exist:NT \tex_kanjiskip:D { \bool_lazy_and:nnTF - { \cs_if_exist_p:N \uptex_disablecjktoken:D } - { \int_compare_p:nNn { \ptex_jis:D "2121 } = { "3000 } } + { \cs_if_exist_p:N \tex_disablecjktoken:D } + { \int_compare_p:nNn { \tex_jis:D "2121 } = { "3000 } } { uptex } { ptex } } - \cs_if_exist:NT \xetex_XeTeXversion:D { xetex } + \cs_if_exist:NT \tex_XeTeXversion:D { xetex } } \tl_map_inline:nn { { luatex } { pdftex } { ptex } { uptex } { xetex } } { @@ -256,7 +256,7 @@ \str_const:Nx \c_sys_output_str { \int_compare:nNnTF - { \cs_if_exist_use:NF \pdftex_pdfoutput:D { 0 } } > { 0 } + { \cs_if_exist_use:NF \tex_pdfoutput:D { 0 } } > { 0 } { pdf } { dvi } } @@ -268,6 +268,19 @@ % \end{variable} % \end{macro} % +% \subsection{Randomness} +% +% This candidate function is placed there because +% \cs{sys_if_rand_exist:TF} is used in \pkg{l3fp-rand}. +% +% \begin{macro}[EXP, pTF]{\sys_if_rand_exist:} +% Currently, randomness exists under \pdfTeX{}, \LuaTeX{}, \pTeX{} and \upTeX{}. +% \begin{macrocode} +\@@_const:nn { sys_if_rand_exist } + { \cs_if_exist_p:N \tex_uniformdeviate:D } +% \end{macrocode} +% \end{macro} +% % \begin{macrocode} %</initex|package> % \end{macrocode} diff --git a/Master/texmf-dist/source/latex/l3kernel/l3tl-analysis.dtx b/Master/texmf-dist/source/latex/l3kernel/l3tl-analysis.dtx index 435a77498f7..df13705a842 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3tl-analysis.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3tl-analysis.dtx @@ -42,7 +42,7 @@ % }^^A % } % -% \date{Released 2018-04-30} +% \date{Released 2018-05-12} % % \maketitle % @@ -853,13 +853,13 @@ \exp_after:wN \prg_break: \fi: \tex_the:D \tex_toks:D #1 \s_@@ - \if_case:w \etex_gluestretch:D \tex_skip:D #1 \exp_stop_f: + \if_case:w \tex_gluestretch:D \tex_skip:D #1 \exp_stop_f: \token_to_str:N A \or: 1 \or: 1 \else: 2 \fi: - \if_int_odd:w \etex_gluestretch:D \tex_skip:D #1 \exp_stop_f: + \if_int_odd:w \tex_gluestretch:D \tex_skip:D #1 \exp_stop_f: \exp_after:wN \@@_analysis_b_special_char:wN \int_value:w \else: \exp_after:wN \@@_analysis_b_special_space:w \int_value:w diff --git a/Master/texmf-dist/source/latex/l3kernel/l3tl.dtx b/Master/texmf-dist/source/latex/l3kernel/l3tl.dtx index 61505a3337c..40fb555658c 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3tl.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3tl.dtx @@ -41,7 +41,7 @@ % }^^A % } % -% \date{Released 2018-04-30} +% \date{Released 2018-05-12} % % \maketitle % @@ -1489,7 +1489,7 @@ } { \group_begin: - \exp_args:No \etex_everyeof:D + \exp_args:No \tex_everyeof:D { \c_@@_rescan_marker_tl \exp_not:N } \int_compare:nNnT \tex_endlinechar:D = { 32 } { \int_set:Nn \tex_endlinechar:D { -1 } } @@ -1507,7 +1507,7 @@ { \exp_after:wN \@@_rescan:w \exp_after:wN \prg_do_nothing: - \etex_scantokens:D {#1} + \tex_scantokens:D {#1} } } \exp_args:Nno \use:nn @@ -1625,7 +1625,7 @@ \exp_not:n { \cs_set:Npn \@@_rescan:w ##1 } \exp_after:wN \@@_rescan:w \exp_after:wN \prg_do_nothing: - \etex_scantokens:D {#1} + \tex_scantokens:D {#1} } \c_@@_rescan_marker_tl } @@ -1640,7 +1640,7 @@ = { 10 } { ~ } \exp_after:wN \@@_rescan:w \exp_after:wN \prg_do_nothing: - \etex_scantokens:D { #2 #1 } + \tex_scantokens:D { #2 #1 } } } \group_end: @@ -1896,12 +1896,18 @@ % \TeX{} skips spaces when reading a non-delimited arguments. Thus, % a \meta{token list} is blank if and only if \cs{use_none:n} % \meta{token list} |?| is empty after one expansion. The auxiliary -% \cs{@@_if_empty_return:o} is a fast emptyness test, converting its +% \cs{@@_if_empty_if:o} is a fast emptyness test, converting its % argument to a string (after one expansion) and using the test % \cs{if_meaning:w} \cs{q_nil} |...| \cs{q_nil}. % \begin{macrocode} \prg_new_conditional:Npnn \tl_if_blank:n #1 { p , T , F , TF } - { \@@_if_empty_return:o { \use_none:n #1 ? } } + { + \@@_if_empty_if:o { \use_none:n #1 ? } + \prg_return_true: + \else: + \prg_return_false: + \fi: + } \prg_generate_conditional_variant:Nnn \tl_if_blank:n { V , o } { p , T , F , TF } % \end{macrocode} @@ -1954,26 +1960,31 @@ % \end{macro} % % \begin{macro}[pTF,documented-as=\tl_if_empty:nTF]{\tl_if_empty:o} -% \begin{macro}[EXP]{\@@_if_empty_return:o} -% The auxiliary function \cs{@@_if_empty_return:o} is for use +% \begin{macro}[EXP]{\@@_if_empty_if:o} +% The auxiliary function \cs{@@_if_empty_if:o} is for use % in various token list conditionals which reduce to testing % if a given token list is empty after applying a simple function % to it. % The test for emptiness is based on \cs{tl_if_empty:nTF}, but % the expansion is hard-coded for efficiency, as this auxiliary -% function is used in many places. +% function is used in several places. +% We don't put \cs{prg_return_true:} and so on in the definition of +% the auxiliary, because that would prevent an optimization applied to +% conditionals that end with this code. % \begin{macrocode} -\cs_new:Npn \@@_if_empty_return:o #1 +\cs_new:Npn \@@_if_empty_if:o #1 { \exp_after:wN \if_meaning:w \exp_after:wN \q_nil \__kernel_tl_to_str:w \exp_after:wN {#1} \q_nil + } +\prg_new_conditional:Npnn \tl_if_empty:o #1 { p , TF , T , F } + { + \@@_if_empty_if:o {#1} \prg_return_true: \else: \prg_return_false: \fi: - } -\prg_new_conditional:Npnn \tl_if_empty:o #1 { p , TF , T , F } - { \@@_if_empty_return:o {#1} } + } % \end{macrocode} % \end{macro} % \end{macro} @@ -2004,13 +2015,13 @@ \group_begin: \tl_set:Nn \l_@@_internal_a_tl {#1} \tl_set:Nn \l_@@_internal_b_tl {#2} - \if_meaning:w \l_@@_internal_a_tl \l_@@_internal_b_tl - \group_end: - \prg_return_true: - \else: - \group_end: - \prg_return_false: - \fi: + \exp_after:wN + \group_end: + \if_meaning:w \l_@@_internal_a_tl \l_@@_internal_b_tl + \prg_return_true: + \else: + \prg_return_false: + \fi: } \tl_new:N \l_@@_internal_a_tl \tl_new:N \l_@@_internal_b_tl @@ -2982,7 +2993,7 @@ % % The token list \cs{l_@@_internal_a_tl} containing the result % of all these manipulations is displayed to the terminal using -% \cs{etex_showtokens:D} and an odd \cs{exp_after:wN} which expand the +% \cs{tex_showtokens:D} and an odd \cs{exp_after:wN} which expand the % closing brace to improve the output slightly. The calls to % \cs{__kernel_iow_with:Nnn} ensure that the \tn{newlinechar} is set to~$10$ % so that the \cs{iow_newline:} inserted by the line-wrapping code @@ -2998,7 +3009,7 @@ { \__kernel_iow_with:Nnn \tex_errorcontextlines:D { -1 } { - \etex_showtokens:D \exp_after:wN \exp_after:wN \exp_after:wN + \tex_showtokens:D \exp_after:wN \exp_after:wN \exp_after:wN { \exp_after:wN \l_@@_internal_a_tl } } } diff --git a/Master/texmf-dist/source/latex/l3kernel/l3token.dtx b/Master/texmf-dist/source/latex/l3kernel/l3token.dtx index cc091b65559..1b2213a24bd 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3token.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3token.dtx @@ -41,7 +41,7 @@ % }^^A % } % -% \date{Released 2018-04-30} +% \date{Released 2018-05-12} % % \maketitle % @@ -141,12 +141,8 @@ % \item $12$ (other) % \item $13$ (active) (not \XeTeX{}) % \end{itemize} -% and other values raise an error. -% -% The \meta{charcode} may be any one valid for the engine in use. Note -% however that for \XeTeX{} releases prior to 0.99992 only the 8-bit -% range ($0$ to $255$) is accepted due to engine limitations. Note also -% that \XeTeX{} cannot currently generate active character tokens. +% and other values raise an error. The \meta{charcode} may be any one valid +% for the engine in use. % \end{function} % % \begin{variable}[added = 2011-09-05]{\c_catcode_other_space_tl} @@ -1416,7 +1412,7 @@ \tl_new:N \l_@@_tmp_tl % \end{macrocode} % Engine-dependent definitions are now needed for the implementation. For -% \LuaTeX{} and recent \XeTeX{} releases there is engine-level support. +% \LuaTeX{} and \XeTeX{} there is engine-level support. % They can do cases that macro emulation can't. All of those are filtered % out here using a primitive-based boolean expression for speed. % The final level is the basic definition at the engine level: the arguments @@ -1448,7 +1444,7 @@ { #3 \exp_after:wN \exp_end: - \utex_charcat:D #1 \exp_stop_f: #2 \exp_stop_f: + \tex_Ucharcat:D #1 \exp_stop_f: #2 \exp_stop_f: } \cs_new_eq:NN \@@_generate_auxii:nnw \@@_generate_aux:nnw \cs_gset:Npn \@@_generate_aux:nnw #1#2#3 \exp_end: diff --git a/Master/texmf-dist/source/latex/l3kernel/l3unicode.dtx b/Master/texmf-dist/source/latex/l3kernel/l3unicode.dtx index 3006d953d6d..0e6dcc47b9e 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3unicode.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3unicode.dtx @@ -41,7 +41,7 @@ % }^^A % } % -% \date{Released 2018-04-30} +% \date{Released 2018-05-12} % % \maketitle % @@ -82,7 +82,7 @@ % \end{macrocode} % Set up a private copy of the char-generation primitive. % \begin{macrocode} - \cs_set_eq:NN \@@_generate:w \utex_char:D + \cs_set_eq:NN \@@_generate:w \tex_Uchar:D % \end{macrocode} % Parse the main Unicode data file for title case exceptions (the one-to-one % lower and upper case mappings it contains are all be covered by the \TeX{} @@ -102,7 +102,10 @@ { \tl_const:cx { c_@@_mixed_case_ \@@_generate:w "#1 _tl } - { \@@_generate:w "#7 } + { + \char_generate:nn { "#7 } + { \char_value_catcode:n { "#7 } } + } } } } @@ -130,7 +133,10 @@ { \tl_const:cx { c_@@_fold_case_ \@@_generate:w "#1 _tl } - { \@@_generate:w "#3 } + { + \char_generate:nn { "#3 } + { \char_value_catcode:n { "#3 } } + } } } { @@ -142,10 +148,15 @@ { \tl_const:cx { c_@@_fold_case_ \@@_generate:w "#1 _tl } { - \@@_generate:w "#2 \exp_stop_f: - \@@_generate:w "#3 \exp_stop_f: + \char_generate:nn { "#2 } + { \char_value_catcode:n { "#2 } } + \char_generate:nn { "#3 } + { \char_value_catcode:n { "#3 } } \tl_if_blank:nF {#4} - { \@@_generate:w "#4 } + { + \char_generate:nn { "#4 } + { \char_value_catcode:n { "#4 } } + } } } \ior_str_map_inline:Nn \g_@@_data_ior @@ -178,10 +189,15 @@ { \tl_const:cx { c_@@_ #2 _case_ \@@_generate:w "#1 _tl } { - \@@_generate:w "#3 \exp_stop_f: - \@@_generate:w "#4 \exp_stop_f: + \char_generate:nn { "#3 } + { \char_value_catcode:n { "#3 } } + \char_generate:nn { "#4 } + { \char_value_catcode:n { "#4 } } \tl_if_blank:nF {#5} - { \@@_generate:w "#5 } + { + \char_generate:nn { "#5 } + { \char_value_catcode:n { "#5 } } + } } } } diff --git a/Master/texmf-dist/source/latex/l3packages/l3keys2e/l3keys2e.dtx b/Master/texmf-dist/source/latex/l3packages/l3keys2e/l3keys2e.dtx index c4cda370057..44922adcf8b 100644 --- a/Master/texmf-dist/source/latex/l3packages/l3keys2e/l3keys2e.dtx +++ b/Master/texmf-dist/source/latex/l3packages/l3keys2e/l3keys2e.dtx @@ -60,7 +60,7 @@ % }^^A % } % -% \date{Released 2018-04-30} +% \date{Released 2018-05-12} % % \maketitle % @@ -131,7 +131,7 @@ % \end{macrocode} % % \begin{macrocode} -\ProvidesExplPackage{l3keys2e}{2018-04-30}{} +\ProvidesExplPackage{l3keys2e}{2018-05-12}{} {LaTeX2e option processing using LaTeX3 keys} % \end{macrocode} % diff --git a/Master/texmf-dist/source/latex/l3packages/xfp/xfp.dtx b/Master/texmf-dist/source/latex/l3packages/xfp/xfp.dtx index 7007c9a3ab6..40c7b12e1e8 100644 --- a/Master/texmf-dist/source/latex/l3packages/xfp/xfp.dtx +++ b/Master/texmf-dist/source/latex/l3packages/xfp/xfp.dtx @@ -62,7 +62,7 @@ % }^^A % } % -% \date{Released 2018-04-30} +% \date{Released 2018-05-12} % % \maketitle % @@ -161,7 +161,7 @@ % \end{macrocode} % % \begin{macrocode} -\ProvidesExplPackage{xfp}{2018-04-30}{} +\ProvidesExplPackage{xfp}{2018-05-12}{} {L3 Floating point unit} % \end{macrocode} % diff --git a/Master/texmf-dist/source/latex/l3packages/xfrac/xfrac.dtx b/Master/texmf-dist/source/latex/l3packages/xfrac/xfrac.dtx index cc811e56983..a9b279ce9ff 100644 --- a/Master/texmf-dist/source/latex/l3packages/xfrac/xfrac.dtx +++ b/Master/texmf-dist/source/latex/l3packages/xfrac/xfrac.dtx @@ -63,7 +63,7 @@ % }^^A % } % -% \date{Released 2018-04-30} +% \date{Released 2018-05-12} % % \maketitle % @@ -533,7 +533,7 @@ % \end{macrocode} % % \begin{macrocode} -\ProvidesExplPackage{xfrac}{2018-04-30}{} +\ProvidesExplPackage{xfrac}{2018-05-12}{} {L3 Experimental split-level fractions} % \end{macrocode} % diff --git a/Master/texmf-dist/source/latex/l3packages/xparse/xparse.dtx b/Master/texmf-dist/source/latex/l3packages/xparse/xparse.dtx index c7ec377316e..c96ba68e0a6 100644 --- a/Master/texmf-dist/source/latex/l3packages/xparse/xparse.dtx +++ b/Master/texmf-dist/source/latex/l3packages/xparse/xparse.dtx @@ -67,7 +67,7 @@ % }^^A % } % -% \date{Released 2018-04-30} +% \date{Released 2018-05-12} % % \maketitle % @@ -818,7 +818,7 @@ % \end{macrocode} % % \begin{macrocode} -\ProvidesExplPackage{xparse}{2018-04-30}{} +\ProvidesExplPackage{xparse}{2018-05-12}{} {L3 Experimental document command parser} % \end{macrocode} % diff --git a/Master/texmf-dist/source/latex/l3packages/xtemplate/xtemplate.dtx b/Master/texmf-dist/source/latex/l3packages/xtemplate/xtemplate.dtx index 0a951ea3ee8..0f617e59c4d 100644 --- a/Master/texmf-dist/source/latex/l3packages/xtemplate/xtemplate.dtx +++ b/Master/texmf-dist/source/latex/l3packages/xtemplate/xtemplate.dtx @@ -63,7 +63,7 @@ % }^^A % } % -% \date{Released 2018-04-30} +% \date{Released 2018-05-12} % % \maketitle % @@ -682,7 +682,7 @@ % \end{macrocode} % % \begin{macrocode} -\ProvidesExplPackage{xtemplate}{2018-04-30}{} +\ProvidesExplPackage{xtemplate}{2018-05-12}{} {L3 Experimental prototype document functions} % \end{macrocode} % |