LATEX-L Archives

Mailing list for the LaTeX3 project

LATEX-L@LISTSERV.UNI-HEIDELBERG.DE

Options: Use Forum View

Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

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

Print Reply
Subject:
From:
Joseph Wright <[log in to unmask]>
Reply To:
Mailing list for the LaTeX3 project <[log in to unmask]>
Date:
Tue, 23 Aug 2011 11:10:02 +0100
Content-Type:
text/plain
Parts/Attachments:
text/plain (39 lines)
On 23/08/2011 09:32, Ulrike Fischer wrote:
> I don't have enough practice with l3keys to decide this - just
> starting. But from the language I would expect a \keys_set_known to
> give an error if it encounters something unknown. Also a command to
> set keys can set only known keys, so it sound like a pleonasm. 

Well no, as the special 'unknown' key allows behaviour for a key which
is not defined to be set up.

> Another question: pdfkeys has the notion of a "key tree" and
> "pathes". And you can switch pathes with a command. (.cd I think).
> Can/should one do something similar with l3keys? I see the
> subgroups, but I'm not sure if they really are the same conzept.

Internally, l3keys uses the same storage approach as pgfkeys. The
\keys_set:nn macro is rather more like \pgfqkeys than \pgfkeys, in the
sense that it includes a root to search from. It is therefore possible
to do something like

  \keys_set:nn { } { foo / key-a = value , bar / key-a = other-value }

So it would in principal be quite possible to implement

  \keys_set:n % No starting path
    { / foo .cd: , key-a = value , bar .cd: , key-a = other-value }

However, at the moment there's not been a good use case for l3keys for
such an approach. Explaining keys as a tree is not so easy as dealing
with each modules keys separately. The idea is to grow l3keys as
functionality is needed, and to date this more complex idea has not
really been required.

As you observe, the documents do suggest subgrouping keys using "/" as a
separator. That is exactly because of the internal storage method of
keys, and is intended to make implementing something like the .cd
property from pgfkeys relatively straight-forward.
--
Joseph Wright

ATOM RSS1 RSS2