[latex3-commits] [git/LaTeX3-latex3-latex3] master: add __kernel_tl_set and __kernel_tl_gset (0fc23eb81)
Bruno Le Floch
blflatex at gmail.com
Tue Oct 27 09:11:58 CET 2020
Repository : https://github.com/latex3/latex3
On branch : master
Link : https://github.com/latex3/latex3/commit/0fc23eb81925abbabf0ad904094cd0c0915e2303
>---------------------------------------------------------------
commit 0fc23eb81925abbabf0ad904094cd0c0915e2303
Author: Jonathan Spratte <jspratte at yahoo.de>
Date: Fri Sep 18 15:07:50 2020 +0200
add __kernel_tl_set and __kernel_tl_gset
>---------------------------------------------------------------
0fc23eb81925abbabf0ad904094cd0c0915e2303
l3kernel/l3tl.dtx | 59 +++++++++++++++++++++++++++++++------------------------
1 file changed, 33 insertions(+), 26 deletions(-)
diff --git a/l3kernel/l3tl.dtx b/l3kernel/l3tl.dtx
index 342c3e35d..c2c752a48 100644
--- a/l3kernel/l3tl.dtx
+++ b/l3kernel/l3tl.dtx
@@ -1269,6 +1269,13 @@
%
% \subsection{Functions}
%
+% \begin{macro}{\__kernel_tl_set:Nx,\__kernel_tl_gset:Nx}
+% \begin{macrocode}
+\cs_new_eq:NN \__kernel_tl_set:Nx \cs_set_nopar:Npx
+\cs_new_eq:NN \__kernel_tl_gset:Nx \cs_gset_nopar:Npx
+% \end{macrocode}
+% \end{macro}
+%
% \begin{macro}{\tl_new:N, \tl_new:c}
% Creating new token list variables is a case of checking for an
% existing definition and doing the definition.
@@ -1288,12 +1295,12 @@
\cs_new_protected:Npn \tl_const:Nn #1#2
{
\__kernel_chk_if_free_cs:N #1
- \cs_gset_nopar:Npx #1 { \exp_not:n {#2} }
+ \__kernel_tl_gset:Nx #1 { \__kernel_exp_not:w {#2} }
}
\cs_new_protected:Npn \tl_const:Nx #1#2
{
\__kernel_chk_if_free_cs:N #1
- \cs_gset_nopar:Npx #1 {#2}
+ \__kernel_tl_gset:Nx #1 {#2}
}
\cs_generate_variant:Nn \tl_const:Nn { c }
\cs_generate_variant:Nn \tl_const:Nx { c }
@@ -1431,17 +1438,17 @@
% \enquote{by hand} as it is used quite a lot.
% \begin{macrocode}
\cs_new_protected:Npn \tl_set:Nn #1#2
- { \cs_set_nopar:Npx #1 { \exp_not:n {#2} } }
+ { \__kernel_tl_set:Nx #1 { \__kernel_exp_not:w {#2} } }
\cs_new_protected:Npn \tl_set:No #1#2
- { \cs_set_nopar:Npx #1 { \__kernel_exp_not:w \exp_after:wN {#2} } }
+ { \__kernel_tl_set:Nx #1 { \__kernel_exp_not:w \exp_after:wN {#2} } }
\cs_new_protected:Npn \tl_set:Nx #1#2
- { \cs_set_nopar:Npx #1 {#2} }
+ { \__kernel_tl_set:Nx #1 {#2} }
\cs_new_protected:Npn \tl_gset:Nn #1#2
- { \cs_gset_nopar:Npx #1 { \exp_not:n {#2} } }
+ { \__kernel_tl_gset:Nx #1 { \__kernel_exp_not:w {#2} } }
\cs_new_protected:Npn \tl_gset:No #1#2
- { \cs_gset_nopar:Npx #1 { \__kernel_exp_not:w \exp_after:wN {#2} } }
+ { \__kernel_tl_gset:Nx #1 { \__kernel_exp_not:w \exp_after:wN {#2} } }
\cs_new_protected:Npn \tl_gset:Nx #1#2
- { \cs_gset_nopar:Npx #1 {#2} }
+ { \__kernel_tl_gset:Nx #1 {#2} }
\cs_generate_variant:Nn \tl_set:Nn { NV , Nv , Nf }
\cs_generate_variant:Nn \tl_set:Nx { c }
\cs_generate_variant:Nn \tl_set:Nn { c, co , cV , cv , cf }
@@ -1466,44 +1473,44 @@
% \begin{macrocode}
\cs_new_protected:Npn \tl_put_left:Nn #1#2
{
- \cs_set_nopar:Npx #1
- { \exp_not:n {#2} \__kernel_exp_not:w \exp_after:wN {#1} }
+ \__kernel_tl_set:Nx #1
+ { \__kernel_exp_not:w {#2} \__kernel_exp_not:w \exp_after:wN {#1} }
}
\cs_new_protected:Npn \tl_put_left:NV #1#2
{
- \cs_set_nopar:Npx #1
+ \__kernel_tl_set:Nx #1
{ \exp_not:V #2 \__kernel_exp_not:w \exp_after:wN {#1} }
}
\cs_new_protected:Npn \tl_put_left:No #1#2
{
- \cs_set_nopar:Npx #1
+ \__kernel_tl_set:Nx #1
{
\__kernel_exp_not:w \exp_after:wN {#2}
\__kernel_exp_not:w \exp_after:wN {#1}
}
}
\cs_new_protected:Npn \tl_put_left:Nx #1#2
- { \cs_set_nopar:Npx #1 { #2 \__kernel_exp_not:w \exp_after:wN {#1} } }
+ { \__kernel_tl_set:Nx #1 { #2 \__kernel_exp_not:w \exp_after:wN {#1} } }
\cs_new_protected:Npn \tl_gput_left:Nn #1#2
{
- \cs_gset_nopar:Npx #1
- { \exp_not:n {#2} \__kernel_exp_not:w \exp_after:wN {#1} }
+ \__kernel_tl_gset:Nx #1
+ { \__kernel_exp_not:w {#2} \__kernel_exp_not:w \exp_after:wN {#1} }
}
\cs_new_protected:Npn \tl_gput_left:NV #1#2
{
- \cs_gset_nopar:Npx #1
+ \__kernel_tl_gset:Nx #1
{ \exp_not:V #2 \__kernel_exp_not:w \exp_after:wN {#1} }
}
\cs_new_protected:Npn \tl_gput_left:No #1#2
{
- \cs_gset_nopar:Npx #1
+ \__kernel_tl_gset:Nx #1
{
\__kernel_exp_not:w \exp_after:wN {#2}
\__kernel_exp_not:w \exp_after:wN {#1}
}
}
\cs_new_protected:Npn \tl_gput_left:Nx #1#2
- { \cs_gset_nopar:Npx #1 { #2 \__kernel_exp_not:w \exp_after:wN {#1} } }
+ { \__kernel_tl_gset:Nx #1 { #2 \__kernel_exp_not:w \exp_after:wN {#1} } }
\cs_generate_variant:Nn \tl_put_left:Nn { c }
\cs_generate_variant:Nn \tl_put_left:NV { c }
\cs_generate_variant:Nn \tl_put_left:No { c }
@@ -1531,39 +1538,39 @@
% The same on the right.
% \begin{macrocode}
\cs_new_protected:Npn \tl_put_right:Nn #1#2
- { \cs_set_nopar:Npx #1 { \__kernel_exp_not:w \exp_after:wN { #1 #2 } } }
+ { \__kernel_tl_set:Nx #1 { \__kernel_exp_not:w \exp_after:wN { #1 #2 } } }
\cs_new_protected:Npn \tl_put_right:NV #1#2
{
- \cs_set_nopar:Npx #1
+ \__kernel_tl_set:Nx #1
{ \__kernel_exp_not:w \exp_after:wN {#1} \exp_not:V #2 }
}
\cs_new_protected:Npn \tl_put_right:No #1#2
{
- \cs_set_nopar:Npx #1
+ \__kernel_tl_set:Nx #1
{
\__kernel_exp_not:w \exp_after:wN {#1}
\__kernel_exp_not:w \exp_after:wN {#2}
}
}
\cs_new_protected:Npn \tl_put_right:Nx #1#2
- { \cs_set_nopar:Npx #1 { \__kernel_exp_not:w \exp_after:wN {#1} #2 } }
+ { \__kernel_tl_set:Nx #1 { \__kernel_exp_not:w \exp_after:wN {#1} #2 } }
\cs_new_protected:Npn \tl_gput_right:Nn #1#2
- { \cs_gset_nopar:Npx #1 { \__kernel_exp_not:w \exp_after:wN { #1 #2 } } }
+ { \__kernel_tl_gset:Nx #1 { \__kernel_exp_not:w \exp_after:wN { #1 #2 } } }
\cs_new_protected:Npn \tl_gput_right:NV #1#2
{
- \cs_gset_nopar:Npx #1
+ \__kernel_tl_gset:Nx #1
{ \__kernel_exp_not:w \exp_after:wN {#1} \exp_not:V #2 }
}
\cs_new_protected:Npn \tl_gput_right:No #1#2
{
- \cs_gset_nopar:Npx #1
+ \__kernel_tl_gset:Nx #1
{
\__kernel_exp_not:w \exp_after:wN {#1}
\__kernel_exp_not:w \exp_after:wN {#2}
}
}
\cs_new_protected:Npn \tl_gput_right:Nx #1#2
- { \cs_gset_nopar:Npx #1 { \__kernel_exp_not:w \exp_after:wN {#1} #2 } }
+ { \__kernel_tl_gset:Nx #1 { \__kernel_exp_not:w \exp_after:wN {#1} #2 } }
\cs_generate_variant:Nn \tl_put_right:Nn { c }
\cs_generate_variant:Nn \tl_put_right:NV { c }
\cs_generate_variant:Nn \tl_put_right:No { c }
More information about the latex3-commits
mailing list.