diff options
Diffstat (limited to 'Master/texmf-dist/source/latex/l3kernel/l3candidates.dtx')
-rw-r--r-- | Master/texmf-dist/source/latex/l3kernel/l3candidates.dtx | 160 |
1 files changed, 101 insertions, 59 deletions
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3candidates.dtx b/Master/texmf-dist/source/latex/l3kernel/l3candidates.dtx index e98af99edcb..d3ef2708afc 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3candidates.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3candidates.dtx @@ -38,7 +38,7 @@ \documentclass[full]{l3doc} %</driver> %<*driver|package> -\GetIdInfo$Id: l3candidates.dtx 6484 2016-05-13 19:08:30Z joseph $ +\GetIdInfo$Id: l3candidates.dtx 6688 2016-08-19 19:21:48Z bruno $ {L3 Experimental additions to l3kernel} %</driver|package> %<*driver> @@ -405,7 +405,7 @@ % \begin{syntax} % \cs{ior_map_break:} % \end{syntax} -% Used to terminate a \cs{ior_map_\ldots} function before all +% Used to terminate a \cs[no-index]{ior_map_\ldots} function before all % lines from the \meta{stream} have been processed. This will % normally take place within a conditional statement, for example % \begin{verbatim} @@ -418,7 +418,7 @@ % } % } % \end{verbatim} -% Use outside of a \cs{ior_map_\ldots} scenario will lead to low +% Use outside of a \cs[no-index]{ior_map_\ldots} scenario will lead to low % level \TeX{} errors. % \begin{texnote} % When the mapping is broken, additional tokens may be inserted by the @@ -432,7 +432,7 @@ % \begin{syntax} % \cs{ior_map_break:n} \Arg{tokens} % \end{syntax} -% Used to terminate a \cs{ior_map_\ldots} function before all +% Used to terminate a \cs[no-index]{ior_map_\ldots} function before all % lines in the \meta{stream} have been processed, inserting % the \meta{tokens} after the mapping has ended. This will % normally take place within a conditional statement, for example @@ -446,7 +446,7 @@ % } % } % \end{verbatim} -% Use outside of a \cs{ior_map_\ldots} scenario will lead to low +% Use outside of a \cs[no-index]{ior_map_\ldots} scenario will lead to low % level \TeX{} errors. % \begin{texnote} % When the mapping is broken, additional tokens may be inserted by the @@ -640,6 +640,14 @@ % % \section{Additions to \pkg{l3prop}} % +% \begin{function}[EXP]{\prop_count:N, \prop_count:c} +% \begin{syntax} +% \cs{prop_count:N} \meta{property list} +% \end{syntax} +% Leaves the number of key--value pairs in the \meta{property list} in +% the input stream as an \meta{integer denotation}. +% \end{function} +% % \begin{function}[rEXP] % {\prop_map_tokens:Nn, \prop_map_tokens:cn} % \begin{syntax} @@ -830,7 +838,7 @@ % giving an \meta{integer denotation}. % \end{function} % -% \begin{function}[EXP, added = 2014-06-30, updated = 2016-01-12]^^A +% \begin{function}[EXP, added = 2014-06-30, updated = 2016-01-12] % { % \tl_lower_case:n, \tl_upper_case:n, \tl_mixed_case:n, % \tl_lower_case:nn, \tl_upper_case:nn, \tl_mixed_case:nn @@ -949,7 +957,8 @@ % case. However, the process is more complex than this as there are some % situations where a single lower case character maps to a special form, for % example \texttt{ij} in Dutch which becomes \texttt{IJ}. As such, -% \cs{tl_mixed_case:n(n)} implement a more sophisticated mapping which accounts +% \cs[index=tl_mixed_case:n]{tl_mixed_case:n(n)} +% implement a more sophisticated mapping which accounts % for this and for modifying accents on the first letter. Spaces at the start % of the \meta{tokens} are ignored when finding the first \enquote{letter} for % conversion. @@ -1023,7 +1032,7 @@ % to add these to the kernel where they are well-documented % (\emph{e.g.}~in Unicode Consortium or relevant government publications). % -% \begin{function}[added = 2014-06-25]^^A +% \begin{function}[added = 2014-06-25] % { % \tl_set_from_file:Nnn, \tl_set_from_file:cnn, % \tl_gset_from_file:Nnn, \tl_gset_from_file:cnn @@ -1036,7 +1045,7 @@ % argument. % \end{function} % -% \begin{function}[added = 2014-06-25]^^A +% \begin{function}[added = 2014-06-25] % { % \tl_set_from_file_x:Nnn, \tl_set_from_file_x:cnn, % \tl_gset_from_file_x:Nnn, \tl_gset_from_file_x:cnn @@ -1111,9 +1120,9 @@ % the csname should be turned to a control sequence within a group % (see \cs{cs_show:c}). % \begin{macrocode} -\cs_new_protected_nopar:Npn \cs_log:N +\cs_new_protected:Npn \cs_log:N { \__msg_log_next: \cs_show:N } -\cs_new_protected_nopar:Npn \cs_log:c +\cs_new_protected:Npn \cs_log:c { \__msg_log_next: \cs_show:c } % \end{macrocode} % \end{macro} @@ -1121,7 +1130,7 @@ % \begin{macro}[int]{\__kernel_register_log:N, \__kernel_register_log:c} % Redirect the output of \cs{__kernel_register_show:N} to the log. % \begin{macrocode} -\cs_new_protected_nopar:Npn \__kernel_register_log:N +\cs_new_protected:Npn \__kernel_register_log:N { \__msg_log_next: \__kernel_register_show:N } \cs_generate_variant:Nn \__kernel_register_log:N { c } % \end{macrocode} @@ -1782,9 +1791,9 @@ % \begin{macro}{\clist_log:N, \clist_log:c, \clist_log:n} % Redirect output of \cs{clist_show:N} to the log. % \begin{macrocode} -\cs_new_protected_nopar:Npn \clist_log:N +\cs_new_protected:Npn \clist_log:N { \__msg_log_next: \clist_show:N } -\cs_new_protected_nopar:Npn \clist_log:n +\cs_new_protected:Npn \clist_log:n { \__msg_log_next: \clist_show:n } \cs_generate_variant:Nn \clist_log:N { c } % \end{macrocode} @@ -2050,7 +2059,7 @@ % that for the corners. However, there is only one value needed here and % a fixed input property list, so things are a bit clearer. % \begin{macrocode} -\cs_new_protected_nopar:Npn \@@_find_bounding_shift: +\cs_new_protected:Npn \@@_find_bounding_shift: { \dim_set:Nn \l_@@_bounding_shift_dim { \c_max_dim } \prop_map_inline:Nn \l_@@_bounding_prop @@ -2255,7 +2264,7 @@ % \begin{macro}{\coffin_log_structure:N, \coffin_log_structure:c} % Redirect output of \cs{coffin_show_structure:N} to the log. % \begin{macrocode} -\cs_new_protected_nopar:Npn \coffin_log_structure:N +\cs_new_protected:Npn \coffin_log_structure:N { \__msg_log_next: \coffin_show_structure:N } \cs_generate_variant:Nn \coffin_log_structure:N { c } % \end{macrocode} @@ -2308,9 +2317,9 @@ % Usual map breaking functions. Those are not yet in \pkg{l3kernel} % proper since the mapping below is the first of its kind. % \begin{macrocode} -\cs_new_nopar:Npn \ior_map_break: +\cs_new:Npn \ior_map_break: { \__prg_map_break:Nn \ior_map_break: { } } -\cs_new_nopar:Npn \ior_map_break:n +\cs_new:Npn \ior_map_break:n { \__prg_map_break:Nn \ior_map_break: } % \end{macrocode} % \end{macro} @@ -2326,11 +2335,11 @@ % This mapping cannot be nested as the stream has only one \enquote{current % line}. % \begin{macrocode} -\cs_new_protected_nopar:Npn \ior_map_inline:Nn +\cs_new_protected:Npn \ior_map_inline:Nn { \@@_map_inline:NNn \ior_get:NN } -\cs_new_protected_nopar:Npn \ior_str_map_inline:Nn +\cs_new_protected:Npn \ior_str_map_inline:Nn { \@@_map_inline:NNn \ior_get_str:NN } -\cs_new_protected_nopar:Npn \@@_map_inline:NNn +\cs_new_protected:Npn \@@_map_inline:NNn { \int_gincr:N \g__prg_map_int \exp_args:Nc \@@_map_inline:NNNn @@ -2363,7 +2372,7 @@ % \begin{macro}{\ior_log_streams:} % Redirect output of \cs{ior_list_streams:} to the log. % \begin{macrocode} -\cs_new_protected_nopar:Npn \ior_log_streams: +\cs_new_protected:Npn \ior_log_streams: { \__msg_log_next: \ior_list_streams: } % \end{macrocode} % \end{macro} @@ -2375,7 +2384,7 @@ % \begin{macro}{\iow_log_streams:} % Redirect output of \cs{iow_list_streams:} to the log. % \begin{macrocode} -\cs_new_protected_nopar:Npn \iow_log_streams: +\cs_new_protected:Npn \iow_log_streams: { \__msg_log_next: \iow_list_streams: } % \end{macrocode} % \end{macro} @@ -2389,9 +2398,9 @@ % \begin{macro}{\fp_log:N, \fp_log:c, \fp_log:n} % Redirect output of \cs{fp_show:N} to the log. % \begin{macrocode} -\cs_new_protected_nopar:Npn \fp_log:N +\cs_new_protected:Npn \fp_log:N { \__msg_log_next: \fp_show:N } -\cs_new_protected_nopar:Npn \fp_log:n +\cs_new_protected:Npn \fp_log:n { \__msg_log_next: \fp_show:n } \cs_generate_variant:Nn \fp_log:N { c } % \end{macrocode} @@ -2405,7 +2414,7 @@ % involving \tn{currentgrouplevel} and \tn{currentgrouptype}. See % \cs{int_show:N} for details. % \begin{macrocode} -\cs_new_protected_nopar:Npn \int_log:N +\cs_new_protected:Npn \int_log:N { \__msg_log_next: \int_show:N } \cs_generate_variant:Nn \int_log:N { c } % \end{macrocode} @@ -2414,7 +2423,7 @@ % \begin{macro}{\int_log:n} % Redirect output of \cs{int_show:n} to the log. % \begin{macrocode} -\cs_new_protected_nopar:Npn \int_log:n +\cs_new_protected:Npn \int_log:n { \__msg_log_next: \int_show:n } % \end{macrocode} % \end{macro} @@ -2428,7 +2437,7 @@ % \begin{macro}{\keys_log:nn} % Redirect output of \cs{keys_show:nn} to the log. % \begin{macrocode} -\cs_new_protected_nopar:Npn \keys_log:nn +\cs_new_protected:Npn \keys_log:nn { \__msg_log_next: \keys_show:nn } % \end{macrocode} % \end{macro} @@ -2556,9 +2565,9 @@ % \begin{macro}{\bool_log:N, \bool_log:c, \bool_log:n} % Redirect output of \cs{bool_show:N} to the log. % \begin{macrocode} -\cs_new_protected_nopar:Npn \bool_log:N +\cs_new_protected:Npn \bool_log:N { \__msg_log_next: \bool_show:N } -\cs_new_protected_nopar:Npn \bool_log:n +\cs_new_protected:Npn \bool_log:n { \__msg_log_next: \bool_show:n } \cs_generate_variant:Nn \bool_log:N { c } % \end{macrocode} @@ -2570,6 +2579,27 @@ %<@@=prop> % \end{macrocode} % +% \begin{macro}[EXP]{\prop_count:N, \prop_count:c} +% \begin{macro}[aux,EXP]{\@@_count:nn} +% Counting the key--value pairs in a property list is done using the +% same approach as for other count functions: turn each entry into a +% \texttt{+1} then use integer evaluation to actually do the +% mathematics. +% \begin{macrocode} +\cs_new:Npn \prop_count:N #1 + { + \int_eval:n + { + \c_zero + \prop_map_function:NN #1 \@@_count:nn + } + } +\cs_new:Npn \@@_count:nn #1#2 { + \c_one } +\cs_generate_variant:Nn \prop_count:N { c } +% \end{macrocode} +% \end{macro} +% \end{macro} +% % \begin{macro}[rEXP]{\prop_map_tokens:Nn, \prop_map_tokens:cn} % \begin{macro}[aux]{\@@_map_tokens:nwwn} % The mapping is very similar to \cs{prop_map_function:NN}. It grabs @@ -2602,7 +2632,7 @@ % \begin{macro}{\prop_log:N, \prop_log:c} % Redirect output of \cs{prop_show:N} to the log. % \begin{macrocode} -\cs_new_protected_nopar:Npn \prop_log:N +\cs_new_protected:Npn \prop_log:N { \__msg_log_next: \prop_show:N } \cs_generate_variant:Nn \prop_log:N { c } % \end{macrocode} @@ -2672,9 +2702,9 @@ % \cs{@@_item:n} without expansion in the input stream, % hence in the \texttt{x}-expanding assignment. % \begin{macrocode} -\cs_new_protected_nopar:Npn \seq_set_filter:NNn +\cs_new_protected:Npn \seq_set_filter:NNn { \@@_set_filter:NNNn \tl_set:Nx } -\cs_new_protected_nopar:Npn \seq_gset_filter:NNn +\cs_new_protected:Npn \seq_gset_filter:NNn { \@@_set_filter:NNNn \tl_gset:Nx } \cs_new_protected:Npn \@@_set_filter:NNNn #1#2#3#4 { @@ -2692,9 +2722,9 @@ % merge the two within a single function, but it would have weird % semantics. % \begin{macrocode} -\cs_new_protected_nopar:Npn \seq_set_map:NNn +\cs_new_protected:Npn \seq_set_map:NNn { \@@_set_map:NNNn \tl_set:Nx } -\cs_new_protected_nopar:Npn \seq_gset_map:NNn +\cs_new_protected:Npn \seq_gset_map:NNn { \@@_set_map:NNNn \tl_gset:Nx } \cs_new_protected:Npn \@@_set_map:NNNn #1#2#3#4 { @@ -2709,7 +2739,7 @@ % \begin{macro}{\seq_log:N, \seq_log:c} % Redirect output of \cs{seq_show:N} to the log. % \begin{macrocode} -\cs_new_protected_nopar:Npn \seq_log:N +\cs_new_protected:Npn \seq_log:N { \__msg_log_next: \seq_show:N } \cs_generate_variant:Nn \seq_log:N { c } % \end{macrocode} @@ -2750,7 +2780,7 @@ % \begin{macrocode} \cs_new_eq:NN \dim_log:N \__kernel_register_log:N \cs_new_eq:NN \dim_log:c \__kernel_register_log:c -\cs_new_protected_nopar:Npn \dim_log:n +\cs_new_protected:Npn \dim_log:n { \__msg_log_next: \dim_show:n } % \end{macrocode} % \end{macro} @@ -2760,7 +2790,7 @@ % \begin{macrocode} \cs_new_eq:NN \skip_log:N \__kernel_register_log:N \cs_new_eq:NN \skip_log:c \__kernel_register_log:c -\cs_new_protected_nopar:Npn \skip_log:n +\cs_new_protected:Npn \skip_log:n { \__msg_log_next: \skip_show:n } % \end{macrocode} % \end{macro} @@ -2770,7 +2800,7 @@ % \begin{macrocode} \cs_new_eq:NN \muskip_log:N \__kernel_register_log:N \cs_new_eq:NN \muskip_log:c \__kernel_register_log:c -\cs_new_protected_nopar:Npn \muskip_log:n +\cs_new_protected:Npn \muskip_log:n { \__msg_log_next: \muskip_show:n } % \end{macrocode} % \end{macro} @@ -2872,7 +2902,7 @@ % \end{macro} % \end{macro} % -% \begin{macro}^^A +% \begin{macro} % { % \tl_set_from_file:Nnn, \tl_set_from_file:cnn, % \tl_gset_from_file:Nnn, \tl_gset_from_file:cnn @@ -2885,9 +2915,9 @@ % This plus \cs{exp_not:N} allows the primitive to be used to carry out % a set operation. % \begin{macrocode} -\cs_new_protected_nopar:Npn \tl_set_from_file:Nnn +\cs_new_protected:Npn \tl_set_from_file:Nnn { \@@_set_from_file:NNnn \tl_set:Nn } -\cs_new_protected_nopar:Npn \tl_gset_from_file:Nnn +\cs_new_protected:Npn \tl_gset_from_file:Nnn { \@@_set_from_file:NNnn \tl_gset:Nn } \cs_generate_variant:Nn \tl_set_from_file:Nnn { c } \cs_generate_variant:Nn \tl_gset_from_file:Nnn { c } @@ -2915,7 +2945,7 @@ % \end{macro} % \end{macro} % -% \begin{macro}^^A +% \begin{macro} % { % \tl_set_from_file_x:Nnn, \tl_set_from_file_x:cnn, % \tl_gset_from_file_x:Nnn, \tl_gset_from_file_x:cnn @@ -2927,9 +2957,9 @@ % Once the business is done using some scratch space, the tokens can be % transferred to the real target. % \begin{macrocode} -\cs_new_protected_nopar:Npn \tl_set_from_file_x:Nnn +\cs_new_protected:Npn \tl_set_from_file_x:Nnn { \@@_set_from_file_x:NNnn \tl_set:Nn } -\cs_new_protected_nopar:Npn \tl_gset_from_file_x:Nnn +\cs_new_protected:Npn \tl_gset_from_file_x:Nnn { \@@_set_from_file_x:NNnn \tl_gset:Nn } \cs_generate_variant:Nn \tl_set_from_file_x:Nnn { c } \cs_generate_variant:Nn \tl_gset_from_file_x:Nnn { c } @@ -2957,7 +2987,8 @@ % appropriate data extracted from the Unicode documentation (either manually % or automatically). % -% \begin{macro}[EXP]{\tl_if_head_eq_catcode:oNTF} +% \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 } @@ -2971,12 +3002,12 @@ % done without an internal, but this way the logic is slightly clearer as % everything essentially follows the same path. % \begin{macrocode} -\cs_new_nopar:Npn \tl_lower_case:n { \@@_change_case:nnn { lower } { } } -\cs_new_nopar:Npn \tl_upper_case:n { \@@_change_case:nnn { upper } { } } -\cs_new_nopar:Npn \tl_mixed_case:n { \@@_mixed_case:nn { } } -\cs_new_nopar:Npn \tl_lower_case:nn { \@@_change_case:nnn { lower } } -\cs_new_nopar:Npn \tl_upper_case:nn { \@@_change_case:nnn { upper } } -\cs_new_nopar:Npn \tl_mixed_case:nn { \@@_mixed_case:nn } +\cs_new:Npn \tl_lower_case:n { \@@_change_case:nnn { lower } { } } +\cs_new:Npn \tl_upper_case:n { \@@_change_case:nnn { upper } { } } +\cs_new:Npn \tl_mixed_case:n { \@@_mixed_case:nn { } } +\cs_new:Npn \tl_lower_case:nn { \@@_change_case:nnn { lower } } +\cs_new:Npn \tl_upper_case:nn { \@@_change_case:nnn { upper } } +\cs_new:Npn \tl_mixed_case:nn { \@@_mixed_case:nn } % \end{macrocode} % \end{macro} % \end{macro} @@ -3018,6 +3049,7 @@ % \begin{macro}[aux, EXP]{\@@_change_case_cs:N} % \begin{macro}[aux, EXP]{\@@_change_case_cs:NN} % \begin{macro}[aux, EXP]{\@@_change_case_cs:NNn} +% \begin{macro}[aux, EXP]{\@@_change_case_protect:wNN} % \begin{macro}[aux, EXP]{\@@_change_case_if_expandable:NTF} % \begin{macro}[aux, EXP]{\@@_change_case_cs_expand:Nnw} % \begin{macro}[aux, EXP]{\@@_change_case_cs_expand:NN} @@ -3339,10 +3371,15 @@ % on the list which indicate that case changing should be skipped. That's % done using a loop as for the other special cases. If a hit is found then % the argument is grabbed: that comes \emph{after} the loop function which -% is therefore rearranged. +% is therefore rearranged. In a \LaTeXe{} context, \tn{protect} needs +% to be treated specially, to prevent expansion of the next token but +% output it without braces. % \begin{macrocode} \cs_new:Npn \@@_change_case_cs:N #1 { +%<*package> + \str_if_eq:nnTF {#1} { \protect } { \@@_change_case_protect:wNN } +%</package> \exp_after:wN \@@_change_case_cs:NN \exp_after:wN #1 \l_tl_case_change_exclude_tl \q_recursion_tail \q_recursion_stop @@ -3366,6 +3403,10 @@ \@@_change_case_output:nwn { #1 {#3} } #2 } +%<*package> +\cs_new:Npn \@@_change_case_protect:wNN #1 \q_recursion_stop #2 #3 + { \@@_change_case_output:nwn { \protect #3 } #2 } +%</package> % \end{macrocode} % When a control sequence is not on the exclude list the other test if % to see if it is expandable. Once again, if there is a hit then the loop @@ -3430,6 +3471,7 @@ % \end{macro} % \end{macro} % \end{macro} +% \end{macro} % % \begin{macro}[aux, EXP]{\@@_change_case_lower_sigma:Nnw} % \begin{macro}[aux, EXP]{\@@_change_case_lower_sigma:w} @@ -4386,7 +4428,7 @@ % \begin{macro}{\tl_log:N, \tl_log:c} % Redirect output of \cs{tl_show:N} to the log. % \begin{macrocode} -\cs_new_protected_nopar:Npn \tl_log:N +\cs_new_protected:Npn \tl_log:N { \__msg_log_next: \tl_show:N } \cs_generate_variant:Nn \tl_log:N { c } % \end{macrocode} @@ -4395,7 +4437,7 @@ % \begin{macro}{\tl_log:n} % Redirect output of \cs{tl_show:n} to the log. % \begin{macrocode} -\cs_new_protected_nopar:Npn \tl_log:n +\cs_new_protected:Npn \tl_log:n { \__msg_log_next: \tl_show:n } % \end{macrocode} % \end{macro} @@ -4435,7 +4477,7 @@ \group_begin: \cs_set_protected:Npn \@@_tmp:w #1 \q_stop { - \cs_new_protected_nopar:Npn \@@_execute_branches_N_type: + \cs_new_protected:Npn \@@_execute_branches_N_type: { \if_int_odd:w \if_catcode:w \exp_not:N \l_peek_token { \c_two \fi: @@ -4464,11 +4506,11 @@ { \@@_true:w } { \tl_if_empty:nTF {#2} { \@@_true:w } { \@@_false:w } } } -\cs_new_protected_nopar:Npn \peek_N_type:TF +\cs_new_protected:Npn \peek_N_type:TF { \@@_token_generic:NNTF \@@_execute_branches_N_type: \scan_stop: } -\cs_new_protected_nopar:Npn \peek_N_type:T +\cs_new_protected:Npn \peek_N_type:T { \@@_token_generic:NNT \@@_execute_branches_N_type: \scan_stop: } -\cs_new_protected_nopar:Npn \peek_N_type:F +\cs_new_protected:Npn \peek_N_type:F { \@@_token_generic:NNF \@@_execute_branches_N_type: \scan_stop: } % \end{macrocode} % \end{macro} |