[latex3-commits] [l3svn] 02/03: Reduce use of nopar in l3basics
noreply at latex-project.org
noreply at latex-project.org
Tue Jun 14 08:16:11 CEST 2016
This is an automated email from the git hooks/post-receive script.
joseph pushed a commit to branch master
in repository l3svn.
commit 9494e875bd645535782c89a3a44c4027d0ae36fa
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date: Tue Jun 14 07:01:53 2016 +0100
Reduce use of nopar in l3basics
This module obviously needs a reasonable number of
occurences of nopar. Removal here leaves things like
the definition of \l__exp_internal_tl alone. The nature
of \prg_do_nothing: is also unchanged as this may be relied
on elsewhere (to check).
The very early definitions, of \cs_set_protected:Npn, etc.,
have been adjusted not only for the reduction of nopar but
also as mixing \tex_long:D with e.g. \cs_set_nopar:Npn
seems sub-optimal. They now expand to the primitives directly.
There is no change in the behaviour nor number of expansion
steps as \cs_set_nopar:Npn is \let to \tex_def:D in any case:
the change is to make the fact that this is 'low level' and
requires TeX knowledge clear.
---
l3kernel/l3basics.dtx | 170 ++++++++++++++++++++++++-------------------------
1 file changed, 85 insertions(+), 85 deletions(-)
diff --git a/l3kernel/l3basics.dtx b/l3kernel/l3basics.dtx
index 8a4117e..bd464e3 100644
--- a/l3kernel/l3basics.dtx
+++ b/l3kernel/l3basics.dtx
@@ -1,6 +1,6 @@
% \iffalse meta-comment
%
-%% File: l3basics.dtx Copyright (C) 1990-2015 The LaTeX3 project
+%% File: l3basics.dtx Copyright (C) 1990-2016 The LaTeX3 project
%%
%% It may be distributed and/or modified under the conditions of the
%% LaTeX Project Public License (LPPL), either version 1.3c of this
@@ -1497,18 +1497,18 @@
% \begin{macrocode}
\tex_let:D \cs_set_nopar:Npn \tex_def:D
\tex_let:D \cs_set_nopar:Npx \tex_edef:D
-\etex_protected:D \cs_set_nopar:Npn \cs_set:Npn
- { \tex_long:D \cs_set_nopar:Npn }
-\etex_protected:D \cs_set_nopar:Npn \cs_set:Npx
- { \tex_long:D \cs_set_nopar:Npx }
-\etex_protected:D \cs_set_nopar:Npn \cs_set_protected_nopar:Npn
- { \etex_protected:D \cs_set_nopar:Npn }
-\etex_protected:D \cs_set_nopar:Npn \cs_set_protected_nopar:Npx
- { \etex_protected:D \cs_set_nopar:Npx }
-\cs_set_protected_nopar:Npn \cs_set_protected:Npn
- { \etex_protected:D \tex_long:D \cs_set_nopar:Npn }
-\cs_set_protected_nopar:Npn \cs_set_protected:Npx
- { \etex_protected:D \tex_long:D \cs_set_nopar:Npx }
+\etex_protected:D \tex_long:D \tex_def:D \cs_set:Npn
+ { \tex_long:D \tex_def:D }
+\etex_protected:D \tex_long:D \tex_def:D \cs_set:Npx
+ { \tex_long:D \tex_edef:D }
+\etex_protected:D \tex_long:D \tex_def:D \cs_set_protected_nopar:Npn
+ { \etex_protected:D \tex_def:D }
+\etex_protected:D \tex_long:D \tex_def:D \cs_set_protected_nopar:Npx
+ { \etex_protected:D \tex_edef:D }
+\etex_protected:D \tex_long:D \tex_def:D \cs_set_protected:Npn
+ { \etex_protected:D \tex_long:D \tex_def:D }
+\etex_protected:D \tex_long:D \tex_def:D \cs_set_protected:Npx
+ { \etex_protected:D \tex_long:D \tex_edef:D }
% \end{macrocode}
% \end{macro}
%
@@ -1523,18 +1523,18 @@
% \begin{macrocode}
\tex_let:D \cs_gset_nopar:Npn \tex_gdef:D
\tex_let:D \cs_gset_nopar:Npx \tex_xdef:D
-\cs_set_protected_nopar:Npn \cs_gset:Npn
- { \tex_long:D \cs_gset_nopar:Npn }
-\cs_set_protected_nopar:Npn \cs_gset:Npx
- { \tex_long:D \cs_gset_nopar:Npx }
-\cs_set_protected_nopar:Npn \cs_gset_protected_nopar:Npn
- { \etex_protected:D \cs_gset_nopar:Npn }
-\cs_set_protected_nopar:Npn \cs_gset_protected_nopar:Npx
- { \etex_protected:D \cs_gset_nopar:Npx }
-\cs_set_protected_nopar:Npn \cs_gset_protected:Npn
- { \etex_protected:D \tex_long:D \cs_gset_nopar:Npn }
-\cs_set_protected_nopar:Npn \cs_gset_protected:Npx
- { \etex_protected:D \tex_long:D \cs_gset_nopar:Npx }
+\cs_set_protected:Npn \cs_gset:Npn
+ { \tex_long:D \tex_gdef:D }
+\cs_set_protected:Npn \cs_gset:Npx
+ { \tex_long:D \tex_xdef:D }
+\cs_set_protected:Npn \cs_gset_protected_nopar:Npn
+ { \etex_protected:D \tex_gdef:D }
+\cs_set_protected:Npn \cs_gset_protected_nopar:Npx
+ { \etex_protected:D \tex_xdef:D }
+\cs_set_protected:Npn \cs_gset_protected:Npn
+ { \etex_protected:D \tex_long:D \tex_gdef:D }
+\cs_set_protected:Npn \cs_gset_protected:Npx
+ { \etex_protected:D \tex_long:D \tex_xdef:D }
% \end{macrocode}
% \end{macro}
%
@@ -1703,9 +1703,9 @@
% at least two tokens: see how the logical tests are actually implemented
% to see this.
% \begin{macrocode}
-\cs_set_nopar:Npn \prg_return_true:
+\cs_set:Npn \prg_return_true:
{ \exp_after:wN \use_i:nn \exp:w }
-\cs_set_nopar:Npn \prg_return_false:
+\cs_set:Npn \prg_return_false:
{ \exp_after:wN \use_ii:nn \exp:w}
% \end{macrocode}
% An extended state space could be implemented by including a more
@@ -1731,13 +1731,13 @@
% \Arg{code} to the auxiliary function responsible for defining all
% conditionals.
% \begin{macrocode}
-\cs_set_protected_nopar:Npn \prg_set_conditional:Npnn
+\cs_set_protected:Npn \prg_set_conditional:Npnn
{ \__prg_generate_conditional_parm:nnNpnn { set } { } }
-\cs_set_protected_nopar:Npn \prg_new_conditional:Npnn
+\cs_set_protected:Npn \prg_new_conditional:Npnn
{ \__prg_generate_conditional_parm:nnNpnn { new } { } }
-\cs_set_protected_nopar:Npn \prg_set_protected_conditional:Npnn
+\cs_set_protected:Npn \prg_set_protected_conditional:Npnn
{ \__prg_generate_conditional_parm:nnNpnn { set } { _protected } }
-\cs_set_protected_nopar:Npn \prg_new_protected_conditional:Npnn
+\cs_set_protected:Npn \prg_new_protected_conditional:Npnn
{ \__prg_generate_conditional_parm:nnNpnn { new } { _protected } }
\cs_set_protected:Npn \__prg_generate_conditional_parm:nnNpnn #1#2#3#4#
{
@@ -1773,13 +1773,13 @@
% erroneous case where the function name contains no colon is captured
% later.
% \begin{macrocode}
-\cs_set_protected_nopar:Npn \prg_set_conditional:Nnn
+\cs_set_protected:Npn \prg_set_conditional:Nnn
{ \__prg_generate_conditional_count:nnNnn { set } { } }
-\cs_set_protected_nopar:Npn \prg_new_conditional:Nnn
+\cs_set_protected:Npn \prg_new_conditional:Nnn
{ \__prg_generate_conditional_count:nnNnn { new } { } }
-\cs_set_protected_nopar:Npn \prg_set_protected_conditional:Nnn
+\cs_set_protected:Npn \prg_set_protected_conditional:Nnn
{ \__prg_generate_conditional_count:nnNnn { set } { _protected } }
-\cs_set_protected_nopar:Npn \prg_new_protected_conditional:Nnn
+\cs_set_protected:Npn \prg_new_protected_conditional:Nnn
{ \__prg_generate_conditional_count:nnNnn { new } { _protected } }
\cs_set_protected:Npn \__prg_generate_conditional_count:nnNnn #1#2#3
{
@@ -1926,9 +1926,9 @@
% |,| \cs{q_recursion_stop}
% to a first auxiliary.
% \begin{macrocode}
-\cs_set_protected_nopar:Npn \prg_set_eq_conditional:NNn
+\cs_set_protected:Npn \prg_set_eq_conditional:NNn
{ \__prg_set_eq_conditional:NNNn \cs_set_eq:cc }
-\cs_set_protected_nopar:Npn \prg_new_eq_conditional:NNn
+\cs_set_protected:Npn \prg_new_eq_conditional:NNn
{ \__prg_set_eq_conditional:NNNn \cs_new_eq:cc }
\cs_set_protected:Npn \__prg_set_eq_conditional:NNNn #1#2#3#4
{
@@ -2084,7 +2084,7 @@
% In all three cases, \cs{cs_to_str:N} takes two expansion steps
% to be fully expanded.
% \begin{macrocode}
-\cs_set_nopar:Npn \cs_to_str:N
+\cs_set:Npn \cs_to_str:N
{
% \end{macrocode}
% We implement the expansion scheme using \cs{tex_romannumeral:D}
@@ -2297,9 +2297,9 @@
% similar one for writing to both the log file and the terminal.
% These will be redefined later by \pkg{l3io}.
% \begin{macrocode}
-\cs_set_protected_nopar:Npn \iow_log:x
+\cs_set_protected:Npn \iow_log:x
{ \tex_immediate:D \tex_write:D \c_minus_one }
-\cs_set_protected_nopar:Npn \iow_term:x
+\cs_set_protected:Npn \iow_term:x
{ \tex_immediate:D \tex_write:D \c_sixteen }
% \end{macrocode}
% \end{macro}
@@ -2317,29 +2317,29 @@
% before that point.
% \begin{macrocode}
%<*initex>
-\cs_set_protected_nopar:Npn \__chk_log:x { \use_none:n }
-\cs_set_protected_nopar:Npn \__chk_suspend_log: { }
-\cs_set_protected_nopar:Npn \__chk_resume_log: { }
+\cs_set_protected:Npn \__chk_log:x { \use_none:n }
+\cs_set_protected:Npn \__chk_suspend_log: { }
+\cs_set_protected:Npn \__chk_resume_log: { }
%</initex>
%<*package>
\tex_ifodd:D \l at expl@log at functions@bool
- \cs_set_protected_nopar:Npn \__chk_log:x { \iow_log:x }
- \cs_set_protected_nopar:Npn \__chk_suspend_log:
+ \cs_set_protected:Npn \__chk_log:x { \iow_log:x }
+ \cs_set_protected:Npn \__chk_suspend_log:
{
- \cs_set_protected_nopar:Npx \__chk_resume_log:
+ \cs_set_protected:Npx \__chk_resume_log:
{
- \cs_set_protected_nopar:Npn \__chk_resume_log:
+ \cs_set_protected:Npn \__chk_resume_log:
{ \exp_not:o { \__chk_resume_log: } }
- \cs_set_protected_nopar:Npn \__chk_log:x
+ \cs_set_protected:Npn \__chk_log:x
{ \exp_not:o { \__chk_log:x } }
}
- \cs_set_protected_nopar:Npn \__chk_log:x { \use_none:n }
+ \cs_set_protected:Npn \__chk_log:x { \use_none:n }
}
- \cs_set_protected_nopar:Npn \__chk_resume_log: { }
+ \cs_set_protected:Npn \__chk_resume_log: { }
\else:
- \cs_set_protected_nopar:Npn \__chk_log:x { \use_none:n }
- \cs_set_protected_nopar:Npn \__chk_suspend_log: { }
- \cs_set_protected_nopar:Npn \__chk_resume_log: { }
+ \cs_set_protected:Npn \__chk_log:x { \use_none:n }
+ \cs_set_protected:Npn \__chk_suspend_log: { }
+ \cs_set_protected:Npn \__chk_resume_log: { }
\fi:
%</package>
% \end{macrocode}
@@ -2376,7 +2376,7 @@
% \begin{macro}[rEXP]{\msg_line_context:}
% Another one from \pkg{l3msg} which will be altered later.
% \begin{macrocode}
-\cs_set_nopar:Npn \msg_line_context:
+\cs_set:Npn \msg_line_context:
{ on~line~ \tex_the:D \tex_inputlineno:D }
% \end{macrocode}
% \end{macro}
@@ -2411,7 +2411,7 @@
}
\fi:
%</package>
-\cs_set_protected_nopar:Npn \__chk_if_free_cs:c
+\cs_set_protected:Npn \__chk_if_free_cs:c
{ \exp_args:Nc \__chk_if_free_cs:N }
% \end{macrocode}
% \end{macro}
@@ -2447,7 +2447,7 @@
{ \token_to_str:N #1 }
}
}
-\cs_set_protected_nopar:Npn \__chk_if_exist_cs:c
+\cs_set_protected:Npn \__chk_if_exist_cs:c
{ \exp_args:Nc \__chk_if_exist_cs:N }
% \end{macrocode}
% \end{macro}
@@ -2589,21 +2589,21 @@
% \enquote{runaway argument}.
% \begin{macrocode}
\cs_new_protected:Npn \cs_set_eq:NN #1 { \tex_let:D #1 =~ }
-\cs_new_protected_nopar:Npn \cs_set_eq:cN { \exp_args:Nc \cs_set_eq:NN }
-\cs_new_protected_nopar:Npn \cs_set_eq:Nc { \exp_args:NNc \cs_set_eq:NN }
-\cs_new_protected_nopar:Npn \cs_set_eq:cc { \exp_args:Ncc \cs_set_eq:NN }
-\cs_new_protected_nopar:Npn \cs_gset_eq:NN { \tex_global:D \cs_set_eq:NN }
-\cs_new_protected_nopar:Npn \cs_gset_eq:Nc { \exp_args:NNc \cs_gset_eq:NN }
-\cs_new_protected_nopar:Npn \cs_gset_eq:cN { \exp_args:Nc \cs_gset_eq:NN }
-\cs_new_protected_nopar:Npn \cs_gset_eq:cc { \exp_args:Ncc \cs_gset_eq:NN }
+\cs_new_protected:Npn \cs_set_eq:cN { \exp_args:Nc \cs_set_eq:NN }
+\cs_new_protected:Npn \cs_set_eq:Nc { \exp_args:NNc \cs_set_eq:NN }
+\cs_new_protected:Npn \cs_set_eq:cc { \exp_args:Ncc \cs_set_eq:NN }
+\cs_new_protected:Npn \cs_gset_eq:NN { \tex_global:D \cs_set_eq:NN }
+\cs_new_protected:Npn \cs_gset_eq:Nc { \exp_args:NNc \cs_gset_eq:NN }
+\cs_new_protected:Npn \cs_gset_eq:cN { \exp_args:Nc \cs_gset_eq:NN }
+\cs_new_protected:Npn \cs_gset_eq:cc { \exp_args:Ncc \cs_gset_eq:NN }
\cs_new_protected:Npn \cs_new_eq:NN #1
{
\__chk_if_free_cs:N #1
\tex_global:D \cs_set_eq:NN #1
}
-\cs_new_protected_nopar:Npn \cs_new_eq:cN { \exp_args:Nc \cs_new_eq:NN }
-\cs_new_protected_nopar:Npn \cs_new_eq:Nc { \exp_args:NNc \cs_new_eq:NN }
-\cs_new_protected_nopar:Npn \cs_new_eq:cc { \exp_args:Ncc \cs_new_eq:NN }
+\cs_new_protected:Npn \cs_new_eq:cN { \exp_args:Nc \cs_new_eq:NN }
+\cs_new_protected:Npn \cs_new_eq:Nc { \exp_args:NNc \cs_new_eq:NN }
+\cs_new_protected:Npn \cs_new_eq:cc { \exp_args:Ncc \cs_new_eq:NN }
% \end{macrocode}
% \end{macro}
%
@@ -2700,7 +2700,7 @@
\c_minus_one
\fi:
}
-\cs_new_nopar:Npn \__cs_count_signature:c
+\cs_new:Npn \__cs_count_signature:c
{ \exp_args:Nc \__cs_count_signature:N }
% \end{macrocode}
% \end{macro}
@@ -2737,9 +2737,9 @@
% A variant form we need right away, plus one which is used elsewhere but
% which is most logically created here.
% \begin{macrocode}
-\cs_new_protected_nopar:Npn \cs_generate_from_arg_count:cNnn
+\cs_new_protected:Npn \cs_generate_from_arg_count:cNnn
{ \exp_args:Nc \cs_generate_from_arg_count:NNnn }
-\cs_new_protected_nopar:Npn \cs_generate_from_arg_count:Ncnn
+\cs_new_protected:Npn \cs_generate_from_arg_count:Ncnn
{ \exp_args:NNc \cs_generate_from_arg_count:NNnn }
% \end{macrocode}
% \end{macro}
@@ -2781,7 +2781,7 @@
% \begin{macrocode}
\cs_set:Npn \__cs_tmp:w #1#2#3
{
- \cs_new_protected_nopar:cpx { cs_ #1 : #2 }
+ \cs_new_protected:cpx { cs_ #1 : #2 }
{
\exp_not:N \__cs_generate_from_signature:NNn
\exp_after:wN \exp_not:N \cs:w cs_ #1 : #3 \cs_end:
@@ -2853,7 +2853,7 @@
% \begin{macrocode}
\cs_set:Npn \__cs_tmp:w #1#2
{
- \cs_new_protected_nopar:cpx { cs_ #1 : c #2 }
+ \cs_new_protected:cpx { cs_ #1 : c #2 }
{
\exp_not:N \exp_args:Nc
\exp_after:wN \exp_not:N \cs:w cs_ #1 : N #2 \cs_end:
@@ -2897,18 +2897,18 @@
\if_meaning:w #1#2
\prg_return_true: \else: \prg_return_false: \fi:
}
-\cs_new_nopar:Npn \cs_if_eq_p:cN { \exp_args:Nc \cs_if_eq_p:NN }
-\cs_new_nopar:Npn \cs_if_eq:cNTF { \exp_args:Nc \cs_if_eq:NNTF }
-\cs_new_nopar:Npn \cs_if_eq:cNT { \exp_args:Nc \cs_if_eq:NNT }
-\cs_new_nopar:Npn \cs_if_eq:cNF { \exp_args:Nc \cs_if_eq:NNF }
-\cs_new_nopar:Npn \cs_if_eq_p:Nc { \exp_args:NNc \cs_if_eq_p:NN }
-\cs_new_nopar:Npn \cs_if_eq:NcTF { \exp_args:NNc \cs_if_eq:NNTF }
-\cs_new_nopar:Npn \cs_if_eq:NcT { \exp_args:NNc \cs_if_eq:NNT }
-\cs_new_nopar:Npn \cs_if_eq:NcF { \exp_args:NNc \cs_if_eq:NNF }
-\cs_new_nopar:Npn \cs_if_eq_p:cc { \exp_args:Ncc \cs_if_eq_p:NN }
-\cs_new_nopar:Npn \cs_if_eq:ccTF { \exp_args:Ncc \cs_if_eq:NNTF }
-\cs_new_nopar:Npn \cs_if_eq:ccT { \exp_args:Ncc \cs_if_eq:NNT }
-\cs_new_nopar:Npn \cs_if_eq:ccF { \exp_args:Ncc \cs_if_eq:NNF }
+\cs_new:Npn \cs_if_eq_p:cN { \exp_args:Nc \cs_if_eq_p:NN }
+\cs_new:Npn \cs_if_eq:cNTF { \exp_args:Nc \cs_if_eq:NNTF }
+\cs_new:Npn \cs_if_eq:cNT { \exp_args:Nc \cs_if_eq:NNT }
+\cs_new:Npn \cs_if_eq:cNF { \exp_args:Nc \cs_if_eq:NNF }
+\cs_new:Npn \cs_if_eq_p:Nc { \exp_args:NNc \cs_if_eq_p:NN }
+\cs_new:Npn \cs_if_eq:NcTF { \exp_args:NNc \cs_if_eq:NNTF }
+\cs_new:Npn \cs_if_eq:NcT { \exp_args:NNc \cs_if_eq:NNT }
+\cs_new:Npn \cs_if_eq:NcF { \exp_args:NNc \cs_if_eq:NNF }
+\cs_new:Npn \cs_if_eq_p:cc { \exp_args:Ncc \cs_if_eq_p:NN }
+\cs_new:Npn \cs_if_eq:ccTF { \exp_args:Ncc \cs_if_eq:NNTF }
+\cs_new:Npn \cs_if_eq:ccT { \exp_args:Ncc \cs_if_eq:NNT }
+\cs_new:Npn \cs_if_eq:ccF { \exp_args:Ncc \cs_if_eq:NNF }
% \end{macrocode}
% \end{macro}
%
@@ -2926,7 +2926,7 @@
\__msg_show_variable:NNNnn #1 \cs_if_exist:NTF ? { }
{ > ~ \token_to_str:N #1 = \tex_the:D #1 }
}
-\cs_new_protected_nopar:Npn \__kernel_register_show:c
+\cs_new_protected:Npn \__kernel_register_show:c
{ \exp_args:Nc \__kernel_register_show:N }
% \end{macrocode}
% \end{macro}
@@ -2942,7 +2942,7 @@
% \begin{macrocode}
\cs_new_protected:Npn \cs_show:N #1
{ \__msg_show_wrap:n { > ~ \token_to_str:N #1 = \cs_meaning:N #1 } }
-\cs_new_protected_nopar:Npn \cs_show:c
+\cs_new_protected:Npn \cs_show:c
{ \group_begin: \exp_args:NNc \group_end: \cs_show:N }
% \end{macrocode}
% \end{macro}
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the latex3-commits
mailing list