LATEX-L Archives

Mailing list for the LaTeX3 project

LATEX-L@LISTSERV.UNI-HEIDELBERG.DE

Options: Use Forum View

Use Proportional Font
Show HTML Part by Default
Condense Mail Headers

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

Print Reply
Mime-Version:
1.0
Content-Type:
text/plain; charset=ISO-8859-1; format=flowed
Date:
Sat, 26 May 2012 17:12:34 +0200
Reply-To:
Mailing list for the LaTeX3 project <[log in to unmask]>
Subject:
Content-Transfer-Encoding:
7bit
Message-ID:
Sender:
Mailing list for the LaTeX3 project <[log in to unmask]>
From:
Marco Daniel <[log in to unmask]>
Parts/Attachments:
text/plain (55 lines)
Hello,

Today I noticed that there is no key .initial:n. This question popped up 
during writing a small package. Whatever at the moment you have the 
following possibilities to set a key-value-syntax with an initial value:
=======================================================================
%First approach:

\keys_define:nn { module }
  {
   myoption .int_set:N  = \l_modul_myoption_int
  }
\keys_set:nn  { module }
  {
   myoption = 2
  }
\ProcessKeysOptions { module }

=======================================================================
Second approach

\keys_define:nn { module }
  {
   myoption .int_set:N  = \l_modul_myoption_int ,
   myoption .default:n  = 2
  }
\keys_set:nn  { module } { myoption }
\ProcessKeysOptions { module }

=======================================================================

I suggest to define a new key .initial:n so that we have a third approach:

Second approach

\keys_define:nn { module }
  {
   myoption .int_set:N  = \l_modul_myoption_int ,
   myoption .initial:n  = 2
  }
\ProcessKeysOptions { module }

=======================================================================

I hope my question is clear.

Of course the current methods are separating the definition and setting 
of keys. In this way it's clear. However I'd prefer the third approach
to set an initial value immediately after their definition.

What do you think about such a key?

regards
Marco

ATOM RSS1 RSS2