LATEX-L Archives

Mailing list for the LaTeX3 project

LATEX-L@LISTSERV.UNI-HEIDELBERG.DE

Options: Use Forum View

Use Monospaced Font
Show HTML 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:
Frank Mittelbach <[log in to unmask]>
Reply To:
Mailing list for the LaTeX3 project <[log in to unmask]>
Date:
Tue, 16 Sep 2008 22:18:47 +0200
Content-Type:
text/plain
Parts/Attachments:
text/plain (33 lines)
Joseph Wright writes:
 > Will Robertson wrote:
 > > Hi,
 > > 
 > > I've been thinking more about this.
 > > Just so we're clear, what you're looking for is a function that can be
 > > given a token list and return true or false depending if, without
 > > expansion, the list contains a quark.
 > 
 > I was thinking on a much less grand scale.  Currently, you can test if
 > tlp contains a quark (usually q_no_value).  However, the moment you
 > create a second quark to indicate something else (lets say
 > q_value_required) you always need two tests.  If you have more
 > possibilities, the number of tests rises.  Of course, you are probably
 > using these quarks separately, but in some places you may need a simple
 > "Is it a quark? yes/no" test.

well, first of all, quarks are really made to be extremely fast in testing
(though the need for this might vanish over time more and more) but
essentially testing something for being one of three quarks isnt that bad.

however, if you are really only interested in "is the token in #1 any quark"
then you can do this (using the defining feature of a quark):

 \tlp_set:Nn\l_quark_test_tlp{#1}
 \if_meaning:NN \l_quark_test_tlp #1 ...

assuming that #1 has picked up a token which may or may not be a quark

is that what you are looking for?

frank

ATOM RSS1 RSS2