Subject: | |
From: | |
Reply To: | |
Date: | Tue, 27 Sep 2011 14:10:20 +0200 |
Content-Type: | text/plain |
Parts/Attachments: |
|
|
The documentations source3 says at the start "In general, the V and
v specifiers are favoured over o for recovering stored information".
But everytime I start to define functions which should expand their
argument I end either with x or o types.
As an example I tried to write a function which process key-val
lists. The list can also be given through a command. With o this
works fine, with V normal and empty lists gives errors:
\documentclass[parskip]{scrartcl}
\usepackage{expl3}
\begin{document}
\section{expl3}
\ExplSyntaxOn
\keys_define:nn {test}
{testa .code:n = {#1},
testb .code:n = {#1},
}
\cs_new:Npn \test_usekeys:n #1 {keys:~[\keys_set:nn {test}{#1}]}
\cs_generate_variant:Nn \test_usekeys:n {V}
\cs_generate_variant:Nn \test_usekeys:n {o}
\def\mykeylist{testa=A,testb=B}
\test_usekeys:V {\mykeylist}
%\test_usekeys:V {testa=A,testb=B}
%\test_usekeys:V {}
\par
\test_usekeys:o {\mykeylist}\\
\test_usekeys:o {testa=A,testb=B}\\
\test_usekeys:o {}\\
\test_usekeys:o {\mykeylist}\\
\end{document}
Could someone explain me when arguments of type V are actually
useful and "better" than o and how they should be used?
--
Ulrike Fischer
|
|
|