diff options
author | Karl Berry <karl@freefriends.org> | 2019-09-29 21:16:44 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2019-09-29 21:16:44 +0000 |
commit | cde95caf86c78ec9b7641198abfd0a7768f5100e (patch) | |
tree | dd771c114615e169fe3bde469f39dcac3a7ce074 /Master/texmf-dist/source/latex/l3kernel/l3prg.dtx | |
parent | 35c007d48195f11757c61c71a9a0eb88420dc9d0 (diff) |
l3 (29sep19)
git-svn-id: svn://tug.org/texlive/trunk@52214 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/l3kernel/l3prg.dtx')
-rw-r--r-- | Master/texmf-dist/source/latex/l3kernel/l3prg.dtx | 29 |
1 files changed, 22 insertions, 7 deletions
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3prg.dtx b/Master/texmf-dist/source/latex/l3kernel/l3prg.dtx index 29e41e5aa06..14a9a789b6c 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3prg.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3prg.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2019-09-19} +% \date{Released 2019-09-28} % % \maketitle % @@ -252,6 +252,15 @@ % \meta{boolean} is initially \texttt{false}. % \end{function} % +% \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} % { % \bool_set_false:N , \bool_set_false:c , @@ -823,6 +832,18 @@ % \end{macrocode} % \end{macro} % +% \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} +\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} % { % \bool_set_true:N, \bool_set_true:c, @@ -836,16 +857,12 @@ % make sure the boolean exists. This is needed because booleans are % not based on token lists nor on \TeX{} registers. % \begin{macrocode} -\__kernel_patch:nnNNpn { \__kernel_chk_var_local:N #1 } { } \cs_new_protected:Npn \bool_set_true:N #1 { \cs_set_eq:NN #1 \c_true_bool } -\__kernel_patch:nnNNpn { \__kernel_chk_var_local:N #1 } { } \cs_new_protected:Npn \bool_set_false:N #1 { \cs_set_eq:NN #1 \c_false_bool } -\__kernel_patch:nnNNpn { \__kernel_chk_var_global:N #1 } { } \cs_new_protected:Npn \bool_gset_true:N #1 { \cs_gset_eq:NN #1 \c_true_bool } -\__kernel_patch:nnNNpn { \__kernel_chk_var_global:N #1 } { } \cs_new_protected:Npn \bool_gset_false:N #1 { \cs_gset_eq:NN #1 \c_false_bool } \cs_generate_variant:Nn \bool_set_true:N { c } @@ -883,13 +900,11 @@ % primitive sets the left-hand side to \cs{scan_stop:} before looking % for the right-hand side. % \begin{macrocode} -\__kernel_patch:nnNNpn { \__kernel_chk_var_local:N #1 } { } \cs_new_protected:Npn \bool_set:Nn #1#2 { \exp_last_unbraced:NNNf \tex_chardef:D #1 = { \bool_if_p:n {#2} } } -\__kernel_patch:nnNNpn { \__kernel_chk_var_global:N #1 } { } \cs_new_protected:Npn \bool_gset:Nn #1#2 { \exp_last_unbraced:NNNNf |