Skip to content

Commit

Permalink
Remove \EvaluateNow
Browse files Browse the repository at this point in the history
  • Loading branch information
josephwright committed May 30, 2022
1 parent 9228cc1 commit bdc72a5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 63 deletions.
3 changes: 3 additions & 0 deletions l3packages/CHANGELOG.md
Expand Up @@ -10,6 +10,9 @@ this project uses date-based 'snapshot' version identifiers.
### Changed
- Allow for _ad hoc_ adjustment of template values

### Removed
- `\EvaluateNow` command

## [2022-01-12]

### Changed
Expand Down
67 changes: 4 additions & 63 deletions l3packages/xtemplate/xtemplate.dtx
Expand Up @@ -363,19 +363,6 @@
% from the \meta{code} used.
% \end{function}
%
% \begin{function}{\EvaluateNow}
% \begin{syntax}
% \cs{EvaluateNow} \Arg{expression}
% \end{syntax}
% The standard method when creating an instance from a template is to
% evaluate the \meta{expression} when the instance is used. However, it may
% be desirable to calculate the value when declared, which can be
% forced using \cs{EvaluateNow}. Currently, this functionality is
% regarded as experimental: the team have not found an example where it
% is actually needed, and so it may be dropped \emph{if} no good
% examples are suggested!
% \end{function}
%
% \section{Multiple choices}
% \label{sec:choices-key}
%
Expand Down Expand Up @@ -1013,8 +1000,7 @@
% \end{macro}
%
% \begin{macro}[TF]{\@@_if_key_value:n, \@@_if_key_value:o}
% Tests for the first token in a string being \cs{KeyValue}, where
% \cs{EvaluateNow} is not important.
% Tests for the first token in a string being \cs{KeyValue}.
% \begin{macrocode}
\prg_new_conditional:Npnn \@@_if_key_value:n #1 { T , F , TF }
{
Expand All @@ -1028,18 +1014,6 @@
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@@_if_eval_now:nTF}
% Tests for the first token in a string being \cs{EvaluateNow}.
% \begin{macrocode}
\prg_new_conditional:Npnn \@@_if_eval_now:n #1 { TF }
{
\str_if_eq:noTF { \EvaluateNow } { \tl_head:w #1 \q_nil \q_stop }
{ \prg_return_true: }
{ \prg_return_false: }
}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}[TF]{\@@_if_instance_exist:nnn}
% Testing for an instance is collection dependent.
% \begin{macrocode}
Expand Down Expand Up @@ -1455,30 +1429,9 @@
% value to be processed and potentially stored.
%
% \begin{macro}{\@@_store_value_boolean:n}
% Storing Boolean values requires a test for delayed evaluation, but
% is different to the various numerical variable types as there are
% only two possible values to store. So the code here tests the default
% switch and then records the meaning (either \texttt{true} or
% \texttt{false}).
% \begin{macrocode}
\cs_new_protected:Npn \@@_store_value_boolean:n #1
{
\@@_if_eval_now:nTF {#1}
{
\bool_if:cTF { c_ #1 _bool }
{
\prop_put:Non \l_@@_values_prop \l_@@_key_name_tl
{ true }
}
{
\prop_put:Non \l_@@_values_prop \l_@@_key_name_tl
{ false }
}
}
{
\prop_put:Non \l_@@_values_prop \l_@@_key_name_tl {#1}
}
}
{ \prop_put:Non \l_@@_values_prop \l_@@_key_name_tl {#1} }
% \end{macrocode}
% \end{macro}
%
Expand All @@ -1500,17 +1453,9 @@
% \@@_store_value_real:n, \@@_store_value_skip:n,
% \@@_store_value_tokenlist:n, \@@_store_value_commalist:n}
% Storing values in \cs{l_@@_values_prop} is in most cases the same.
% If evaluation is taking place now, one \texttt{x}-expands an
% evaluation function and the result is then stored. On the other
% hand, if evaluation is delayed the current data is simply stored
% \enquote{as is}.
% \begin{macrocode}
\cs_new_protected:Npn \@@_store_value_aux:Nn #1#2
{
\@@_if_eval_now:nTF {#2}
{ \prop_put:NVx \l_@@_values_prop \l_@@_key_name_tl { #1 {#2} } }
{ \prop_put:Non \l_@@_values_prop \l_@@_key_name_tl {#2} }
}
{ \prop_put:Non \l_@@_values_prop \l_@@_key_name_tl {#2} }
\cs_new_protected:Npn \@@_store_value_integer:n
{ \@@_store_value_aux:Nn \int_eval:n }
\cs_new_protected:Npn \@@_store_value_length:n
Expand Down Expand Up @@ -2912,16 +2857,12 @@
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\EvaluateNow}
% \begin{macro}{\KeyValue}
% These are both do nothing functions. Both simply dump their arguments
% when executed: this should not happen with \cs{KeyValue}.
% Simply dump the argument when executed: this should not happen.
% \begin{macrocode}
\cs_new_protected:Npn \EvaluateNow #1 {#1}
\cs_new_protected:Npn \KeyValue #1 {#1}
% \end{macrocode}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\AssignTemplateKeys}
% A short call to use a token register by proxy.
Expand Down

0 comments on commit bdc72a5

Please sign in to comment.