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:
Will Robertson <[log in to unmask]>
Reply To:
Mailing list for the LaTeX3 project <[log in to unmask]>
Date:
Thu, 12 Feb 2009 09:24:06 +1030
Content-Type:
multipart/signed
Parts/Attachments:
text/plain (763 bytes) , smime.p7s (2446 bytes)
Dear all,

I'm trying to write a unit test for \token_if_space:NTF, but I'm  
having some difficulty this early in the morning. Spaces are consumed  
after the control sequence, as an argument is being scanned for, so  
I'm not sure how to pass a space char into the conditional. I haven't  
had any luck getting it to trip true; any hints how to do this and  
when the function might be used?

For the curious, the definition is:

% implicit \catcode`\~=5 % space
\def_new:Npn \token_new:Nn #1#2 {\glet_new:NN #1#2}
\token_new:Nn \c_space_token {~}
\def_long_new:Npn \token_if_space_p:N #1{
   \if_catcode:w \exp_not:N #1\c_space_token
     \c_true
   \else:
     \c_false
   \fi:
}
\def_long_test_function_new:npn {token_if_space:N} #1{
   \if:w\token_if_space_p:N #1}

Many thanks,
Will

ATOM RSS1 RSS2