LATEX-L Archives

Mailing list for the LaTeX3 project

LATEX-L@LISTSERV.UNI-HEIDELBERG.DE

Options: Use Forum View

Use Proportional 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:
Will Robertson <[log in to unmask]>
Reply To:
Mailing list for the LaTeX3 project <[log in to unmask]>
Date:
Sun, 14 Sep 2008 17:41:34 +0930
Content-Type:
text/plain
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}}

Oh.
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.

W

ATOM RSS1 RSS2