[latex3-commits] [git/LaTeX3-latex3-latex3] master: Fixup l3trial/l3fp-extras after recent changes to l3fp (f5af4c7)
Bruno Le Floch
bruno at le-floch.fr
Mon Feb 12 03:28:26 CET 2018
Repository : https://github.com/latex3/latex3
On branch : master
Link : https://github.com/latex3/latex3/commit/f5af4c74e4d4250fe458d36932ca10e398b9c4f0
>---------------------------------------------------------------
commit f5af4c74e4d4250fe458d36932ca10e398b9c4f0
Author: Bruno Le Floch <bruno at le-floch.fr>
Date: Sun Feb 11 21:28:26 2018 -0500
Fixup l3trial/l3fp-extras after recent changes to l3fp
This is mostly deleting code that's now in l3fp
>---------------------------------------------------------------
f5af4c74e4d4250fe458d36932ca10e398b9c4f0
l3trial/l3fp-extras/l3fp-symbolic.dtx | 30 ++--
l3trial/l3fp-extras/l3fp-types.dtx | 180 +++-----------------
l3trial/l3fp-extras/testfiles/m3fp-symbolic001.tlg | 2 +-
3 files changed, 36 insertions(+), 176 deletions(-)
diff --git a/l3trial/l3fp-extras/l3fp-symbolic.dtx b/l3trial/l3fp-extras/l3fp-symbolic.dtx
index fefe1b4..edeae1d 100644
--- a/l3trial/l3fp-extras/l3fp-symbolic.dtx
+++ b/l3trial/l3fp-extras/l3fp-symbolic.dtx
@@ -334,20 +334,20 @@
%
% \begin{macro}[EXP, aux]
% {
-% \@@_acos_symbolic_o:w ,
-% \@@_acsc_symbolic_o:w ,
-% \@@_asec_symbolic_o:w ,
-% \@@_asin_symbolic_o:w ,
-% \@@_cos_symbolic_o:w ,
-% \@@_cot_symbolic_o:w ,
-% \@@_csc_symbolic_o:w ,
-% \@@_exp_symbolic_o:w ,
-% \@@_ln_symbolic_o:w ,
-% \@@_not_symbolic_o:w ,
-% \@@_sec_symbolic_o:w ,
-% \@@_set_sign_symbolic_o:w ,
-% \@@_sin_symbolic_o:w ,
-% \@@_tan_symbolic_o:w ,
+% \@@_symbolic_acos_o:w ,
+% \@@_symbolic_acsc_o:w ,
+% \@@_symbolic_asec_o:w ,
+% \@@_symbolic_asin_o:w ,
+% \@@_symbolic_cos_o:w ,
+% \@@_symbolic_cot_o:w ,
+% \@@_symbolic_csc_o:w ,
+% \@@_symbolic_exp_o:w ,
+% \@@_symbolic_ln_o:w ,
+% \@@_symbolic_not_o:w ,
+% \@@_symbolic_sec_o:w ,
+% \@@_symbolic_set_sign_o:w ,
+% \@@_symbolic_sin_o:w ,
+% \@@_symbolic_tan_o:w ,
% }
% \begin{macrocode}
\tl_map_inline:nn
@@ -356,7 +356,7 @@
{not} {sec} {set_sign} {sin} {sqrt} {tan}
}
{
- \cs_new_nopar:cpx { @@_#1_symbolic_o:w }
+ \cs_new_nopar:cpx { @@_symbolic_#1_o:w }
{
\exp_not:N \@@_symbolic_unary_o:NNw
\exp_not:c { @@_#1_o:w }
diff --git a/l3trial/l3fp-extras/l3fp-types.dtx b/l3trial/l3fp-extras/l3fp-types.dtx
index 3496126..3c2f5e5 100644
--- a/l3trial/l3fp-extras/l3fp-types.dtx
+++ b/l3trial/l3fp-extras/l3fp-types.dtx
@@ -1,6 +1,6 @@
% \iffalse
%
-%% File l3fp-types.dtx (C) Copyright 2012-2015,2017 The LaTeX3 Project
+%% File l3fp-types.dtx (C) Copyright 2012-2015,2017,2018 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
@@ -67,116 +67,30 @@
%
% \subsection{Support for types}
%
-% We redefine some \pkg{l3fp} internals to support types. Each
-% additional type must define
+% Despite lack of documentation, the \pkg{l3fp} internals support types.
+% Each additional type must define
% \begin{itemize}
% \item |\s__fp_|\meta{type} and |\__fp_|\meta{type}|_chk:w|;
+% \item |\__fp_exp_after_|\meta{type}|_f:nw|;
% \item |\__fp_|\meta{type}|_to_|\meta{out}|:w| for \meta{out} among
-% |decimal|, |int|, |scientific|, |tl|;
-% \item |\__fp_exp_after_|\meta{type}|_o:nw|;
-% \item |\__fp_|\meta{op}|_|\meta{type}|_o:w| for \meta{op} among
-% |acos|, |acsc|, |asec|, |asin|, |cos|, |cot|, |csc|, |exp|, |ln|,
-% |not|, |sec|, |set_sign|, |sin|, |tan|;
+% |decimal|, |scientific|, |tl|;
+% \end{itemize}
+% and may define
+% \begin{itemize}
+% \item |\__fp_|\meta{type}|_to_int:w| and |\__fp_|\meta{type}|_to_dim:w|;
+% \item |\__fp_|\meta{op}|_|\meta{type}|_o:w| for any of the \meta{op}
+% that the type implements, among |acos|, |acsc|, |asec|, |asin|,
+% |cos|, |cot|, |csc|, |exp|, |ln|, |not|, |sec|, |set_sign|, |sin|,
+% |tan|;
% \item |\__fp_|\meta{type_1}|_|\meta{op}|_|\meta{type_2}|_o:ww| for
-% \meta{op} among |^*/-+&|\verb"|" and for every other type;
+% \meta{op} among |^*/-+&|\verb"|" and for every pair of types;
% \item |\__fp_|\meta{type_1}|_bcmp_|\meta{type_2}|:ww| for every
-% other type;
+% pair of types.
% \end{itemize}
+% The latter is something added only by \pkg{l3fp-types} at present.
%
% \subsection{Redefining internals of \pkg{l3fp-parse}}
%
-% \begin{macro}[aux, EXP]{\@@_parse_apply_binary:NwNwN}
-% Receives \meta{precedence} \meta{operand_1} |@| \meta{operation}
-% \meta{operand_2} |@| \meta{infix command}. Builds the appropriate
-% call to the \meta{operation} |#4|, given the types of the two
-% \meta{operands}.
-% \begin{macrocode}
-\cs_undefine:N \@@_parse_apply_binary:NwNwN
-\cs_new:Npn \@@_parse_apply_binary:NwNwN #1 #2#3@ #4 #5#6@ #7
- {
- \exp_after:wN \@@_parse_continue:NwN
- \exp_after:wN #1
- \exp:w \exp_end_continue_f:w
- \cs:w
- @@
- \@@_type_from_scan:N #2
- _ #4
- \@@_type_from_scan:N #5
- _o:ww
- \cs_end:
- #2#3 #5#6
- \exp:w \exp_end_continue_f:w #7 #1
- }
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}[aux, EXP]{\@@_parse_unary_type:N}
-% Expects \cs{s_@@} or similar as~|#1|.
-% \begin{macrocode}
-\cs_new:Npn \@@_parse_unary_type:N #1
- { \@@_type_from_scan:N #1 _o:w \cs_end: #1 }
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}[EXP, aux]{\@@_parse_prefix_-:Nw, \@@_parse_prefix_!:Nw}
-% The unary~|-| and boolean not are harder than the unary~|+|: we
-% parse the operand using a precedence equal to the maximum of the
-% previous precedence~|##1| and the precedence \cs{c_@@_prec_not_int} of the
-% unary operator, then call the appropriate
-% |\__fp_|\meta{operation}\meta{type}|_o:w| function, where the
-% \meta{type} is extracted by \cs{@@_parse_unary_type:N} and the
-% \meta{operation} is |set_sign| or |not|.
-% \begin{macrocode}
-\cs_set_protected:Npn \@@_tmp:w #1#2#3#4
- {
- \cs_undefine:c { @@_parse_prefix_ #1 :Nw }
- \cs_new:cpn { @@_parse_prefix_ #1 :Nw } ##1
- {
- \exp_after:wN \@@_parse_apply_unary:NNNwN
- \exp_after:wN ##1
- \exp_after:wN #4
- \cs:w @@_#3 \exp_after:wN \@@_parse_unary_type:N
- \exp:w
- \if_int_compare:w #2 < ##1
- \@@_parse_operand:Nw ##1
- \else:
- \@@_parse_operand:Nw #2
- \fi:
- \@@_parse_expand:w
- }
- }
-\@@_tmp:w - \c_@@_prec_not_int { set_sign } 2
-\@@_tmp:w ! \c_@@_prec_not_int { not } ?
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}[aux, EXP]{\@@_parse_unary_function:NNN, \@@_parse_unary_aux:w}
-% This implements functions which expect one argument (|sin|, |ln|,
-% \ldots{}). Call the appropriate
-% |\__fp_|\meta{function}\meta{type}|_o:w| depending on the
-% \meta{type} of the operand.
-% \begin{macrocode}
-\cs_undefine:N \@@_parse_unary_function:NNN
-\cs_new:Npn \@@_parse_unary_function:NNN #1#2#3
- {
- \exp_after:wN \@@_parse_apply_unary:NNNwN
- \exp_after:wN #3
- \exp_after:wN #2
- \cs:w @@_
- \exp_after:wN \@@_parse_unary_aux:w \token_to_str:N #1
- \exp_after:wN \@@_parse_unary_type:N
- \exp:w
- \@@_parse_operand:Nw \c_@@_prec_func_int \@@_parse_expand:w
- }
-\use:x
- {
- \exp_not:n { \cs_new:Npn \@@_parse_unary_aux:w #1 }
- \tl_to_str:n { @@_ } \exp_not:n {#2} \tl_to_str:n { _o:w }
- }
- {#2}
-% \end{macrocode}
-% \end{macro}
-%
% \begin{macro}[aux, EXP]{\@@_bcmp:ww, \@@_compare_back:ww}
% We copy the \cs{@@_compare_back:ww} function of \pkg{l3fp-logic} to
% \cs{@@_bcmp:ww} and make it dispatch according to the type of
@@ -198,46 +112,6 @@
% \end{macrocode}
% \end{macro}
%
-% \subsection{Conversion functions}
-%
-% \begin{macro}[EXP, int]
-% {\@@_to_decimal:w, \@@_to_int:w, \@@_to_scientific:w, \@@_to_tl:w}
-% In \pkg{l3fp-convert}, the \texttt{_dispatch} functions do not
-% actually dispatch depending on the type of their argument: they only
-% accept floating points. Thus, we start by saving the definitions in
-% functions meant only for floating points.
-% \begin{macrocode}
-\cs_new_eq:NN \@@_to_decimal:w \@@_to_decimal_dispatch:w
-\cs_new_eq:NN \@@_to_int:w \@@_to_int_dispatch:w
-\cs_new_eq:NN \@@_to_scientific:w \@@_to_scientific_dispatch:w
-\cs_new_eq:NN \@@_to_tl:w \@@_to_tl_dispatch:w
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}[EXP, int]
-% {
-% \@@_to_decimal_dispatch:w,
-% \@@_to_int_dispatch:w,
-% \@@_to_scientific_dispatch:w,
-% \@@_to_tl_dispatch:w,
-% }
-% Redefine those four functions to actually dispatch on type.
-% \begin{macrocode}
-\cs_undefine:N \@@_to_decimal_dispatch:w
-\cs_new:Npn \@@_to_decimal_dispatch:w #1
- { \cs:w @@ \@@_type_from_scan:N #1 _to_decimal:w \cs_end: #1 }
-\cs_undefine:N \@@_to_int_dispatch:w
-\cs_new:Npn \@@_to_int_dispatch:w #1
- { \cs:w @@ \@@_type_from_scan:N #1 _to_int:w \cs_end: #1 }
-\cs_undefine:N \@@_to_scientific_dispatch:w
-\cs_new:Npn \@@_to_scientific_dispatch:w #1
- { \cs:w @@ \@@_type_from_scan:N #1 _to_scientific:w \cs_end: #1 }
-\cs_undefine:N \@@_to_tl_dispatch:w
-\cs_new:Npn \@@_to_tl_dispatch:w #1
- { \cs:w @@ \@@_type_from_scan:N #1 _to_tl:w \cs_end: #1 }
-% \end{macrocode}
-% \end{macro}
-%
% \subsection{Dispatch according to the type}
%
% \begin{macro}[EXP, aux]
@@ -374,20 +248,6 @@
%
% \subsection{Storing simple tokens}
%
-% \begin{itemize}
-% \item |\s__fp_|\meta{type} and |\__fp_|\meta{type}|_chk:w|;
-% \item |\__fp_|\meta{type}|_to_|\meta{out}|:w| for \meta{out} among
-% |decimal|, |int|, |scientific|, |tl|;
-% \item |\__fp_exp_after_|\meta{type}|_f:nw|;
-% \item |\__fp_|\meta{op}|_|\meta{type}|_o:w| for \meta{op} among
-% |set_sign|, |not|, |exp|, |ln|, |acos|, |acsc|, |asec|, |asin|,
-% |cos|, |cot|, |csc|, |sec|, |sin|, |tan|;
-% \item |\__fp_|\meta{type_1}|_|\meta{op}|_|\meta{type_2}|_o:ww| for
-% \meta{op} among |^*/-+&|\verb"|" and for every other type;
-% \item |\__fp_|\meta{type_1}|_bcmp_|\meta{type_2}|:ww| for every
-% other type;
-% \end{itemize}
-%
% It is sometimes necessary to store a list of \texttt{N}-type tokens in
% a floating point array. The structure we use is
% \begin{quote}
@@ -397,7 +257,7 @@
% directly within a floating point expression: there is thus no need to
% define how the various floating point operators and functions act. We
% only need to be able to jump over the data with
-% \cs{@@_exp_after_tokens_o:nw}.
+% \cs{@@_exp_after_tokens_f:nw}.
%
% \begin{variable}[int]{\s_@@_tokens}
% Marks the start of some \texttt{N}-type tokens stored as a
@@ -415,21 +275,21 @@
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}[EXP, int]{\@@_exp_after_tokens_o:nw}
+% \begin{macro}[EXP, int]{\@@_exp_after_tokens_f:nw}
% \begin{macro}[EXP, aux]{\@@_exp_after_tokens_aux:N}
% The loop through tokens ends when the auxiliary takes in the
% multi-token trailing argument. The \cs{exp_after:wN} chain hits
% \cs{exp:w} coming from the argument, and
% \cs{use_none:nn} removes the looping macro.
% \begin{macrocode}
-\cs_new:Npn \@@_exp_after_tokens_o:nw
+\cs_new:Npn \@@_exp_after_tokens_f:nw
#1 \s_@@_tokens \@@_tokens:n #2 ;
{
\exp_after:wN \@@_exp_after_tokens_auxii:w
\exp:w
\@@_exp_after_tokens_aux:N #2
{ \s_@@_tokens \exp:w \use_none:nn }
- \exp_after:wN \exp_end: #1
+ \exp_end_continue_f:w #1
}
\cs_new:Npn \@@_exp_after_tokens_aux:N #1
{
diff --git a/l3trial/l3fp-extras/testfiles/m3fp-symbolic001.tlg b/l3trial/l3fp-extras/testfiles/m3fp-symbolic001.tlg
index f54db90..c5d4fa4 100644
--- a/l3trial/l3fp-extras/testfiles/m3fp-symbolic001.tlg
+++ b/l3trial/l3fp-extras/testfiles/m3fp-symbolic001.tlg
@@ -27,7 +27,7 @@ spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Undefined control sequence.
<argument> \LaTeX3 error:
- Invalid operation fp_to_decimal((A)+((B)^(2)))
+ Invalid operation fp_to_dim((A)+((B)^(2)))
l. ... }
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
More information about the latex3-commits
mailing list