From 01651bbd8c05e990ab60754f83cca88670045846 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Fri, 7 Dec 2018 22:52:08 +0000 Subject: l3kernel (7dec18) git-svn-id: svn://tug.org/texlive/trunk@49348 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/source/latex/l3kernel/expl3.dtx | 4 +- .../texmf-dist/source/latex/l3kernel/l3alloc.dtx | 2 +- .../texmf-dist/source/latex/l3kernel/l3basics.dtx | 2 +- .../source/latex/l3kernel/l3bootstrap.dtx | 2 +- Master/texmf-dist/source/latex/l3kernel/l3box.dtx | 26 +-- .../source/latex/l3kernel/l3candidates.dtx | 200 ++++++--------------- .../texmf-dist/source/latex/l3kernel/l3clist.dtx | 45 ++++- .../texmf-dist/source/latex/l3kernel/l3coffins.dtx | 2 +- .../source/latex/l3kernel/l3color-base.dtx | 14 +- .../source/latex/l3kernel/l3deprecation.dtx | 2 +- Master/texmf-dist/source/latex/l3kernel/l3doc.dtx | 2 +- .../source/latex/l3kernel/l3docstrip.dtx | 2 +- .../texmf-dist/source/latex/l3kernel/l3drivers.dtx | 12 +- .../texmf-dist/source/latex/l3kernel/l3expan.dtx | 2 +- Master/texmf-dist/source/latex/l3kernel/l3file.dtx | 2 +- .../texmf-dist/source/latex/l3kernel/l3final.dtx | 2 +- Master/texmf-dist/source/latex/l3kernel/l3flag.dtx | 2 +- .../source/latex/l3kernel/l3fp-assign.dtx | 2 +- .../texmf-dist/source/latex/l3kernel/l3fp-aux.dtx | 2 +- .../source/latex/l3kernel/l3fp-basics.dtx | 2 +- .../source/latex/l3kernel/l3fp-convert.dtx | 2 +- .../texmf-dist/source/latex/l3kernel/l3fp-expo.dtx | 2 +- .../source/latex/l3kernel/l3fp-extended.dtx | 2 +- .../source/latex/l3kernel/l3fp-logic.dtx | 2 +- .../source/latex/l3kernel/l3fp-parse.dtx | 2 +- .../source/latex/l3kernel/l3fp-random.dtx | 2 +- .../source/latex/l3kernel/l3fp-round.dtx | 2 +- .../source/latex/l3kernel/l3fp-traps.dtx | 2 +- .../texmf-dist/source/latex/l3kernel/l3fp-trig.dtx | 2 +- Master/texmf-dist/source/latex/l3kernel/l3fp.dtx | 2 +- .../texmf-dist/source/latex/l3kernel/l3fparray.dtx | 2 +- Master/texmf-dist/source/latex/l3kernel/l3int.dtx | 11 +- .../source/latex/l3kernel/l3intarray.dtx | 10 +- .../source/latex/l3kernel/l3kernel-functions.dtx | 2 +- Master/texmf-dist/source/latex/l3kernel/l3keys.dtx | 2 +- .../texmf-dist/source/latex/l3kernel/l3luatex.dtx | 4 +- Master/texmf-dist/source/latex/l3kernel/l3msg.dtx | 2 +- .../texmf-dist/source/latex/l3kernel/l3names.dtx | 2 +- .../source/latex/l3kernel/l3oldmodules.dtx | 2 +- Master/texmf-dist/source/latex/l3kernel/l3prg.dtx | 2 +- Master/texmf-dist/source/latex/l3kernel/l3prop.dtx | 2 +- .../texmf-dist/source/latex/l3kernel/l3quark.dtx | 2 +- .../texmf-dist/source/latex/l3kernel/l3regex.dtx | 2 +- Master/texmf-dist/source/latex/l3kernel/l3seq.dtx | 29 ++- Master/texmf-dist/source/latex/l3kernel/l3skip.dtx | 2 +- Master/texmf-dist/source/latex/l3kernel/l3sort.dtx | 2 +- Master/texmf-dist/source/latex/l3kernel/l3str.dtx | 2 +- Master/texmf-dist/source/latex/l3kernel/l3sys.dtx | 2 +- .../source/latex/l3kernel/l3tl-analysis.dtx | 2 +- Master/texmf-dist/source/latex/l3kernel/l3tl.dtx | 32 +++- .../texmf-dist/source/latex/l3kernel/l3token.dtx | 2 +- .../texmf-dist/source/latex/l3kernel/l3unicode.dtx | 2 +- 52 files changed, 246 insertions(+), 223 deletions(-) (limited to 'Master/texmf-dist/source/latex') diff --git a/Master/texmf-dist/source/latex/l3kernel/expl3.dtx b/Master/texmf-dist/source/latex/l3kernel/expl3.dtx index 7d772133088..30f6aac094e 100644 --- a/Master/texmf-dist/source/latex/l3kernel/expl3.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/expl3.dtx @@ -21,7 +21,7 @@ % for those people who are interested. % %<*driver|generic|package> -\def\ExplFileDate{2018-11-19}% +\def\ExplFileDate{2018-12-06}% % %<*driver> \documentclass[full]{l3doc} @@ -49,7 +49,7 @@ % }^^A % } % -% \date{Released 2018-11-19} +% \date{Released 2018-12-06} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3alloc.dtx b/Master/texmf-dist/source/latex/l3kernel/l3alloc.dtx index a00f377a36e..29bb8d043fe 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-11-19} +% \date{Released 2018-12-06} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3basics.dtx b/Master/texmf-dist/source/latex/l3kernel/l3basics.dtx index b3e9db2852e..72113b6b006 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-11-19} +% \date{Released 2018-12-06} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3bootstrap.dtx b/Master/texmf-dist/source/latex/l3kernel/l3bootstrap.dtx index 658e811554d..d5015bd4152 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-11-19} +% \date{Released 2018-12-06} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3box.dtx b/Master/texmf-dist/source/latex/l3kernel/l3box.dtx index d02d4dd1fbe..e3aa4621d17 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-11-19} +% \date{Released 2018-12-06} % % \maketitle % @@ -1364,7 +1364,8 @@ % % \TeX{} ends these boxes directly with the internal \emph{end_graf} % routine. This means that there is no \cs{par} at the end of vertical -% boxes unless we insert one. +% boxes unless we insert one. Thus all vertical boxes include a \cs{par} +% just before closing the color group. % % \begin{macro}{\vbox:n} % \TestFiles{m3box003.lvt} @@ -1373,9 +1374,9 @@ % Put a vertical box directly into the input stream. % \begin{macrocode} \cs_new_protected:Npn \vbox:n #1 - { \tex_vbox:D { \color_group_begin: #1 \color_group_end: } } + { \tex_vbox:D { \color_group_begin: #1 \par \color_group_end: } } \cs_new_protected:Npn \vbox_top:n #1 - { \tex_vtop:D { \color_group_begin: #1 \color_group_end: } } + { \tex_vtop:D { \color_group_begin: #1 \par \color_group_end: } } % \end{macrocode} % \end{macro} % \end{macro} @@ -1388,12 +1389,12 @@ \cs_new_protected:Npn \vbox_to_ht:nn #1#2 { \tex_vbox:D to \@@_dim_eval:n {#1} - { \color_group_begin: #2 \color_group_end: } + { \color_group_begin: #2 \par \color_group_end: } } \cs_new_protected:Npn \vbox_to_zero:n #1 { \tex_vbox:D to \c_zero_dim - { \color_group_begin: #1 \color_group_end: } + { \color_group_begin: #1 \par \color_group_end: } } % \end{macrocode} % \end{macro} @@ -1408,13 +1409,13 @@ \cs_new_protected:Npn \vbox_set:Nn #1#2 { \tex_setbox:D #1 \tex_vbox:D - { \color_group_begin: #2 \color_group_end: } + { \color_group_begin: #2 \par \color_group_end: } } \__kernel_patch:nnNNpn { \__kernel_chk_var_global:N #1 } { } \cs_new_protected:Npn \vbox_gset:Nn #1#2 { \tex_global:D \tex_setbox:D #1 \tex_vbox:D - { \color_group_begin: #2 \color_group_end: } + { \color_group_begin: #2 \par \color_group_end: } } \cs_generate_variant:Nn \vbox_set:Nn { c } \cs_generate_variant:Nn \vbox_gset:Nn { c } @@ -1432,13 +1433,13 @@ \cs_new_protected:Npn \vbox_set_top:Nn #1#2 { \tex_setbox:D #1 \tex_vtop:D - { \color_group_begin: #2 \color_group_end: } + { \color_group_begin: #2 \par \color_group_end: } } \__kernel_patch:nnNNpn { \__kernel_chk_var_global:N #1 } { } \cs_new_protected:Npn \vbox_gset_top:Nn #1#2 { \tex_global:D \tex_setbox:D #1 \tex_vtop:D - { \color_group_begin: #2 \color_group_end: } + { \color_group_begin: #2 \par \color_group_end: } } \cs_generate_variant:Nn \vbox_set_top:Nn { c } \cs_generate_variant:Nn \vbox_gset_top:Nn { c } @@ -1455,13 +1456,13 @@ \cs_new_protected:Npn \vbox_set_to_ht:Nnn #1#2#3 { \tex_setbox:D #1 \tex_vbox:D to \@@_dim_eval:n {#2} - { \color_group_begin: #3 \color_group_end: } + { \color_group_begin: #3 \par \color_group_end: } } \__kernel_patch:nnNNpn { \__kernel_chk_var_global:N #1 } { } \cs_new_protected:Npn \vbox_gset_to_ht:Nnn #1#2#3 { \tex_global:D \tex_setbox:D #1 \tex_vbox:D to \@@_dim_eval:n {#2} - { \color_group_begin: #3 \color_group_end: } + { \color_group_begin: #3 \par \color_group_end: } } \cs_generate_variant:Nn \vbox_set_to_ht:Nnn { c } \cs_generate_variant:Nn \vbox_gset_to_ht:Nnn { c } @@ -1494,6 +1495,7 @@ \cs_generate_variant:Nn \vbox_gset:Nw { c } \cs_new_protected:Npn \vbox_set_end: { + \par \color_group_end: \c_group_end_token } diff --git a/Master/texmf-dist/source/latex/l3kernel/l3candidates.dtx b/Master/texmf-dist/source/latex/l3kernel/l3candidates.dtx index 4c1c05e531a..da296d1d685 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-11-19} +% \date{Released 2018-12-06} % % \maketitle % @@ -193,25 +193,6 @@ % group level. % \end{function} % -% \section{Additions to \pkg{l3clist}} -% -% \begin{function}[EXP, added = 2016-12-06] -% {\clist_rand_item:N, \clist_rand_item:n, \clist_rand_item:c} -% \begin{syntax} -% \cs{clist_rand_item:N} \meta{clist~var} -% \cs{clist_rand_item:n} \Arg{comma list} -% \end{syntax} -% Selects a pseudo-random item of the \meta{comma list}. If the -% \meta{comma list} has no item, the result is empty. This not -% yet available in \XeTeX{}. -% \begin{texnote} -% The result is returned within the \tn{unexpanded} -% primitive (\cs{exp_not:n}), which means that the \meta{item} -% does not expand further when appearing in an \texttt{x}-type -% argument expansion. -% \end{texnote} -% \end{function} -% % \section{Additions to \pkg{l3coffins}} % % \begin{function}{\coffin_resize:Nnn, \coffin_resize:cnn} @@ -439,15 +420,6 @@ % % \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} -% % \begin{function}[EXP, added = 2018-11-03]{\int_sign:n} % \begin{syntax} % \cs{int_sign:n} \Arg{intexpr} @@ -458,15 +430,6 @@ % % \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} @@ -752,21 +715,6 @@ % \end{texnote} % \end{function} % -% \begin{function}[EXP, added = 2016-12-06]{\seq_rand_item:N, \seq_rand_item:c} -% \begin{syntax} -% \cs{seq_rand_item:N} \meta{seq~var} -% \end{syntax} -% Selects a pseudo-random item of the \meta{sequence}. If the -% \meta{sequence} is empty the result is empty. This is not yet -% available in \XeTeX{}. -% \begin{texnote} -% The result is returned within the \tn{unexpanded} -% primitive (\cs{exp_not:n}), which means that the \meta{item} -% does not expand further when appearing in an \texttt{x}-type -% argument expansion. -% \end{texnote} -% \end{function} -% % \begin{function}[added = 2017-11-28] % {\seq_const_from_clist:Nn, \seq_const_from_clist:cn} % \begin{syntax} @@ -1288,23 +1236,6 @@ % \meta{shell command}. % \end{function} % -% \begin{function}[EXP, added = 2016-12-06] -% {\tl_rand_item:N, \tl_rand_item:c, \tl_rand_item:n} -% \begin{syntax} -% \cs{tl_rand_item:N} \meta{tl~var} -% \cs{tl_rand_item:n} \Arg{token list} -% \end{syntax} -% Selects a pseudo-random item of the \meta{token list}. If the -% \meta{token list} is blank, the result is empty. This is not yet -% available in \XeTeX{}. -% \begin{texnote} -% The result is returned within the \tn{unexpanded} -% primitive (\cs{exp_not:n}), which means that the \meta{item} -% does not expand further when appearing in an \texttt{x}-type -% argument expansion. -% \end{texnote} -% \end{function} -% % \begin{function}[EXP, added = 2017-02-17, updated = 2017-07-15] % {\tl_range:Nnn, \tl_range:nnn} % \begin{syntax} @@ -1313,28 +1244,63 @@ % \end{syntax} % Leaves in the input stream the items from the \meta{start index} to the % \meta{end index} inclusive. Spaces and braces are preserved between -% the items returned (but never at either end of the list). Positive -% \meta{indices} are counted -% from the start of the \meta{token list}, $1$~being the first item, and -% negative \meta{indices} are counted from the end of the token list, -% $-1$~being the last item. If either of \meta{start index} or -% \meta{end index} is~$0$, the result is empty. For instance, +% the items returned (but never at either end of the list). +% +% Here \meta{start index} and \meta{end index} should be integer denotations. +% For describing in detail the functions' behavior, let $m$ and $n$ be the start +% and end index respectively. If either is $0$, the result is empty. A positive +% index means `start counting from the left end', a negative index means +% `start counting from the right end'. Let $l$ be the count of the token list. +% +% The \emph{actual start point} is determined as $M=m$ if~$m>0$ and as $M=l+m+1$ +% if~$m<0$. Similarly the \emph{actual end point} is $N=n$ if~$n>0$ and $N=l+n+1$ +% if~$n<0$. If $M>N$, the result is empty. Otherwise it consists of all items from +% position $M$ to position $N$ inclusive; for the purpose of this rule, we can +% imagine that the token list extends at infinity on either side, with void items +% at positions $s$ for $s\le0$ or $s>l$. + +% Spaces in between items in the actual range are preserved. Spaces at either end +% of the token list will be removed anyway (think to the token list being passed to +% |\tl_trim_spaces:n| to begin with. +% +% Thus, with $l=7$ as in the examples below, all of the following are equivalent +% and result in the whole token list +% \begin{verbatim} +% \tl_range:nnn { abcd~{e{}}fg } { 1 } { 7 } +% \tl_range:nnn { abcd~{e{}}fg } { 1 } { 12 } +% \tl_range:nnn { abcd~{e{}}fg } { -7 } { 7 } +% \tl_range:nnn { abcd~{e{}}fg } { -12 } { 7 } +% \end{verbatim} +% Here are some more interesting examples. The calls +% \begin{verbatim} +% \iow_term:x { \tl_range:nnn { abcd{e{}}fg } { 2 } { 5 } } +% \iow_term:x { \tl_range:nnn { abcd{e{}}fg } { 2 } { -3 } } +% \iow_term:x { \tl_range:nnn { abcd{e{}}fg } { -6 } { 5 } } +% \iow_term:x { \tl_range:nnn { abcd{e{}}fg } { -6 } { -3 } } +% \end{verbatim} +% are all equivalent and will print |bcd{e{}}| on the terminal; similarly % \begin{verbatim} -% \iow_term:x { \tl_range:nnn { abcd~{e{}}f } { 2 } { 5 } } -% \iow_term:x { \tl_range:nnn { abcd~{e{}}f } { -4 } { -1 } } -% \iow_term:x { \tl_range:nnn { abcd~{e{}}f } { -2 } { -1 } } -% \iow_term:x { \tl_range:nnn { abcd~{e{}}f } { 0 } { -1 } } +% \iow_term:x { \tl_range:nnn { abcd~{e{}}fg } { 2 } { 5 } } +% \iow_term:x { \tl_range:nnn { abcd~{e{}}fg } { 2 } { -3 } } +% \iow_term:x { \tl_range:nnn { abcd~{e{}}fg } { -6 } { 5 } } +% \iow_term:x { \tl_range:nnn { abcd~{e{}}fg } { -6 } { -3 } } % \end{verbatim} -% prints \verb*|bcd {e{}}|, \verb*|cd {e{}}f|, \verb*|{e{}}f| and an empty -% line to the terminal. The \meta{start index} must always be smaller than -% or equal to the \meta{end index}: if this is not the case then no output -% is generated. Thus +% are all equivalent and will print |bcd {e{}}| on the +% terminal (note the space in the middle). To the contrary, % \begin{verbatim} -% \iow_term:x { \tl_range:nnn { abcd~{e{}}f } { 5 } { 2 } } -% \iow_term:x { \tl_range:nnn { abcd~{e{}}f } { -1 } { -4 } } +% \tl_range:nnn { abcd~{e{}}f } { 2 } { 4 } % \end{verbatim} -% both yield empty token lists. For improved performance, see -% \cs{tl_range_braced:nnn} and \cs{tl_range_unbraced:nnn}. +% will discard the space after `d`. +% +% If we want to get the items from the third to the last, the call +% is |\tl_range:nnn { } { 3 } { -1 }|. Similarly, for discarding +% the last item, we can do |\tl_range:nnn { } { 1 } { -2 }|. +% +% The behavior of \cs{tl_range:Nnn} is exactly the same, acting on the +% contents of the tl variable. +% +% For improved performance, see \cs{tl_range_braced:nnn} and +% \cs{tl_range_unbraced:nnn}. % \begin{texnote} % The result is returned within the \tn{unexpanded} % primitive (\cs{exp_not:n}), which means that the \meta{item} @@ -1720,39 +1686,6 @@ % \end{macrocode} % \end{macro} % -% \subsection{Additions to \pkg{l3clist}} -% -% \begin{macrocode} -%<@@=clist> -% \end{macrocode} -% -% \begin{macro}{\clist_rand_item:n, \clist_rand_item:N, \clist_rand_item:c} -% \begin{macro}{\@@_rand_item:nn} -% The |N|-type function is not implemented through the |n|-type -% function for efficiency: for instance comma-list variables do not -% require space-trimming of their items. Even testing for emptyness -% of an |n|-type comma-list is slow, so we count items first and use -% that both for the emptyness test and the pseudo-random integer. -% Importantly, \cs{clist_item:Nn} and \cs{clist_item:nn} only evaluate -% their argument once. -% \begin{macrocode} -\cs_new:Npn \clist_rand_item:n #1 - { \exp_args:Nf \@@_rand_item:nn { \clist_count:n {#1} } {#1} } -\cs_new:Npn \@@_rand_item:nn #1#2 - { - \int_compare:nNnF {#1} = 0 - { \clist_item:nn {#2} { \int_rand:nn { 1 } {#1} } } - } -\cs_new:Npn \clist_rand_item:N #1 - { - \clist_if_empty:NF #1 - { \clist_item:Nn #1 { \int_rand:nn { 1 } { \clist_count:N #1 } } } - } -\cs_generate_variant:Nn \clist_rand_item:N { c } -% \end{macrocode} -% \end{macro} -% \end{macro} -% % \subsection{Additions to \pkg{l3coffins}} % % \begin{macrocode} @@ -2740,18 +2673,6 @@ % \end{macrocode} % \end{macro} % -% \begin{macro}{\seq_rand_item:N, \seq_rand_item:c} -% Importantly, \cs{seq_item:Nn} only evaluates its argument once. -% \begin{macrocode} -\cs_new:Npn \seq_rand_item:N #1 - { - \seq_if_empty:NF #1 - { \seq_item:Nn #1 { \int_rand:nn { 1 } { \seq_count:N #1 } } } - } -\cs_generate_variant:Nn \seq_rand_item:N { c } -% \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} @@ -5099,19 +5020,6 @@ % % \subsubsection{Other additions to \pkg{l3tl}} % -% \begin{macro}{\tl_rand_item:n, \tl_rand_item:N, \tl_rand_item:c} -% Importantly \cs{tl_item:nn} only evaluates its argument once. -% \begin{macrocode} -\cs_new:Npn \tl_rand_item:n #1 - { - \tl_if_blank:nF {#1} - { \tl_item:nn {#1} { \int_rand:nn { 1 } { \tl_count:n {#1} } } } - } -\cs_new:Npn \tl_rand_item:N { \exp_args:No \tl_rand_item:n } -\cs_generate_variant:Nn \tl_rand_item:N { c } -% \end{macrocode} -% \end{macro} -% % Some preliminary code is needed for the \cs{tl_range:nnn} family of functions. % % \begin{macro}{\tl_range:Nnn, \tl_range:cnn, \tl_range:nnn} diff --git a/Master/texmf-dist/source/latex/l3kernel/l3clist.dtx b/Master/texmf-dist/source/latex/l3kernel/l3clist.dtx index 7d2f3716d69..98ee9a84abd 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3clist.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3clist.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2018-11-19} +% \date{Released 2018-12-06} % % \maketitle % @@ -692,6 +692,22 @@ % \end{texnote} % \end{function} % +% \begin{function}[EXP, added = 2016-12-06] +% {\clist_rand_item:N, \clist_rand_item:n, \clist_rand_item:c} +% \begin{syntax} +% \cs{clist_rand_item:N} \meta{clist~var} +% \cs{clist_rand_item:n} \Arg{comma list} +% \end{syntax} +% Selects a pseudo-random item of the \meta{comma list}. If the +% \meta{comma list} has no item, the result is empty. +% \begin{texnote} +% The result is returned within the \tn{unexpanded} +% primitive (\cs{exp_not:n}), which means that the \meta{item} +% does not expand further when appearing in an \texttt{x}-type +% argument expansion. +% \end{texnote} +% \end{function} +% % \section{Viewing comma lists} % % \begin{function}[updated = 2015-08-03]{\clist_show:N, \clist_show:c} @@ -1932,6 +1948,33 @@ % \end{macro} % \end{macro} % +% \begin{macro}{\clist_rand_item:n, \clist_rand_item:N, \clist_rand_item:c} +% \begin{macro}{\@@_rand_item:nn} +% The |N|-type function is not implemented through the |n|-type +% function for efficiency: for instance comma-list variables do not +% require space-trimming of their items. Even testing for emptyness +% of an |n|-type comma-list is slow, so we count items first and use +% that both for the emptyness test and the pseudo-random integer. +% Importantly, \cs{clist_item:Nn} and \cs{clist_item:nn} only evaluate +% their argument once. +% \begin{macrocode} +\cs_new:Npn \clist_rand_item:n #1 + { \exp_args:Nf \@@_rand_item:nn { \clist_count:n {#1} } {#1} } +\cs_new:Npn \@@_rand_item:nn #1#2 + { + \int_compare:nNnF {#1} = 0 + { \clist_item:nn {#2} { \int_rand:nn { 1 } {#1} } } + } +\cs_new:Npn \clist_rand_item:N #1 + { + \clist_if_empty:NF #1 + { \clist_item:Nn #1 { \int_rand:nn { 1 } { \clist_count:N #1 } } } + } +\cs_generate_variant:Nn \clist_rand_item:N { c } +% \end{macrocode} +% \end{macro} +% \end{macro} +% % \subsection{Viewing comma lists} % % \begin{macro}{\clist_show:N, \clist_show:c, \clist_log:N, \clist_log:c, \@@_show:NN} diff --git a/Master/texmf-dist/source/latex/l3kernel/l3coffins.dtx b/Master/texmf-dist/source/latex/l3kernel/l3coffins.dtx index de848591d3f..cbe959df091 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-11-19} +% \date{Released 2018-12-06} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3color-base.dtx b/Master/texmf-dist/source/latex/l3kernel/l3color-base.dtx index 0f281c1716f..e449cb0c389 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-11-19} +% \date{Released 2018-12-06} % % \maketitle % @@ -122,16 +122,12 @@ % \end{variable} % % \begin{macro}{\color_group_begin:, \color_group_end:} -% Grouping for color is almost the same as using the basic \cs{group_begin:} -% and \cs{group_end:} functions. However, in vertical mode the end-of-group -% needs a \tn{par}, which in horizontal mode does nothing. +% Grouping for color is the same as using the basic \cs{group_begin:} +% and \cs{group_end:} functions. However, for semantic reasons, they +% are renamed here. % \begin{macrocode} \cs_new_eq:NN \color_group_begin: \group_begin: -\cs_new_protected:Npn \color_group_end: - { - \par - \group_end: - } +\cs_new_eq:NN \color_group_end: \group_end: % \end{macrocode} % \end{macro} % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3deprecation.dtx b/Master/texmf-dist/source/latex/l3kernel/l3deprecation.dtx index 10f8494a73d..bc7812e6712 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-11-19} +% \date{Released 2018-12-06} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3doc.dtx b/Master/texmf-dist/source/latex/l3kernel/l3doc.dtx index 54d7e7e53ba..a7db2e96282 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-11-19} +% \date{Released 2018-12-06} % \maketitle % \tableofcontents % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3docstrip.dtx b/Master/texmf-dist/source/latex/l3kernel/l3docstrip.dtx index bb1ccdd5780..898b00910b4 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-11-19} +% \date{Released 2018-12-06} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3drivers.dtx b/Master/texmf-dist/source/latex/l3kernel/l3drivers.dtx index dcb425ff0df..a7e5235cc42 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-11-19} +% \date{Released 2018-12-06} % % \maketitle % @@ -554,23 +554,23 @@ %<*package> \ProvidesExplFile %<*dvipdfmx> - {l3dvidpfmx.def}{2018-11-19}{} + {l3dvidpfmx.def}{2018-12-06}{} {L3 Experimental driver: dvipdfmx} % %<*dvips> - {l3dvips.def}{2018-11-19}{} + {l3dvips.def}{2018-12-06}{} {L3 Experimental driver: dvips} % %<*dvisvgm> - {l3dvisvgm.def}{2018-11-19}{} + {l3dvisvgm.def}{2018-12-06}{} {L3 Experimental driver: dvisvgm} % %<*pdfmode> - {l3pdfmode.def}{2018-11-19}{} + {l3pdfmode.def}{2018-12-06}{} {L3 Experimental driver: PDF mode} % %<*xdvipdfmx> - {l3xdvidpfmx.def}{2018-11-19}{} + {l3xdvidpfmx.def}{2018-12-06}{} {L3 Experimental driver: xdvipdfmx} % % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3expan.dtx b/Master/texmf-dist/source/latex/l3kernel/l3expan.dtx index bfaef8e5e39..de12e811a19 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-11-19} +% \date{Released 2018-12-06} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3file.dtx b/Master/texmf-dist/source/latex/l3kernel/l3file.dtx index 3b56f3683ce..1e9659a6e78 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-11-19} +% \date{Released 2018-12-06} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3final.dtx b/Master/texmf-dist/source/latex/l3kernel/l3final.dtx index 2009835ab94..a91a0517946 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-11-19} +% \date{Released 2018-12-06} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3flag.dtx b/Master/texmf-dist/source/latex/l3kernel/l3flag.dtx index b82904a3d41..08f3550e6ec 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-11-19} +% \date{Released 2018-12-06} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-assign.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-assign.dtx index c068438024b..0120674c056 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-11-19} +% \date{Released 2018-12-06} % \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 14af2cf597c..f93464dbe0e 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-11-19} +% \date{Released 2018-12-06} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-basics.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-basics.dtx index 8740c1c7351..fc2a8a5bc4a 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-11-19} +% \date{Released 2018-12-06} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-convert.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-convert.dtx index 64db9fe578a..7d6e20310fd 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-11-19} +% \date{Released 2018-12-06} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-expo.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-expo.dtx index 9347f5cc946..0328f8ce7aa 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-11-19} +% \date{Released 2018-12-06} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-extended.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-extended.dtx index f98aa35ad98..c233604ef80 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-11-19} +% \date{Released 2018-12-06} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-logic.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-logic.dtx index eacc520f0b4..a594e8c9015 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-11-19} +% \date{Released 2018-12-06} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-parse.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-parse.dtx index fa5f0fcf8c5..ba6410cb944 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-11-19} +% \date{Released 2018-12-06} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-random.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-random.dtx index 61f457ae449..a4869ec2de5 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-11-19} +% \date{Released 2018-12-06} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-round.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-round.dtx index 910299e3e67..02cb53c72c0 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-11-19} +% \date{Released 2018-12-06} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-traps.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-traps.dtx index 84b7ebafc6c..70e00583bed 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-11-19} +% \date{Released 2018-12-06} % \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 241fb2d58f9..a347424607a 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-11-19} +% \date{Released 2018-12-06} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp.dtx index 89cf60d0632..f2fca8d0e75 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-11-19} +% \date{Released 2018-12-06} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fparray.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fparray.dtx index 7ef911cc9ff..14d3b582524 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3fparray.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3fparray.dtx @@ -42,7 +42,7 @@ % }^^A % } % -% \date{Released 2018-11-19} +% \date{Released 2018-12-06} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3int.dtx b/Master/texmf-dist/source/latex/l3kernel/l3int.dtx index 56fa910a314..33be6f31475 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-11-19} +% \date{Released 2018-12-06} % % \maketitle % @@ -795,6 +795,15 @@ % is not yet available in \XeTeX{}. % \end{function} % +% \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{Viewing integers} % % \begin{function}{\int_show:N, \int_show:c} diff --git a/Master/texmf-dist/source/latex/l3kernel/l3intarray.dtx b/Master/texmf-dist/source/latex/l3kernel/l3intarray.dtx index 6879d1c6e06..81cfd7e007d 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-11-19} +% \date{Released 2018-12-06} % % \maketitle % @@ -112,6 +112,14 @@ % error occurs. % \end{function} % +% \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. +% \end{function} +% % \subsection{Implementation notes} % % It is a wrapper around the \tn{fontdimen} primitive, used to store diff --git a/Master/texmf-dist/source/latex/l3kernel/l3kernel-functions.dtx b/Master/texmf-dist/source/latex/l3kernel/l3kernel-functions.dtx index efa037242b5..0ec7fda69f0 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-11-19} +% \date{Released 2018-12-06} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3keys.dtx b/Master/texmf-dist/source/latex/l3kernel/l3keys.dtx index 030f5660ef5..9fbb0fb6fc6 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-11-19} +% \date{Released 2018-12-06} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3luatex.dtx b/Master/texmf-dist/source/latex/l3kernel/l3luatex.dtx index cdaf498190b..131b3da6de6 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-11-19} +% \date{Released 2018-12-06} % % \maketitle % @@ -232,7 +232,7 @@ % \begin{macrocode} \cs_new:Npn \lua_now:e #1 { \@@_now:n {#1} } \cs_new:Npn \lua_now:n #1 { \lua_now:e { \exp_not:n {#1} } } -\cs_new_protected:Npn \lua_shipout_e:n #1 { \@@_shiphout:n {#1} } +\cs_new_protected:Npn \lua_shipout_e:n #1 { \@@_shipout:n {#1} } \cs_new_protected:Npn \lua_shipout:n #1 { \lua_shipout_e:n { \exp_not:n {#1} } } \cs_new:Npn \lua_escape:e #1 { \@@_escape:n {#1} } diff --git a/Master/texmf-dist/source/latex/l3kernel/l3msg.dtx b/Master/texmf-dist/source/latex/l3kernel/l3msg.dtx index 0b9794dd043..41a629c1d68 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-11-19} +% \date{Released 2018-12-06} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3names.dtx b/Master/texmf-dist/source/latex/l3kernel/l3names.dtx index 9ab3a340a6e..a2953ab4ea7 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-11-19} +% \date{Released 2018-12-06} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3oldmodules.dtx b/Master/texmf-dist/source/latex/l3kernel/l3oldmodules.dtx index ff344233c91..5c5e138d64d 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-11-19} +% \date{Released 2018-12-06} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3prg.dtx b/Master/texmf-dist/source/latex/l3kernel/l3prg.dtx index b18389f6e50..b92a96be5c6 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-11-19} +% \date{Released 2018-12-06} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3prop.dtx b/Master/texmf-dist/source/latex/l3kernel/l3prop.dtx index 0f2fdff7569..7dbf5450ac4 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-11-19} +% \date{Released 2018-12-06} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3quark.dtx b/Master/texmf-dist/source/latex/l3kernel/l3quark.dtx index a123baf55f0..2f82e71769f 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-11-19} +% \date{Released 2018-12-06} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3regex.dtx b/Master/texmf-dist/source/latex/l3kernel/l3regex.dtx index 68b597a9250..88a7482db06 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-11-19} +% \date{Released 2018-12-06} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3seq.dtx b/Master/texmf-dist/source/latex/l3kernel/l3seq.dtx index 0eaadc78d50..12a347955d7 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-11-19} +% \date{Released 2018-12-06} % % \maketitle % @@ -289,6 +289,21 @@ % \end{texnote} % \end{function} % +% \begin{function}[EXP, added = 2016-12-06]{\seq_rand_item:N, \seq_rand_item:c} +% \begin{syntax} +% \cs{seq_rand_item:N} \meta{seq~var} +% \end{syntax} +% Selects a pseudo-random item of the \meta{sequence}. If the +% \meta{sequence} is empty the result is empty. This is not yet +% available in \XeTeX{}. +% \begin{texnote} +% The result is returned within the \tn{unexpanded} +% primitive (\cs{exp_not:n}), which means that the \meta{item} +% does not expand further when appearing in an \texttt{x}-type +% argument expansion. +% \end{texnote} +% \end{function} +% % \section{Recovering values from sequences with branching} % % The functions in this section combine tests for non-empty sequences @@ -1702,6 +1717,18 @@ % \end{macro} % \end{macro} % +% \begin{macro}{\seq_rand_item:N, \seq_rand_item:c} +% Importantly, \cs{seq_item:Nn} only evaluates its argument once. +% \begin{macrocode} +\cs_new:Npn \seq_rand_item:N #1 + { + \seq_if_empty:NF #1 + { \seq_item:Nn #1 { \int_rand:nn { 1 } { \seq_count:N #1 } } } + } +\cs_generate_variant:Nn \seq_rand_item:N { c } +% \end{macrocode} +% \end{macro} +% % \subsection{Mapping to sequences} % % \begin{macro}{\seq_map_break:} diff --git a/Master/texmf-dist/source/latex/l3kernel/l3skip.dtx b/Master/texmf-dist/source/latex/l3kernel/l3skip.dtx index cb1839353d5..1743f5f7599 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-11-19} +% \date{Released 2018-12-06} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3sort.dtx b/Master/texmf-dist/source/latex/l3kernel/l3sort.dtx index 217acdaa320..ea71394efe5 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-11-19} +% \date{Released 2018-12-06} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3str.dtx b/Master/texmf-dist/source/latex/l3kernel/l3str.dtx index 430f33d2498..6b3f80ce0cc 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-11-19} +% \date{Released 2018-12-06} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3sys.dtx b/Master/texmf-dist/source/latex/l3kernel/l3sys.dtx index 38ed4c2925f..a2dbf59b33d 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-11-19} +% \date{Released 2018-12-06} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3tl-analysis.dtx b/Master/texmf-dist/source/latex/l3kernel/l3tl-analysis.dtx index 1b2d02d32d1..294e5e5cdf7 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-11-19} +% \date{Released 2018-12-06} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3tl.dtx b/Master/texmf-dist/source/latex/l3kernel/l3tl.dtx index 30ef7b74f8d..e6613f26e22 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-11-19} +% \date{Released 2018-12-06} % % \maketitle % @@ -1009,6 +1009,23 @@ % \end{texnote} % \end{function} % +% \begin{function}[EXP, added = 2016-12-06] +% {\tl_rand_item:N, \tl_rand_item:c, \tl_rand_item:n} +% \begin{syntax} +% \cs{tl_rand_item:N} \meta{tl~var} +% \cs{tl_rand_item:n} \Arg{token list} +% \end{syntax} +% Selects a pseudo-random item of the \meta{token list}. If the +% \meta{token list} is blank, the result is empty. This is not yet +% available in \XeTeX{}. +% \begin{texnote} +% The result is returned within the \tn{unexpanded} +% primitive (\cs{exp_not:n}), which means that the \meta{item} +% does not expand further when appearing in an \texttt{x}-type +% argument expansion. +% \end{texnote} +% \end{function} +% % \section{Viewing token lists} % % \begin{function}[updated = 2015-08-01]{\tl_show:N, \tl_show:c} @@ -2964,6 +2981,19 @@ % \end{macro} % \end{macro} % +% \begin{macro}{\tl_rand_item:n, \tl_rand_item:N, \tl_rand_item:c} +% Importantly \cs{tl_item:nn} only evaluates its argument once. +% \begin{macrocode} +\cs_new:Npn \tl_rand_item:n #1 + { + \tl_if_blank:nF {#1} + { \tl_item:nn {#1} { \int_rand:nn { 1 } { \tl_count:n {#1} } } } + } +\cs_new:Npn \tl_rand_item:N { \exp_args:No \tl_rand_item:n } +\cs_generate_variant:Nn \tl_rand_item:N { c } +% \end{macrocode} +% \end{macro} +% % \subsection{Viewing token lists} % % \begin{macro}{\tl_show:N, \tl_show:c, \tl_log:N, \tl_log:c, \@@_show:NN} diff --git a/Master/texmf-dist/source/latex/l3kernel/l3token.dtx b/Master/texmf-dist/source/latex/l3kernel/l3token.dtx index df8bac88aa7..e53585a87f3 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-11-19} +% \date{Released 2018-12-06} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3unicode.dtx b/Master/texmf-dist/source/latex/l3kernel/l3unicode.dtx index 00536dc3472..f589de09503 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-11-19} +% \date{Released 2018-12-06} % % \maketitle % -- cgit v1.2.3