LATEX-L Archives

Mailing list for the LaTeX3 project


Options: Use Classic View

Use Monospaced Font
Show Text Part by Default
Condense Mail Headers

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

Print Reply
Mime-Version: 1.0 (Apple Message framework v928.1)
Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes
Date: Sun, 14 Sep 2008 17:41:34 +0930
Reply-To: Mailing list for the LaTeX3 project <[log in to unmask]>
From: Will Robertson <[log in to unmask]>
In-Reply-To: <[log in to unmask]>
Content-Transfer-Encoding: 7bit
Sender: Mailing list for the LaTeX3 project <[log in to unmask]>
Parts/Attachments: text/plain (34 lines)
On 14/09/2008, at 4:49 PM, Joseph Wright wrote:

> It might be handy to have a check to see if a value is any quark, for
> "make safe" code. So far, I've ended up with:
> \def_new:Npn \if_quark:NT #1 {
>  \exp_after:NN \exp_after:NN \exp_after:NN \if_quark:w
>    \exp_after:NN \token_to_string:N #1 \q_stop
> }
> \def_new:Npn \if_quark:wT #1#2#3\q_stop {
> \int_compare:nNnT {\char_value_uccode:n{#2}} = {`Q}
> }
> which seems to work but I'm worried may not be suitable more  
> generally.
> Any ideas?

Hmmm. What about if quarks contained an additional parameter to make  
this check more robust?

Let's say

   \def_new:Npn \quark_new:N #1{\tlp_new:Nn #1{\q_quark#1}}

But I guess you don't want to be doing any expansion in the \if_quark  
function so you wouldn't be able to see if \q_quark was there or not.

Never mind, I suppose.