LATEX-L Archives

Mailing list for the LaTeX3 project

LATEX-L@LISTSERV.UNI-HEIDELBERG.DE

Options: Use Classic View

Use Monospaced Font
Show Text Part by Default
Condense Mail Headers

Topic: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Sender: Mailing list for the LaTeX3 project <[log in to unmask]>
Date: Thu, 11 Nov 2010 12:17:27 +0000
Reply-To: Mailing list for the LaTeX3 project <[log in to unmask]>
Message-ID: <[log in to unmask]>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
In-Reply-To: <[log in to unmask]>
Content-Type: text/plain; charset=UTF-8; format=flowed
From: Joseph Wright <[log in to unmask]>
Parts/Attachments: text/plain (36 lines)
On 11/11/2010 12:06, Rémy Oudompheng wrote:
> Another l3keys puzzle : the following code
>
> \documentclass{minimal}
> \usepackage{expl3}
> \begin{document}
> \ExplSyntaxOn
> \keys_define:nn {module} {
>    a .default:n = Alice ,
>    a .code:n = Hello #1 ,
> }
> \keys_set:nn {module} {a}
> \ExplSyntaxOff
> \end{document}
>
> produces "Hello ", but if I swap the "default:n" and "code:n" line, I
> get "Hello Alice".
>
> The example from the documentation (latex3-source.pdf) also puts the
> "default:n" line last. Is that mandatory ?

At least in the current implementation, .code:n will 'reset' any other 
properties of a key. So setting "a .code:n = Hello #1" will delete any 
default value. I guess that this needs more explanation.

Now, you might wonder why this happens. The thinking when I wrote this 
was that if you change the code in some arbitrary way then any other 
properties may no longer be valid. For example, if you do something like

   a .value_forbidden: ,
   a .code:n = Hello #1 ,

then it's not exactly obvious what should happen about 'forbidden' property.
-- 
Joseph Wright

ATOM RSS1 RSS2