summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/l3kernel/l3basics.sty
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/l3kernel/l3basics.sty')
-rw-r--r--Master/texmf-dist/tex/latex/l3kernel/l3basics.sty229
1 files changed, 93 insertions, 136 deletions
diff --git a/Master/texmf-dist/tex/latex/l3kernel/l3basics.sty b/Master/texmf-dist/tex/latex/l3kernel/l3basics.sty
index 8034a2ff274..ea2bafefc9e 100644
--- a/Master/texmf-dist/tex/latex/l3kernel/l3basics.sty
+++ b/Master/texmf-dist/tex/latex/l3kernel/l3basics.sty
@@ -22,7 +22,7 @@
%%
%% http://www.latex-project.org/lppl.txt
%%
-%% This file is part of the "expl3 bundle" (The Work in LPPL)
+%% This file is part of the "l3kernel bundle" (The Work in LPPL)
%% and all files in that bundle must be distributed together.
%%
%% The released version of this bundle is available from CTAN.
@@ -46,82 +46,80 @@
%%
%% -----------------------------------------------------------------------
\RequirePackage{l3names}
-\GetIdInfo$Id: l3basics.dtx 2689 2011-08-29 19:50:38Z joseph $
+\GetIdInfo$Id: l3basics.dtx 2817 2011-09-12 14:16:56Z joseph $
{L3 Experimental basic definitions}
-
\ProvidesExplPackage
{\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription}
\package_check_loaded_expl:
-\tex_let:D \cs_set_eq:NwN \tex_let:D
-\cs_set_eq:NwN \if_true: \tex_iftrue:D
-\cs_set_eq:NwN \if_false: \tex_iffalse:D
-\cs_set_eq:NwN \or: \tex_or:D
-\cs_set_eq:NwN \else: \tex_else:D
-\cs_set_eq:NwN \fi: \tex_fi:D
-\cs_set_eq:NwN \reverse_if:N \etex_unless:D
-\cs_set_eq:NwN \if:w \tex_if:D
-\cs_set_eq:NwN \if_bool:N \tex_ifodd:D
-\cs_set_eq:NwN \if_predicate:w \tex_ifodd:D
-\cs_set_eq:NwN \if_charcode:w \tex_if:D
-\cs_set_eq:NwN \if_catcode:w \tex_ifcat:D
-\cs_set_eq:NwN \if_meaning:w \tex_ifx:D
-\cs_set_eq:NwN \if_mode_math: \tex_ifmmode:D
-\cs_set_eq:NwN \if_mode_horizontal: \tex_ifhmode:D
-\cs_set_eq:NwN \if_mode_vertical: \tex_ifvmode:D
-\cs_set_eq:NwN \if_mode_inner: \tex_ifinner:D
-\cs_set_eq:NwN \if_cs_exist:N \etex_ifdefined:D
-\cs_set_eq:NwN \if_cs_exist:w \etex_ifcsname:D
-\cs_set_eq:NwN \exp_after:wN \tex_expandafter:D
-\cs_set_eq:NwN \exp_not:N \tex_noexpand:D
-\cs_set_eq:NwN \exp_not:n \etex_unexpanded:D
-\cs_set_eq:NwN \token_to_meaning:N \tex_meaning:D
-\cs_set_eq:NwN \token_to_str:N \tex_string:D
-\cs_set_eq:NwN \cs:w \tex_csname:D
-\cs_set_eq:NwN \cs_end: \tex_endcsname:D
-\cs_set_eq:NwN \cs_meaning:N \tex_meaning:D
-\cs_set_eq:NwN \cs_show:N \tex_show:D
-\cs_set_eq:NwN \scan_stop: \tex_relax:D
-\cs_set_eq:NwN \group_begin: \tex_begingroup:D
-\cs_set_eq:NwN \group_end: \tex_endgroup:D
-\cs_set_eq:NwN \if_int_compare:w \tex_ifnum:D
-\cs_set_eq:NwN \int_to_roman:w \tex_romannumeral:D
-\cs_set_eq:NwN \group_insert_after:N \tex_aftergroup:D
-\cs_set_eq:NwN \pref_global:D \tex_global:D
-\cs_set_eq:NwN \pref_long:D \tex_long:D
-\cs_set_eq:NwN \pref_protected:D \etex_protected:D
+\tex_let:D \if_true: \tex_iftrue:D
+\tex_let:D \if_false: \tex_iffalse:D
+\tex_let:D \or: \tex_or:D
+\tex_let:D \else: \tex_else:D
+\tex_let:D \fi: \tex_fi:D
+\tex_let:D \reverse_if:N \etex_unless:D
+\tex_let:D \if:w \tex_if:D
+\tex_let:D \if_bool:N \tex_ifodd:D
+\tex_let:D \if_predicate:w \tex_ifodd:D
+\tex_let:D \if_charcode:w \tex_if:D
+\tex_let:D \if_catcode:w \tex_ifcat:D
+\tex_let:D \if_meaning:w \tex_ifx:D
+\tex_let:D \if_mode_math: \tex_ifmmode:D
+\tex_let:D \if_mode_horizontal: \tex_ifhmode:D
+\tex_let:D \if_mode_vertical: \tex_ifvmode:D
+\tex_let:D \if_mode_inner: \tex_ifinner:D
+\tex_let:D \if_cs_exist:N \etex_ifdefined:D
+\tex_let:D \if_cs_exist:w \etex_ifcsname:D
+\tex_let:D \exp_after:wN \tex_expandafter:D
+\tex_let:D \exp_not:N \tex_noexpand:D
+\tex_let:D \exp_not:n \etex_unexpanded:D
+\tex_let:D \token_to_meaning:N \tex_meaning:D
+\tex_let:D \token_to_str:N \tex_string:D
+\tex_let:D \cs:w \tex_csname:D
+\tex_let:D \cs_end: \tex_endcsname:D
+\tex_let:D \cs_meaning:N \tex_meaning:D
+\tex_let:D \cs_show:N \tex_show:D
+\tex_let:D \scan_stop: \tex_relax:D
+\tex_let:D \group_begin: \tex_begingroup:D
+\tex_let:D \group_end: \tex_endgroup:D
+\tex_let:D \if_int_compare:w \tex_ifnum:D
+\tex_let:D \int_to_roman:w \tex_romannumeral:D
+\tex_let:D \group_insert_after:N \tex_aftergroup:D
+\tex_let:D \tex_global:D \tex_global:D
+\tex_let:D \tex_long:D \tex_long:D
+\tex_let:D \tex_protected:D \etex_protected:D
\tex_long:D \tex_def:D \exp_args:Nc #1#2 { \exp_after:wN #1 \cs:w #2 \cs_end: }
%% A small number of variants by hand.
\tex_def:D \cs_meaning:c { \exp_args:Nc \cs_meaning:N }
\tex_def:D \token_to_str:c { \exp_args:Nc \token_to_str:N }
\tex_def:D \cs_show:c { \exp_args:Nc \cs_show:N }
-\cs_set_eq:NwN \cs_set_nopar:Npn \tex_def:D
-\cs_set_eq:NwN \cs_set_nopar:Npx \tex_edef:D
-\pref_protected:D \cs_set_nopar:Npn \cs_set:Npn
- { \pref_long:D \cs_set_nopar:Npn }
-\pref_protected:D \cs_set_nopar:Npn \cs_set:Npx
- { \pref_long:D \cs_set_nopar:Npx }
-\pref_protected:D \cs_set_nopar:Npn \cs_set_protected_nopar:Npn
- { \pref_protected:D \cs_set_nopar:Npn }
-\pref_protected:D \cs_set_nopar:Npn \cs_set_protected_nopar:Npx
- { \pref_protected:D \cs_set_nopar:Npx }
+\tex_let:D \cs_set_nopar:Npn \tex_def:D
+\tex_let:D \cs_set_nopar:Npx \tex_edef:D
+\tex_protected:D \cs_set_nopar:Npn \cs_set:Npn
+ { \tex_long:D \cs_set_nopar:Npn }
+\tex_protected:D \cs_set_nopar:Npn \cs_set:Npx
+ { \tex_long:D \cs_set_nopar:Npx }
+\tex_protected:D \cs_set_nopar:Npn \cs_set_protected_nopar:Npn
+ { \tex_protected:D \cs_set_nopar:Npn }
+\tex_protected:D \cs_set_nopar:Npn \cs_set_protected_nopar:Npx
+ { \tex_protected:D \cs_set_nopar:Npx }
\cs_set_protected_nopar:Npn \cs_set_protected:Npn
- { \pref_protected:D \pref_long:D \cs_set_nopar:Npn }
+ { \tex_protected:D \tex_long:D \cs_set_nopar:Npn }
\cs_set_protected_nopar:Npn \cs_set_protected:Npx
- { \pref_protected:D \pref_long:D \cs_set_nopar:Npx }
-\cs_set_eq:NwN \cs_gset_nopar:Npn \tex_gdef:D
-\cs_set_eq:NwN \cs_gset_nopar:Npx \tex_xdef:D
+ { \tex_protected:D \tex_long:D \cs_set_nopar:Npx }
+\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
- { \pref_long:D \cs_gset_nopar:Npn }
+ { \tex_long:D \cs_gset_nopar:Npn }
\cs_set_protected_nopar:Npn \cs_gset:Npx
- { \pref_long:D \cs_gset_nopar:Npx }
+ { \tex_long:D \cs_gset_nopar:Npx }
\cs_set_protected_nopar:Npn \cs_gset_protected_nopar:Npn
- { \pref_protected:D \cs_gset_nopar:Npn }
+ { \tex_protected:D \cs_gset_nopar:Npn }
\cs_set_protected_nopar:Npn \cs_gset_protected_nopar:Npx
- { \pref_protected:D \cs_gset_nopar:Npx }
+ { \tex_protected:D \cs_gset_nopar:Npx }
\cs_set_protected_nopar:Npn \cs_gset_protected:Npn
- { \pref_protected:D \pref_long:D \cs_gset_nopar:Npn }
+ { \tex_protected:D \tex_long:D \cs_gset_nopar:Npn }
\cs_set_protected_nopar:Npn \cs_gset_protected:Npx
- { \pref_protected:D \pref_long:D \cs_gset_nopar:Npx }
+ { \tex_protected:D \tex_long:D \cs_gset_nopar:Npx }
\cs_set:Npn \use:c #1 { \cs:w #1 \cs_end: }
\cs_set_protected:Npn \use:x #1
{
@@ -152,10 +150,6 @@
\cs_set:Npn \use_i_delimit_by_q_nil:nw #1#2 \q_nil {#1}
\cs_set:Npn \use_i_delimit_by_q_stop:nw #1#2 \q_stop {#1}
\cs_set:Npn \use_i_delimit_by_q_recursion_stop:nw #1#2 \q_recursion_stop {#1}
-\cs_set:Npn \use_i_after_fi:nw #1 \fi: { \fi: #1 }
-\cs_set:Npn \use_i_after_else:nw #1 \else: #2 \fi: { \fi: #1 }
-\cs_set:Npn \use_i_after_or:nw #1 \or: #2 \fi: { \fi: #1 }
-\cs_set:Npn \use_i_after_orelse:nw #1#2#3 \fi: { \fi: #1 }
\cs_set:Npn \use_none:n #1 { }
\cs_set:Npn \use_none:nn #1#2 { }
\cs_set:Npn \use_none:nnn #1#2#3 { }
@@ -426,7 +420,7 @@
}
{ \prg_return_true: }
}
-\cs_set_eq:NwN \c_minus_one \m@ne
+\tex_let:D \c_minus_one \m@ne
\tex_chardef:D \c_sixteen = 16~
\tex_chardef:D \c_zero = 0~
\tex_chardef:D \c_six = 6~
@@ -455,7 +449,6 @@
{ \msg_kernel_error:nnxx {#1} {#2} { } { } }
\cs_set_nopar:Npn \msg_line_context:
{ on~line~\tex_the:D \tex_inputlineno:D }
-\cs_set:Npn \cs_record_meaning:N #1 { }
\cs_set_protected_nopar:Npn \chk_if_free_cs:N #1
{
\cs_if_free:NF #1
@@ -529,32 +522,19 @@
\cs_tmp:w \cs_gset_protected:cpx \cs_gset_protected:Npx
\cs_tmp:w \cs_new_protected:cpn \cs_new_protected:Npn
\cs_tmp:w \cs_new_protected:cpx \cs_new_protected:Npx
-\cs_new_nopar:cpn { use_0_parameter: } { }
-\cs_new_nopar:cpn { use_1_parameter: } { {##1} }
-\cs_new_nopar:cpn { use_2_parameter: } { {##1} {##2} }
-\cs_new_nopar:cpn { use_3_parameter: } { {##1} {##2} {##3} }
-\cs_new_nopar:cpn { use_4_parameter: } { {##1} {##2} {##3} {##4} }
-\cs_new_nopar:cpn { use_5_parameter: } { {##1} {##2} {##3} {##4} {##5} }
-\cs_new_nopar:cpn { use_6_parameter: } { {##1} {##2} {##3} {##4} {##5} {##6} }
-\cs_new_nopar:cpn { use_7_parameter: }
- { {##1} {##2} {##3} {##4} {##5}{##6} {##7} }
-\cs_new_nopar:cpn { use_8_parameter: }
- { {##1} {##2} {##3} {##4} {##5} {##6} {##7} {##8} }
-\cs_new_nopar:cpn{ use_9_parameter: }
- { {##1} {##2} {##3} {##4} {##5} {##6} {##7} {##8} {##9} }
-\cs_new_protected:Npn \cs_set_eq:NN #1 { \cs_set_eq:NwN #1 =~ }
+\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:Npn \cs_new_eq:NN #1
{
\chk_if_free_cs:N #1
- \pref_global:D \cs_set_eq:NN #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_nopar:Npn \cs_gset_eq:NN { \pref_global:D \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 }
@@ -583,34 +563,26 @@
\cs_new_protected:Npn \cs_generate_from_arg_count:NNnn #1#2#3#4
{
\if_case:w \int_eval:w #3 \int_eval_end:
- \use_i_after_orelse:nw {#2#1}
- \or:
- \use_i_after_orelse:nw {#2#1 ##1}
- \or:
- \use_i_after_orelse:nw {#2#1 ##1##2}
- \or:
- \use_i_after_orelse:nw {#2#1 ##1##2##3}
- \or:
- \use_i_after_orelse:nw {#2#1 ##1##2##3##4}
- \or:
- \use_i_after_orelse:nw {#2#1 ##1##2##3##4##5}
- \or:
- \use_i_after_orelse:nw {#2#1 ##1##2##3##4##5##6}
- \or:
- \use_i_after_orelse:nw {#2#1 ##1##2##3##4##5##6##7}
- \or:
- \use_i_after_orelse:nw {#2#1 ##1##2##3##4##5##6##7##8}
- \or:
- \use_i_after_orelse:nw {#2#1 ##1##2##3##4##5##6##7##8##9}
+ \cs_generate_from_arg_count_aux:nwn {}
+ \or: \cs_generate_from_arg_count_aux:nwn {##1}
+ \or: \cs_generate_from_arg_count_aux:nwn {##1##2}
+ \or: \cs_generate_from_arg_count_aux:nwn {##1##2##3}
+ \or: \cs_generate_from_arg_count_aux:nwn {##1##2##3##4}
+ \or: \cs_generate_from_arg_count_aux:nwn {##1##2##3##4##5}
+ \or: \cs_generate_from_arg_count_aux:nwn {##1##2##3##4##5##6}
+ \or: \cs_generate_from_arg_count_aux:nwn {##1##2##3##4##5##6##7}
+ \or: \cs_generate_from_arg_count_aux:nwn {##1##2##3##4##5##6##7##8}
+ \or: \cs_generate_from_arg_count_aux:nwn {##1##2##3##4##5##6##7##8##9}
\else:
- \use_i_after_fi:nw
- {
- \cs_generate_from_arg_count_error_msg:Nn #1 {#3}
- \use_none:n
- }
+ \cs_generate_from_arg_count_error_msg:Nn #1 {#3}
+ \use_i:nnn
\fi:
+ {#2#1}
{#4}
}
+\cs_new_protected_nopar:Npn
+ \cs_generate_from_arg_count_aux:nwn #1 #2 \fi: #3
+ { \fi: #3 #1 }
\cs_new_nopar:Npn \cs_generate_from_arg_count:cNnn
{ \exp_args:Nc \cs_generate_from_arg_count:NNnn }
\cs_new:Npn \cs_generate_from_arg_count_error_msg:Nn #1#2
@@ -719,9 +691,9 @@
\cs_new_eq:NN \xetex_if_engine:T \use_none:n
\cs_new_eq:NN \xetex_if_engine:F \use:n
\cs_new_eq:NN \xetex_if_engine:TF \use_ii:nn
-\cs_new_eq:NN \c_luatex_is_engine_bool \c_false_bool
-\cs_new_eq:NN \c_pdftex_is_engine_bool \c_true_bool
-\cs_new_eq:NN \c_xetex_is_engine_bool \c_false_bool
+\cs_new_eq:NN \luatex_if_engine_p: \c_false_bool
+\cs_new_eq:NN \pdftex_if_engine_p: \c_true_bool
+\cs_new_eq:NN \xetex_if_engine_p: \c_false_bool
\cs_if_exist:NT \xetex_XeTeXversion:D
{
\cs_set_eq:NN \pdftex_if_engine:T \use_none:n
@@ -730,8 +702,8 @@
\cs_set_eq:NN \xetex_if_engine:T \use:n
\cs_set_eq:NN \xetex_if_engine:F \use_none:n
\cs_set_eq:NN \xetex_if_engine:TF \use_i:nn
- \cs_set_eq:NN \c_pdftex_is_engine_bool \c_false_bool
- \cs_set_eq:NN \c_xetex_is_engine_bool \c_true_bool
+ \cs_set_eq:NN \pdftex_if_engine_p: \c_false_bool
+ \cs_set_eq:NN \xetex_if_engine_p: \c_true_bool
}
\cs_if_exist:NT \luatex_directlua:D
{
@@ -741,8 +713,8 @@
\cs_set_eq:NN \pdftex_if_engine:T \use_none:n
\cs_set_eq:NN \pdftex_if_engine:F \use:n
\cs_set_eq:NN \pdftex_if_engine:TF \use_ii:nn
- \cs_set_eq:NN \c_luatex_is_engine_bool \c_true_bool
- \cs_set_eq:NN \c_pdftex_is_engine_bool \c_false_bool
+ \cs_set_eq:NN \luatex_if_engine_p: \c_true_bool
+ \cs_set_eq:NN \pdftex_if_engine_p: \c_false_bool
}
\cs_new_nopar:Npn \prg_do_nothing: { }
\prg_new_conditional:Npnn \str_if_eq:nn #1#2 { p , T , F , TF }
@@ -756,29 +728,14 @@
\if_int_compare:w \pdftex_strcmp:D {#1} {#2} = \c_zero
\prg_return_true: \else: \prg_return_false: \fi:
}
-\cs_new_eq:NN \cs_gnew_nopar:Npn \cs_new_nopar:Npn
-\cs_new_eq:NN \cs_gnew:Npn \cs_new:Npn
-\cs_new_eq:NN \cs_gnew_protected_nopar:Npn \cs_new_protected_nopar:Npn
-\cs_new_eq:NN \cs_gnew_protected:Npn \cs_new_protected:Npn
-\cs_new_eq:NN \cs_gnew_nopar:Npx \cs_new_nopar:Npx
-\cs_new_eq:NN \cs_gnew:Npx \cs_new:Npx
-\cs_new_eq:NN \cs_gnew_protected_nopar:Npx \cs_new_protected_nopar:Npx
-\cs_new_eq:NN \cs_gnew_protected:Npx \cs_new_protected:Npx
-\cs_new_eq:NN \cs_gnew_nopar:cpn \cs_new_nopar:cpn
-\cs_new_eq:NN \cs_gnew:cpn \cs_new:cpn
-\cs_new_eq:NN \cs_gnew_protected_nopar:cpn \cs_new_protected_nopar:cpn
-\cs_new_eq:NN \cs_gnew_protected:cpn \cs_new_protected:cpn
-\cs_new_eq:NN \cs_gnew_nopar:cpx \cs_new_nopar:cpx
-\cs_new_eq:NN \cs_gnew:cpx \cs_new:cpx
-\cs_new_eq:NN \cs_gnew_protected_nopar:cpx \cs_new_protected_nopar:cpx
-\cs_new_eq:NN \cs_gnew_protected:cpx \cs_new_protected:cpx
-\cs_new_eq:NN \cs_gnew_eq:NN \cs_new_eq:NN
-\cs_new_eq:NN \cs_gnew_eq:cN \cs_new_eq:cN
-\cs_new_eq:NN \cs_gnew_eq:Nc \cs_new_eq:Nc
-\cs_new_eq:NN \cs_gnew_eq:cc \cs_new_eq:cc
-\cs_new_eq:NN \cs_gundefine:N \cs_undefine:N
-\cs_new_eq:NN \cs_gundefine:c \cs_undefine:c
-\cs_new_eq:NN \group_execute_after:N \group_insert_after:N
+\cs_new_eq:NN \c_luatex_is_engine_bool \luatex_if_engine_p:
+\cs_new_eq:NN \c_pdftex_is_engine_bool \pdftex_if_engine_p:
+\cs_new_eq:NN \c_xetex_is_engine_bool \xetex_if_engine_p:
+\cs_set:Npn \use_i_after_fi:nw #1 \fi: { \fi: #1 }
+\cs_set:Npn \use_i_after_else:nw #1 \else: #2 \fi: { \fi: #1 }
+\cs_set:Npn \use_i_after_or:nw #1 \or: #2 \fi: { \fi: #1 }
+\cs_set:Npn \use_i_after_orelse:nw #1#2#3 \fi: { \fi: #1 }
+\tex_let:D \cs_set_eq:NwN \tex_let:D
%%
%%
%% End of file `l3basics.sty'.