prop mit clist: prop_get gibt clist zurück, prop_map_inline nicht?

prop mit clist: prop_get gibt clist zurück, prop_map_inline nicht?

Ich bin sicher, dass ich etwas Triviales übersehe (lerne immer noch etwas über LaTeX3), aber das hier kommt mir seltsam vor: prop_map_inline gibt keine Werte als clist zurück, obwohl sie es sind?

\documentclass{article}

\begin{document}

\ExplSyntaxOn
\prop_new:N \someProp

% put some data into prop:
\clist_set:Nn \l_tmpa_cl {a,b,c}
\clist_use:Nn \l_tmpa_cl {\ ---\ }
\prop_put:NnV \someProp {keyA} {\l_tmpa_cl}
\par

\clist_set:Nn \l_tmpa_cl {u,v,w,x,y,z}
\clist_use:Nn \l_tmpa_cl {\ ---\ }
\prop_put:NnV \someProp {keyB} {\l_tmpa_cl}
\par

% Direct access works fine; I get back a clist:
\prop_get:NnN \someProp {keyA} \l_tmpb_cl
\clist_use:Nn \l_tmpb_cl {\ ---\ }
\par 

% When iterating over property, value is no longer
% a clist, but just a string? 
\prop_map_inline:Nn \someProp { Key\ #1; \ 
  Values\ list:\ \clist_use:Nn #2 {\ ---\ } 
  \par } 

\prop_log:N \someProp

\ExplSyntaxOff

\end{document}

Logdatei:

The property list \someProp contains the pairs (without outer braces):
>  {keyA}  =>  {a,b,c}
>  {keyB}  =>  {u,v,w,x,y,z}.

und so scheint es auch zu sein. ??

Antwort1

Sie benötigen, \clist_use:nnda #2es sich nicht um eine Variable (wie \l_tmpa_clist), sondern lediglich um eine Liste von Token ( a,b,c) handelt.

\documentclass{article}

\begin{document}

\ExplSyntaxOn
\prop_new:N \l_karl_some_prop

% put some data into prop:
\clist_set:Nn \l_tmpa_clist {a,b,c}
\clist_use:Nn \l_tmpa_clist {\ ---\ }
\prop_put:NnV \l_karl_some_prop {keyA}\l_tmpa_clist
\par

\clist_set:Nn \l_tmpa_clist {u,v,w,x,y,z}
\clist_use:Nn \l_tmpa_clist {\ ---\ }
\prop_put:NnV \l_karl_some_prop {keyB}\l_tmpa_clist
\par


\prop_map_inline:Nn \l_karl_some_prop 
 { 
   Key\ #1; \ 
   Values\ list:\  \clist_use:nn {#2} {\ ---\ } 
   \par 
 } 

\ExplSyntaxOff

\end{document}

Bildbeschreibung hier eingeben

verwandte Informationen