diff options
Diffstat (limited to 'Master/texmf-dist/source/latex/l3kernel/l3candidates.dtx')
-rw-r--r-- | Master/texmf-dist/source/latex/l3kernel/l3candidates.dtx | 916 |
1 files changed, 9 insertions, 907 deletions
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3candidates.dtx b/Master/texmf-dist/source/latex/l3kernel/l3candidates.dtx index 96dbdc5c789..d726722ad17 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3candidates.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3candidates.dtx @@ -44,7 +44,7 @@ % }^^A % } % -% \date{Released 2019-09-19} +% \date{Released 2019-09-28} % % \maketitle % @@ -123,22 +123,6 @@ % See for instance \pkg{l3coffins}. % \end{function} % -% \begin{function}[added = 2017-07-04]{\mode_leave_vertical:} -% \begin{syntax} -% \cs{mode_leave_vertical:} -% \end{syntax} -% Ensures that \TeX{} is not in vertical (inter-paragraph) mode. In -% horizontal or math mode this command has no effect, in vertical mode it -% switches to horizontal mode, and inserts a box of width -% \tn{parindent}, followed by the \tn{everypar} token list. -% \begin{texnote} -% This results in the contents of the \tn{everypar} token register being -% inserted, after \cs{mode_leave_vertical:} is complete. Notice that in -% contrast to the \LaTeXe{} \tn{leavevmode} approach, no box is used -% by the method implemented here. -% \end{texnote} -% \end{function} -% % \section{Additions to \pkg{l3box}} % % \subsection{Viewing part of a box} @@ -221,31 +205,6 @@ % % \section{Additions to \pkg{l3fp}} % -% \begin{function}[EXP, added = 2018-11-03]{logb} -% \begin{syntax} -% \cs{fp_eval:n} \{ |logb(| \meta{fpexpr} |)| \} -% \end{syntax} -% Determines the exponent of the \meta{fpexpr}, namely the floor of -% the base-$10$ logarithm of its absolute value. \enquote{Division by -% zero} occurs when evaluating $\operatorname{logb}(\pm 0) = -\infty$. -% Other special values are $\operatorname{logb}(\pm\infty)=+\infty$ -% and $\operatorname{logb}(\nan{})=\nan{}$. If the operand is a tuple -% or is \nan{}, then \enquote{invalid operation} occurs and the result -% is \nan{}. -% \end{function} -% -% \begin{function}[EXP, added = 2018-11-03]{\fp_sign:n} -% \begin{syntax} -% \cs{fp_sign:n} \Arg{fpexpr} -% \end{syntax} -% Evaluates the \meta{fpexpr} and leaves its sign in the input stream -% using \cs{fp_eval:n} |{sign(|\meta{result}|)}|: $+1$ for positive -% numbers and for $+\infty$, $-1$ for negative numbers and for -% $-\infty$, $\pm 0$ for $\pm 0$. If the operand is a tuple or is -% \nan{}, then \enquote{invalid operation} occurs and the result -% is~$0$. -% \end{function} -% % \begin{function}[pTF, added = 2019-08-25]{\fp_if_nan:n} % \begin{syntax} % \cs{fp_if_nan:n} \Arg{fpexpr} @@ -255,112 +214,8 @@ % a tuple containing \nan{}. % \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 = 2019-05-13, TF]{\file_compare_timestamp:nNn} -% \begin{syntax} -% \cs{file_compare_timestamp:nNn} \Arg{file-1} \meta{comparator} \Arg{file-2} \Arg{true code} \Arg{false code} -% \end{syntax} -% Compares the file stamps on the two \meta{files} as indicated by -% the \meta{comparator}, and inserts either the \meta{true code} -% or \meta{false case} as required. A file which is not found -% is treated as older than any file which is found.This allows for -% example the construct -% \begin{verbatim} -% \file_compare_timestamp:nNnT { source-file } > { derived-file } -% { -% % Code to regenerate derived file -% } -% \end{verbatim} -% to work when the derived file is entirely absent. The timestamp -% of two absent files is regarded as different. -% \end{function} -% -% \begin{function}[added = 2019-01-13]{\ior_map_variable:NNn} -% \begin{syntax} -% \cs{ior_map_variable:NNn} \meta{stream} \meta{tl~var} \Arg{code} -% \end{syntax} -% For each set of \meta{lines} obtained by calling \cs{ior_get:NN} -% until reaching the end of the file, stores the \meta{lines} in the -% \meta{tl~var} then applies the \meta{code}. The \meta{code} will -% usually make use of the \meta{variable}, but this is not enforced. -% The assignments to the \meta{variable} are local. -% Its value after the loop is the last set of \meta{lines}, or its -% original value if the \meta{stream} is empty. \TeX{} ignores -% any trailing new-line marker from the file it reads. -% This function is typically faster than \cs{ior_map_inline:Nn}. -% \end{function} -% -% \begin{function}[added = 2019-01-13]{\ior_str_map_variable:NNn} -% \begin{syntax} -% \cs{ior_str_map_variable:NNn} \meta{stream} \meta{variable} \Arg{code} -% \end{syntax} -% For each \meta{line} in the \meta{stream}, stores the \meta{line} in -% the \meta{variable} then applies the \meta{code}. The material is -% read from the \meta{stream} as a series of tokens with category code -% $12$ (other), with the exception of space characters which are given -% category code $10$ (space). The \meta{code} will usually make use -% of the \meta{variable}, but this is not enforced. The assignments -% to the \meta{variable} are local. Its value after the loop is the -% last \meta{line}, or its original value if the \meta{stream} is -% empty. Note that \TeX{} removes trailing -% space and tab characters (character codes 32 and 9) from every line -% upon input. \TeX{} also ignores any trailing new-line marker from -% the file it reads. -% This function is typically faster than \cs{ior_str_map_inline:Nn}. -% \end{function} -% % \begin{function}[added = 2018-12-29]{\iow_allow_break:} % \begin{syntax} % \cs{iow_allow_break:} @@ -402,7 +257,7 @@ % If piped system calls are disabled an error is raised. % % For details of handling of the \meta{shell command}, see -% \cs{sys_shell_get:nnN(TF)}. +% \cs{sys_get_shell:nnN(TF)}. % \end{function} % % \section{Additions to \pkg{l3flag}} @@ -415,19 +270,13 @@ % locally. % \end{function} % -% \section{Additions to \pkg{l3int}} -% -% \begin{function}[EXP, added = 2018-11-03]{\int_sign:n} -% \begin{syntax} -% \cs{int_sign:n} \Arg{intexpr} -% \end{syntax} -% Evaluates the \meta{integer expression} then leaves $1$ or $0$ or -% $-1$ in the input stream according to the sign of the result. -% \end{function} -% % \section{Additions to \pkg{l3intarray}} % -% \begin{function}[added = 2018-05-05]{\intarray_gset_rand:Nnn, \intarray_gset_rand:Nn} +% \begin{function}[added = 2018-05-05] +% { +% \intarray_gset_rand:Nnn, \intarray_gset_rand:cnn, +% \intarray_gset_rand:Nn, \intarray_gset_rand:cn +% } % \begin{syntax} % \cs{intarray_gset_rand:Nnn} \meta{intarray~var} \Arg{minimum} \Arg{maximum} % \cs{intarray_gset_rand:Nn} \meta{intarray~var} \Arg{maximum} @@ -446,16 +295,6 @@ % % \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} @@ -466,15 +305,6 @@ % 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 @@ -566,15 +396,6 @@ % % \section{Additions to \pkg{l3prg}} % -% \begin{function}[added = 2017-11-28]{\bool_const:Nn, \bool_const:cn} -% \begin{syntax} -% \cs{bool_const:Nn} \meta{boolean} \Arg{boolexpr} -% \end{syntax} -% Creates a new constant \meta{boolean} or raises an error if the name -% is already taken. The value of the \meta{boolean} is set globally to -% the result of evaluating the \meta{boolexpr}. -% \end{function} -% % \begin{function}[added = 2018-05-10] % { % \bool_set_inverse:N , \bool_set_inverse:c , @@ -606,37 +427,6 @@ % \end{texnote} % \end{function} % -% \begin{function}[added = 2017-11-28, updated = 2019-08-25] -% { -% \prop_set_from_keyval:Nn, \prop_set_from_keyval:cn, -% \prop_gset_from_keyval:Nn, \prop_gset_from_keyval:cn, -% } -% \begin{syntax} -% \cs{prop_set_from_keyval:Nn} \meta{prop~var} -% \{ -% \meta{key1} |=| \meta{value1} |,| -% \meta{key2} |=| \meta{value2} |,| \ldots{} -% \} -% \end{syntax} -% Sets \meta{prop~var} to contain key--value pairs given in the second -% argument. If duplicate keys appear only one of the values is kept. -% \end{function} -% -% \begin{function}[added = 2017-11-28, updated = 2019-08-25] -% {\prop_const_from_keyval:Nn, \prop_const_from_keyval:cn} -% \begin{syntax} -% \cs{prop_const_from_keyval:Nn} \meta{prop~var} -% \{ -% \meta{key1} |=| \meta{value1} |,| -% \meta{key2} |=| \meta{value2} |,| \ldots{} -% \} -% \end{syntax} -% Creates a new constant \meta{prop~var} or raises an error if the -% name is already taken. The \meta{prop~var} is set globally to -% contain key--value pairs given in the second argument. -% If duplicate keys appear only one of the values is kept. -% \end{function} -% % \section{Additions to \pkg{l3seq}} % % \begin{function}[rEXP] @@ -690,16 +480,6 @@ % \end{texnote} % \end{function} % -% \begin{function}[added = 2017-11-28] -% {\seq_const_from_clist:Nn, \seq_const_from_clist:cn} -% \begin{syntax} -% \cs{seq_const_from_clist:Nn} \meta{seq~var} \Arg{comma-list} -% \end{syntax} -% Creates a new constant \meta{seq~var} or raises an error if the name -% is already taken. The \meta{seq~var} is set globally to contain the -% items in the \meta{comma list}. -% \end{function} -% % \begin{function}[added = 2018-04-06] % {\seq_set_from_function:NnN, \seq_gset_from_function:NnN} % \begin{syntax} @@ -738,23 +518,6 @@ % mappings. % \end{function} % -% \begin{function}[added = 2018-04-29]{\seq_shuffle:N, \seq_gshuffle:N} -% \begin{syntax} -% \cs{seq_shuffle:N} \meta{seq~var} -% \end{syntax} -% Sets the \meta{seq~var} to the result of placing the items of the -% \meta{seq~var} in a random order. Each item is (roughly) as likely -% to end up in any given position. -% \begin{texnote} -% For sequences with more than $13$ items or so, only a small -% proportion of all possible permutations can be reached, because -% the random seed \cs{sys_rand_seed:} only has $28$-bits. The use -% of \tn{toks} internally means that sequences with more than -% $32767$ or $65535$ items (depending on the engine) cannot be -% shuffled. -% \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} @@ -775,37 +538,8 @@ % and so on) as~|#1| and the \meta{item} as~|#2|. % \end{function} % -% \section{Additions to \pkg{l3skip}} -% -% \begin{function}[EXP, added = 2018-11-03]{\dim_sign:n} -% \begin{syntax} -% \cs{dim_sign:n} \Arg{dimexpr} -% \end{syntax} -% Evaluates the \meta{dimexpr} then leaves $1$ or $0$ or $-1$ in the -% input stream according to the sign of the result. -% \end{function} -% % \section{Additions to \pkg{l3sys}} % -% \begin{function}[noTF, added = 2019-01-16, updated = 2019-02-16] -% {\sys_shell_get:nnN} -% \begin{syntax} -% \cs{sys_shell_get:nnN} \Arg{shell~command} \Arg{setup} \meta{tl~var} -% \cs{sys_shell_get:nnNTF} \Arg{shell~command} \Arg{setup} \meta{tl~var} \Arg{true code} \Arg{false code} -% \end{syntax} -% Defines \meta{tl} to the text returned by the \meta{shell command}. -% The \meta{shell command} is converted to a string using -% \cs{tl_to_str:n}. Category codes may need to be set appropriately -% via the \meta{setup} argument, which is run just before running the -% \meta{shell command} (in a group). -% If shell escape is disabled, the \meta{tl~var} will be set to -% \cs{q_no_value} in the non-branching version. -% Note that quote characters (|"|) \emph{cannot} be used inside the -% \meta{shell command}. The \cs{sys_shell_get:nnNTF} conditional -% returns \texttt{true} if the shell is available and no quote is -% detected, and \texttt{false} otherwise. -% \end{function} -% % \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{} @@ -836,106 +570,6 @@ % this is the case in \pdfTeX{}, \LuaTeX{}, \pTeX{} and \upTeX{}. % \end{function} % -% \begin{function}[added = 2017-05-27, EXP]{\sys_rand_seed:} -% \begin{syntax} -% \cs{sys_rand_seed:} -% \end{syntax} -% Expands to the current value of the engine's random seed, a -% non-negative integer. In engines without random number support this -% expands to $0$. -% \end{function} -% -% \begin{function}[added = 2017-05-27]{\sys_gset_rand_seed:n} -% \begin{syntax} -% \cs{sys_gset_rand_seed:n} \Arg{intexpr} -% \end{syntax} -% Globally sets the seed for the engine's pseudo-random number -% generator to the \meta{integer expression}. This random seed -% affects all \cs[no-index]{\ldots{}_rand} functions (such as -% \cs{int_rand:nn} or \cs{clist_rand_item:n}) as well as other -% packages relying on the engine's random number generator. In -% engines without random number support this produces an error. -% \begin{texnote} -% While a $32$-bit (signed) integer can be given as a seed, only the -% absolute value is used and any number beyond $2^{28}$ is divided -% by an appropriate power of~$2$. We recommend using an integer in -% $[0,2^{28}-1]$. -% \end{texnote} -% \end{function} -% -% \begin{function}[added = 2018-07-27, EXP, pTF] -% { -% \sys_if_platform_unix:, -% \sys_if_platform_windows: -% } -% \begin{syntax} -% \cs{sys_if_platform_unix:TF} \Arg{true code} \Arg{false code} -% \end{syntax} -% Conditionals which allow platform-specific code to be used. The names -% follow the \Lua{} |os.type()| function, \emph{i.e.}~all Unix-like systems -% are |unix| (including Linux and MacOS). -% \end{function} -% -% \begin{variable}[added = 2018-07-27]{\c_sys_platform_str} -% The current platform given as a lower case string: one of -% |unix|, |windows| or |unknown|. -% \end{variable} -% -% \begin{variable}[added = 2017-05-27]{\c_sys_shell_escape_int} -% This variable exposes the internal triple of the shell escape -% status. The possible values are -% \begin{description} -% \item[0] Shell escape is disabled -% \item[1] Unrestricted shell escape is enabled -% \item[2] Restricted shell escape is enabled -% \end{description} -% \end{variable} -% -% \begin{function}[added = 2017-05-27, EXP, pTF]{\sys_if_shell:} -% \begin{syntax} -% \cs{sys_if_shell_p:} -% \cs{sys_if_shell:TF} \Arg{true code} \Arg{false code} -% \end{syntax} -% Performs a check for whether shell escape is enabled. This -% returns true if either of restricted or unrestricted shell escape -% is enabled. -% \end{function} -% -% \begin{function}[added = 2017-05-27, EXP, pTF]{\sys_if_shell_unrestricted:} -% \begin{syntax} -% \cs{sys_if_shell_unrestricted_p:} -% \cs{sys_if_shell_unrestricted:TF} \Arg{true code} \Arg{false code} -% \end{syntax} -% Performs a check for whether \emph{unrestricted} shell escape is -% enabled. -% \end{function} -% -% \begin{function}[added = 2017-05-27, EXP, pTF]{\sys_if_shell_restricted:} -% \begin{syntax} -% \cs{sys_if_shell_restricted_p:} -% \cs{sys_if_shell_restricted:TF} \Arg{true code} \Arg{false code} -% \end{syntax} -% Performs a check for whether \emph{restricted} shell escape is -% enabled. This returns false if unrestricted shell escape is -% enabled. Unrestricted shell escape is not considered a superset -% of restricted shell escape in this case. To find whether any -% shell escape is enabled use \cs{sys_if_shell:}. -% \end{function} -% -% \begin{function}[added = 2017-05-27]{\sys_shell_now:n, \sys_shell_now:x} -% \begin{syntax} -% \cs{sys_shell_now:n} \Arg{tokens} -% \end{syntax} -% Execute \meta{tokens} through shell escape immediately. -% \end{function} -% -% \begin{function}[added = 2017-05-27]{\sys_shell_shipout:n, \sys_shell_shipout:x} -% \begin{syntax} -% \cs{sys_shell_shipout:n} \Arg{tokens} -% \end{syntax} -% Execute \meta{tokens} through shell escape at shipout. -% \end{function} -% % \section{Additions to \pkg{l3tl}} % % \begin{function}[EXP, added = 2014-06-30, updated = 2016-01-12] @@ -1335,28 +969,6 @@ %<*initex|package> % \end{macrocode} % -% \subsection{Additions to \pkg{l3basics}} -% -% \begin{macro}{\mode_leave_vertical:} -% The approach here is different to that used by \LaTeXe{} or plain \TeX{}, -% which unbox a void box to force horizontal mode. That inserts the -% \tn{everypar} tokens \emph{before} the re-inserted unboxing tokens. The -% approach here uses either the \tn{quitvmode} primitive or the equivalent -% protected macro. In vertical mode, the \tn{indent} primitive is inserted: -% this will switch to horizontal mode and insert \tn{everypar} tokens and -% nothing else. Unlike the \LaTeXe{} version, the availability of \eTeX{} -% means using a mode test can be done at for example the start of an -% \tn{halign}. -% \begin{macrocode} -\cs_new_protected:Npn \mode_leave_vertical: - { - \if_mode_vertical: - \exp_after:wN \tex_indent:D - \fi: - } -% \end{macrocode} -% \end{macro} -% % \subsection{Additions to \pkg{l3box}} % % \begin{macrocode} @@ -1519,22 +1131,6 @@ % \end{macro} % \end{macro} % -% \subsection{Additions to \pkg{l3fp-convert}} -% -% \begin{macrocode} -%<@@=fp> -% \end{macrocode} -% -% \begin{macro}{\fp_sign:n} -% Trivial but useful. See the implementation of \cs{fp_add:Nn} for an -% explanation of why to use \cs{@@_parse:n}, namely, for better error -% reporting. -% \begin{macrocode} -\cs_new:Npn \fp_sign:n #1 - { \fp_to_decimal:n { sign \@@_parse:n {#1} } } -% \end{macrocode} -% \end{macro} -% % \subsection{Additions to \pkg{l3flag}} % % \begin{macrocode} @@ -1547,7 +1143,6 @@ % it if the flag is zero in case the \enquote{trap} made customizable % in the future. % \begin{macrocode} -\__kernel_patch:nnNNpn { \@@_chk_exist:n {#1} } { } \cs_new:Npn \flag_raise_if_clear:n #1 { \if_cs_exist:w flag~#1~0 \cs_end: @@ -1558,39 +1153,6 @@ % \end{macrocode} % \end{macro} % -% \subsection{Additions to \pkg{l3int}} -% -% \begin{macrocode} -%<@@=int> -% \end{macrocode} -% -% \begin{macro}[EXP]{\int_sign:n, \@@_sign:Nw} -% See \cs{int_abs:n}. Evaluate the expression once (and when -% debugging is enabled, check that the expression is well-formed), -% then test the first character to determine the sign. This is -% wrapped in \cs{int_value:w} \ldots{} \cs{exp_stop_f:} to ensure a -% fixed number of expansions and to avoid dealing with closing the -% conditionals. -% \begin{macrocode} -\__kernel_patch_args:nNNpn - { { \__kernel_chk_expr:nNnN {#1} \@@_eval:w { } \int_sign:n } } -\cs_new:Npn \int_sign:n #1 - { - \int_value:w \exp_after:wN \@@_sign:Nw - \int_value:w \@@_eval:w #1 \@@_eval_end: ; - \exp_stop_f: - } -\cs_new:Npn \@@_sign:Nw #1#2 ; - { - \if_meaning:w 0 #1 - 0 - \else: - \if_meaning:w - #1 - \fi: 1 - \fi: - } -% \end{macrocode} -% \end{macro} -% % \subsection{Additions to \pkg{l3msg}} % % \begin{macrocode} @@ -1701,19 +1263,6 @@ % % \subsection{Additions to \pkg{l3prg}} % -% \begin{macro}[added = 2017-11-28]{\bool_const:Nn, \bool_const:cn} -% A merger between \cs{tl_const:Nn} and \cs{bool_set:Nn}. -% \begin{macrocode} -\__kernel_patch:nnNNpn { \__kernel_chk_var_scope:NN c #1 } { } -\cs_new_protected:Npn \bool_const:Nn #1#2 - { - \__kernel_chk_if_free_cs:N #1 - \tex_global:D \tex_chardef:D #1 = \bool_if_p:n {#2} - } -\cs_generate_variant:Nn \bool_const:Nn { c } -% \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. @@ -1888,85 +1437,6 @@ % \end{macrocode} % \end{macro} % -% \begin{macro}{\seq_const_from_clist:Nn, \seq_const_from_clist:cn} -% Almost identical to \cs{seq_set_from_clist:Nn}. -% \begin{macrocode} -\cs_new_protected:Npn \seq_const_from_clist:Nn #1#2 - { - \tl_const:Nx #1 - { \s_@@ \clist_map_function:nN {#2} \@@_wrap_item:n } - } -\cs_generate_variant:Nn \seq_const_from_clist:Nn { c } -% \end{macrocode} -% \end{macro} -% -% \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{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 \tex_uniformdeviate:D - { - \int_new:N \l_@@_internal_a_int - \int_new:N \l_@@_internal_b_int - \seq_new:N \g_@@_internal_seq - \cs_new_protected:Npn \seq_shuffle:N { \@@_shuffle:NN \seq_set_eq:NN } - \cs_new_protected:Npn \seq_gshuffle:N { \@@_shuffle:NN \seq_gset_eq:NN } - \cs_new_protected:Npn \@@_shuffle:NN #1#2 - { - \int_compare:nNnTF { \seq_count:N #2 } > \c_max_register_int - { - \__kernel_msg_error:nnx { kernel } { shuffle-too-large } - { \token_to_str:N #2 } - } - { - \group_begin: - \cs_set_eq:NN \@@_item:n \@@_shuffle_item:n - \int_zero:N \l_@@_internal_a_int - #2 - \seq_gset_from_inline_x:Nnn \g_@@_internal_seq - { \int_step_function:nN { \l_@@_internal_a_int } } - { \tex_the:D \tex_toks:D ##1 } - \group_end: - #1 #2 \g_@@_internal_seq - \seq_gclear:N \g_@@_internal_seq - } - } - \cs_new_protected:Npn \@@_shuffle_item:n - { - \int_incr:N \l_@@_internal_a_int - \int_set:Nn \l_@@_internal_b_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 - } - \__kernel_msg_new:nnnn { kernel } { shuffle-too-large } - { The~sequence~#1~is~too~long~to~be~shuffled~by~TeX. } - { - TeX~has~ \int_eval:n { \c_max_register_int + 1 } ~ - toks~registers:~this~only~allows~to~shuffle~up~to~ - \int_use:N \c_max_register_int \ items.~ - The~list~will~not~be~shuffled. - } - } - { - \cs_new_protected:Npn \seq_shuffle:N #1 - { - \__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, @@ -2011,42 +1481,6 @@ % \end{macrocode} % \end{macro} % -% \subsection{Additions to \pkg{l3skip}} -% -% \begin{macrocode} -%<@@=dim> -% \end{macrocode} -% -% \begin{macro}[EXP]{\dim_sign:n, \@@_sign:Nw} -% See \cs{dim_abs:n}. Contrarily to \cs{int_sign:n} the case of a -% zero dimension cannot be distinguished from a positive dimension by -% looking only at the first character, since |0.2pt| and |0pt| start -% the same way. We need explicit comparisons. We start by -% distinguishing the most common case of a positive dimension. -% \begin{macrocode} -\__kernel_patch_args:nNNpn - { { \__kernel_chk_expr:nNnN {#1} \@@_eval:w { } \dim_sign:n } } -\cs_new:Npn \dim_sign:n #1 - { - \int_value:w \exp_after:wN \@@_sign:Nw - \dim_use:N \@@_eval:w #1 \@@_eval_end: ; - \exp_stop_f: - } -\cs_new:Npn \@@_sign:Nw #1#2 ; - { - \if_dim:w #1#2 > \c_zero_dim - 1 - \else: - \if_meaning:w - #1 - -1 - \else: - 0 - \fi: - \fi: - } -% \end{macrocode} -% \end{macro} -% % \subsection{Additions to \pkg{l3sys}} % % \begin{macrocode} @@ -2073,6 +1507,7 @@ { p \int_use:N \tex_ptexversion:D + . \int_use:N \tex_ptexminorversion:D \tex_ptexrevision:D - @@ -2091,6 +1526,7 @@ { p \int_use:N \tex_ptexversion:D + . \int_use:N \tex_ptexminorversion:D \tex_ptexrevision:D - @@ -2111,327 +1547,9 @@ % \end{macrocode} % \end{variable} % -% \begin{macro}[EXP]{\sys_rand_seed:} -% 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} -\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} -\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} -% -% \begin{variable}{\c_sys_shell_escape_int} -% Expose the engine's shell escape status to the user. -% \begin{macrocode} -\int_const:Nn \c_sys_shell_escape_int - { - \sys_if_engine_luatex:TF - { - \tex_directlua:D - { tex.sprint(status.shell_escape~or~os.execute()) } - } - { - \tex_shellescape:D - } - } -% \end{macrocode} -% \end{variable} -% -% \begin{variable}{\l_@@_internal_tl} -% \begin{macrocode} -\tl_new:N \l_@@_internal_tl -% \end{macrocode} -% \end{variable} -% -% \begin{variable}{\c_@@_marker_tl} -% The same idea as the marker for rescanning token lists. -% \begin{macrocode} -\tl_const:Nx \c_@@_marker_tl { : \token_to_str:N : } -% \end{macrocode} -% \end{variable} -% -% \begin{macro}[TF]{\sys_shell_get:nnN} -% \begin{macro}{\sys_shell_get:nnN,\@@_get:nnN,\@@_get_do:Nw} -% Setting using a shell is at this level just a slightly specialised file -% operation, with an additional check for quotes, as these are not supported. -% \begin{macrocode} -\cs_new_protected:Npn \sys_shell_get:nnN #1#2#3 - { - \sys_shell_get:nnNF {#1} {#2} #3 - { \tl_set:Nn #3 { \q_no_value } } - } -\prg_new_protected_conditional:Npnn \sys_shell_get:nnN #1#2#3 { T , F , TF } - { - \sys_if_shell:TF - { \exp_args:No \@@_get:nnN { \tl_to_str:n {#1} } {#2} #3 } - { \prg_return_false: } - } -\cs_new_protected:Npn \@@_get:nnN #1#2#3 - { - \tl_if_in:nnTF {#1} { " } - { - \__kernel_msg_error:nnx - { kernel } { quote-in-shell } {#1} - \prg_return_false: - } - { - \group_begin: - \if_false: { \fi: - \int_set_eq:NN \tex_tracingnesting:D \c_zero_int - \exp_args:No \tex_everyeof:D { \c_@@_marker_tl } - #2 \scan_stop: - \exp_after:wN \@@_get_do:Nw - \exp_after:wN #3 - \exp_after:wN \prg_do_nothing: - \tex_input:D | "#1" \scan_stop: - \if_false: } \fi: - \prg_return_true: - } - } -\exp_args:Nno \use:nn - { \cs_new_protected:Npn \@@_get_do:Nw #1#2 } - { \c_@@_marker_tl } - { - \group_end: - \tl_set:No #1 {#2} - } -\__kernel_msg_new:nnnn { kernel } { quote-in-shell } - { Quotes~in~shell~command~'#1'. } - { Shell~commands~cannot~contain~quotes~("). } -% \end{macrocode} -% \end{macro} -% \end{macro} -% -% \begin{variable}{\c_sys_platform_str} -% Detecting the platform on \LuaTeX{} is easy: for other engines, we use -% the fact that the two common cases have special null files. It is possible -% to probe further (see package \pkg{platform}), but that requires shell -% escape and seems unlikely to be useful. -% \begin{macrocode} -\sys_if_engine_luatex:TF - { - \str_const:Nx \c_sys_platform_str - { \lua_now:n { tex.print(os.type) } } - } - { - \file_if_exist:nTF { nul: } - { - \file_if_exist:nF { /dev/null } - { \str_const:Nn \c_sys_platform_str { windows } } - } - { - \file_if_exist:nT { /dev/null } - { \str_const:Nn \c_sys_platform_str { unix } } - } - } -\cs_if_exist:NF \c_sys_platform_str - { \str_const:Nn \c_sys_platform_str { unknown } } -% \end{macrocode} -% \end{variable} -% \begin{macro}[pTF]{\sys_if_platform_unix:} -% \begin{macro}[pTF]{\sys_if_platform_windows:} -% We can now set up the tests. -% \begin{macrocode} -\clist_map_inline:nn { unix , windows } - { - \@@_const:nn { sys_if_platform_ #1 } - { \str_if_eq_p:Vn \c_sys_platform_str { #1 } } - } -% \end{macrocode} -% \end{macro} -% \end{macro} -% -% \begin{macro}[EXP, pTF]{\sys_if_shell:, \sys_if_shell_unrestricted:, \sys_if_shell_restricted:} -% Performs a check for whether shell escape is enabled. The first set -% of functions returns true if either of restricted or unrestricted -% shell escape is enabled, while the other two sets of functions -% return true in only one of these two cases. -% \begin{macrocode} -\@@_const:nn { sys_if_shell } - { \int_compare_p:nNn \c_sys_shell_escape_int > 0 } -\@@_const:nn { sys_if_shell_unrestricted } - { \int_compare_p:nNn \c_sys_shell_escape_int = 1 } -\@@_const:nn { sys_if_shell_restricted } - { \int_compare_p:nNn \c_sys_shell_escape_int = 2 } -% \end{macrocode} -% \end{macro} -% -% \begin{variable}{\c_@@_shell_stream_int} -% This is not needed for \LuaTeX{}: shell escape there isn't done using -% a \TeX{} interface. -% \begin{macrocode} -\sys_if_engine_luatex:F - { \int_const:Nn \c_@@_shell_stream_int { 18 } } -% \end{macrocode} -% \end{variable} -% -% \begin{macro}{\sys_shell_now:n} -% Execute commands through shell escape immediately. -% \begin{macrocode} -\sys_if_engine_luatex:TF - { - \cs_new_protected:Npn \sys_shell_now:n #1 - { - \lua_now:e - { os.execute(" \lua_escape:e { \tl_to_str:n {#1} } ") } - } - } - { - \cs_new_protected:Npn \sys_shell_now:n #1 - { \iow_now:Nn \c_@@_shell_stream_int {#1} } - } -\cs_generate_variant:Nn \sys_shell_now:n { x } -% \end{macrocode} -% \end{macro} -% -% \begin{macro}{\sys_shell_shipout:n} -% Execute commands through shell escape at shipout. -% \begin{macrocode} -\sys_if_engine_luatex:TF - { - \cs_new_protected:Npn \sys_shell_shipout:n #1 - { - \lua_shipout_e:n - { os.execute(" \lua_escape:e { \tl_to_str:n {#1} } ") } - } - } - { - \cs_new_protected:Npn \sys_shell_shipout:n #1 - { \iow_shipout:Nn \c_@@_shell_stream_int {#1} } - } -\cs_generate_variant:Nn \sys_shell_shipout:n { x } -% \end{macrocode} -% \end{macro} -% % \subsection{Additions to \pkg{l3file}} % % \begin{macrocode} -%<@@=file> -% \end{macrocode} -% -% \begin{macro}[EXP]{\@@_str_cmp:nn} -% \begin{macro}[EXP]{\@@_str_escape:n} -% As we are doing a fixed-length \enquote{big} integer comparison, it -% is easiest to use the low-level behavior of string comparisons. -% \begin{macrocode} -\cs_new:Npn \@@_str_cmp:nn #1#2 { \tex_strcmp:D {#1} {#2} } -\sys_if_engine_luatex:T - { - \cs_set:Npn \@@_str_cmp:nn #1#2 - { - \lua_now:e - { - l3kernel.strcmp - ( - " \@@_str_escape:n {#1}", - " \@@_str_escape:n {#2}" - ) - } - } - \cs_new:Npn \@@_str_escape:n #1 - { - \lua_escape:e - { \__kernel_tl_to_str:w \use:e { {#1} } } - } - } -% \end{macrocode} -% \end{macro} -% \end{macro} -% -% \begin{variable}{\l_@@_first_tl, \l_@@_second_tl} -% \begin{macrocode} -\tl_new:N \l_@@_first_tl -\tl_new:N \l_@@_second_tl -% \end{macrocode} -% \end{variable} -% -% \begin{macro}[TF]{\file_compare_timestamp:nNn} -% \begin{macro}[EXP]{\@@_timestamp:n} -% Comparison of file date can be done by using the low-level nature of the -% string comparison functions. This could be expandable but that would -% skip any file look-up: to stay consistent we retain that at the cost of -% expansion. -% \begin{macrocode} -\prg_new_protected_conditional:Npnn \file_compare_timestamp:nNn #1#2#3 - { T , F , TF } - { - \group_begin: - \file_get_full_name:nNTF {#1} \l_@@_first_tl - { - \file_get_full_name:nNTF {#3} \l_@@_second_tl - { - \if_int_compare:w - \@@_str_cmp:nn - { \@@_timestamp:n \exp_after:wN { \l_@@_first_tl } } - { \@@_timestamp:n \exp_after:wN { \l_@@_second_tl } } - #2 0 \exp_stop_f: - \group_end: - \prg_return_true: - \else: - \group_end: - \prg_return_false: - \fi: - } - { - \group_end: - \if_charcode:w #2 > - \prg_return_true: - \else: - \prg_return_false: - \fi: - } - } - { - \group_end: - \if_charcode:w #2 < - \prg_return_true: - \else: - \prg_return_false: - \fi: - } - } -\sys_if_engine_luatex:TF - { - \cs_new:Npn \@@_timestamp:n #1 - { - \lua_now:e - { l3kernel.filemoddate ( " \lua_escape:e {#1} " ) } - } - } - { \cs_new_eq:NN \@@_timestamp:n \tex_filemoddate:D } -% \end{macrocode} -% \end{macro} -% \end{macro} -% -% \begin{macrocode} %<@@=ior> % \end{macrocode} % @@ -2760,14 +1878,6 @@ %<@@=tl> % \end{macrocode} % -% \begin{macro}[EXP, documented-as=\tl_if_head_eq_catcode:nNTF] -% {\tl_if_head_eq_catcode:oNTF} -% Extra variants. -% \begin{macrocode} -\cs_generate_variant:Nn \tl_if_head_eq_catcode:nNTF { o } -% \end{macrocode} -% \end{macro} -% % \begin{macro}[EXP]{\tl_lower_case:n, \tl_upper_case:n, \tl_mixed_case:n} % \begin{macro}[EXP]{\tl_lower_case:nn, \tl_upper_case:nn, \tl_mixed_case:nn} % The user level functions here are all wrappers around the internal @@ -4112,10 +3222,8 @@ % definition does not seem useful so we just do |#3| |#1| |{}| to % clear it locally or globally as appropriate. % \begin{macrocode} -\__kernel_patch:nnNNpn { \__kernel_chk_var_local:N #1 } { } \cs_new_protected:Npn \tl_build_begin:N #1 { \@@_build_begin:NN \cs_set_nopar:Npx #1 } -\__kernel_patch:nnNNpn { \__kernel_chk_var_global:N #1 } { } \cs_new_protected:Npn \tl_build_gbegin:N #1 { \@@_build_begin:NN \cs_gset_nopar:Npx #1 } \cs_new_protected:Npn \@@_build_begin:NN #1#2 @@ -4170,25 +3278,21 @@ % implies that the assignment does not simply set the token list to an % |x|-expansion of the second argument. % \begin{macrocode} -\__kernel_patch:nnNNpn { \__kernel_chk_var_local:N #1 } { } \cs_new_protected:Npn \tl_build_put_right:Nn #1#2 { \cs_set_nopar:Npx #1 { \exp_after:wN \exp_not:n \exp_after:wN { \exp:w #1 #2 } } } -\__kernel_patch:nnNNpn { \__kernel_chk_var_local:N #1 } { } \cs_new_protected:Npn \tl_build_put_right:Nx #1#2 { \cs_set_nopar:Npx #1 { \exp_after:wN \exp_not:n \exp_after:wN { \exp:w #1 } #2 } } -\__kernel_patch:nnNNpn { \__kernel_chk_var_global:N #1 } { } \cs_new_protected:Npn \tl_build_gput_right:Nn #1#2 { \cs_gset_nopar:Npx #1 { \exp_after:wN \exp_not:n \exp_after:wN { \exp:w #1 #2 } } } -\__kernel_patch:nnNNpn { \__kernel_chk_var_global:N #1 } { } \cs_new_protected:Npn \tl_build_gput_right:Nx #1#2 { \cs_gset_nopar:Npx #1 @@ -4227,11 +3331,9 @@ % add the \meta{right} material after the \Arg{left} in the % |x|-expanding assignment. % \begin{macrocode} -\__kernel_patch:nnNNpn { \__kernel_chk_var_local:N #1 } { } \cs_new_protected:Npn \tl_build_put_left:Nn #1 { \@@_build_put_left:NNn \cs_set_nopar:Npx #1 } \cs_generate_variant:Nn \tl_build_put_left:Nn { Nx } -\__kernel_patch:nnNNpn { \__kernel_chk_var_global:N #1 } { } \cs_new_protected:Npn \tl_build_gput_left:Nn #1 { \@@_build_put_left:NNn \cs_gset_nopar:Npx #1 } \cs_generate_variant:Nn \tl_build_gput_left:Nn { Nx } |