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
Condense Mail Headers

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

Print Reply
Sender:
Mailing list for the LaTeX3 project <[log in to unmask]>
Date:
Thu, 20 Aug 2015 02:05:00 +0200
Reply-To:
Mailing list for the LaTeX3 project <[log in to unmask]>
Subject:
MIME-Version:
1.0
Message-ID:
In-Reply-To:
Content-Type:
text/plain; charset=UTF-8
From:
Bruno Le Floch <[log in to unmask]>
Parts/Attachments:
text/plain (36 lines)
Hello,

> Can someone show me or point me to some code where the peek functions
> have been used (preferably in a straightforward way)? I'm thinking in
> particular of functions like \peek_charcode:NTF.

Two packages seem to use these peek functions a lot: mhchem and
pkgloader.  One thing I note is that both packages involve
constructions reminiscent of a case statement:

    \peek_charcode:NTF M
      {
        \mypkg_grab_M_and_do_something:n
      }
      {
        \peek_charcode:NTF C
          {
            \mypkg_grab_C_and_do_something:n
          }
          {
            \mypkg_something_else:
          }
      }

Such code may be simplified (and sped up a bit) if we provided a
\peek_case_charcode:NnTF function.  Is there interest for such an
additional function?

Actually, looking at mhchem a bit more, it seems that there is
probably room for simplification if we provided better tools for
parsing.  I'll think.

Regards,

Bruno

ATOM RSS1 RSS2