summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/l3kernel/l3prop.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/source/latex/l3kernel/l3prop.dtx')
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3prop.dtx59
1 files changed, 58 insertions, 1 deletions
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3prop.dtx b/Master/texmf-dist/source/latex/l3kernel/l3prop.dtx
index 265833a8e10..6a74a896de7 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3prop.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3prop.dtx
@@ -37,7 +37,7 @@
\documentclass[full]{l3doc}
%</driver>
%<*driver|package>
-\GetIdInfo$Id: l3prop.dtx 4712 2014-04-30 08:17:49Z joseph $
+\GetIdInfo$Id: l3prop.dtx 5215 2014-07-17 13:23:20Z joseph $
{L3 Property lists}
%</driver|package>
%<*driver>
@@ -217,6 +217,23 @@
% the \meta{token list variable} is local. See also \cs{prop_gpop:NnNTF}.
% \end{function}
%
+% \begin{function}[added = 2014-07-17, EXP]{\prop_item:Nn, \prop_item:cn}
+% \begin{syntax}
+% \cs{prop_item:Nn} \meta{property list} \Arg{key}
+% \end{syntax}
+% Expands to the \meta{value} corresponding to the \meta{key} in
+% the \meta{property list}. If the \meta{key} is missing, this has
+% an empty expansion.
+% \begin{texnote}
+% This function is slower than the non-expandable analogue
+% \cs{prop_get:NnN}.
+% The result is returned within the \tn{unexpanded}
+% primitive (\cs{exp_not:n}), which means that the \meta{value}
+% will not expand further when appearing in an \texttt{x}-type
+% argument expansion.
+% \end{texnote}
+% \end{function}
+%
% \section{Modifying property lists}
%
% \begin{function}[added = 2012-05-12]
@@ -741,6 +758,36 @@
% \end{macro}
% \end{macro}
%
+% \begin{macro}[EXP]{\prop_item:Nn, \prop_item:cn}
+% \begin{macro}[aux, EXP]{\@@_item_Nn:nwwn}
+% Getting the value corresponding to a key in a property list in an
+% expandable fashion is similar to mapping some tokens. Go through
+% the property list one \meta{key}--\meta{value} pair at a time: the
+% arguments of \cs{@@_item_Nn:nwn} are the \meta{key} we are looking
+% for, a \meta{key} of the property list, and its associated value.
+% The \meta{keys} are compared (as strings). If they match, the
+% \meta{value} is returned, within \cs{exp_not:n}. The loop
+% terminates even if the \meta{key} is missing, and yields an empty
+% value, because we have appended the appropriate
+% \meta{key}--\meta{empty value} pair to the property list.
+% \begin{macrocode}
+\cs_new:Npn \prop_item:Nn #1#2
+ {
+ \exp_last_unbraced:Noo \@@_item_Nn:nwwn { \tl_to_str:n {#2} } #1
+ \@@_pair:wn \tl_to_str:n {#2} \s_@@ { }
+ \__prg_break_point:
+ }
+\cs_new:Npn \@@_item_Nn:nwwn #1#2 \@@_pair:wn #3 \s_@@ #4
+ {
+ \str_if_eq_x:nnTF {#1} {#3}
+ { \__prg_break:n { \exp_not:n {#4} } }
+ { \@@_item_Nn:nwwn {#1} }
+ }
+\cs_generate_variant:Nn \prop_item:Nn { c }
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
% \begin{macro}[TF, tested = m3prop004]
% {\prop_pop:NnN, \prop_pop:cnN, \prop_gpop:NnN, \prop_gpop:cnN}
% Popping an item from a property list, keeping track of whether
@@ -1076,6 +1123,16 @@
% \end{macrocode}
% \end{macro}
%
+% \subsection{Deprecated functions}
+%
+% \begin{macro}{\prop_get:Nn, \prop_get:cn}
+% Deprecated 2014-07-17.
+% \begin{macrocode}
+\cs_new_eq:NN \prop_get:Nn \prop_item:Nn
+\cs_new_eq:NN \prop_get:cn \prop_item:cn
+% \end{macrocode}
+% \end{macro}
+%
% \begin{macrocode}
%</initex|package>
% \end{macrocode}