LATEX-L Archives

Mailing list for the LaTeX3 project


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
Will Robertson <[log in to unmask]>
Reply To:
Mailing list for the LaTeX3 project <[log in to unmask]>
Thu, 26 Feb 2009 11:27:52 +1030
text/plain (1852 bytes) , smime.p7s (2446 bytes)
On 26/02/2009, at 6:31 AM, Frank Mittelbach wrote:

> so for now (see other post) I would only assign \endlinechar and  
> \scantokens
> and the names there look fine to me

After all this I now agree with Frank (that the every-toks require a  
wrapper to be useful, and expl3 isn't the place to do that), so let's  
agree to add \endlinechar directly (except we want  
\l_char_end_line_int instead of _endline_ I think) and...

> instead provide a scantokens
> interface which sets up its environment carefully (by, for example,  
> copying
> a specific toks (e.g., \l_every_rescan_end_toks to \tex_every_eof:D  
> prior to
> calling \etex_scantokens:D) rather than providing the primitive for  
> direct
> use.

... add a version of scantokens that looks approximately like this:  
(just copying Joseph's code)

\cs_set_eq:NN \l_char_end_line_int \tex_endlinechar:D
\cs_new:Npn \tlist_rescan:n #1 {
    \tex_everyeof:D {\exp_not:N}
    \int_set:Nn \l_char_end_line_int {\c_minus_one}
    \toks_set:Nx \l_tmpa_toks { \etex_scantokens {#1} }
  \toks_use:N \l_tmpa_toks

(Sorry for my ignorance but what's the endlinechar part for? Maybe we  
don't need that?)

> My point is that I don't want to saction the use of the primitive by  
> giving it
> a name

I'm going to use that as an argument against \pref_ :)



Appendix: minimal example of \tlist_rescan:n

\cs_set_eq:NN \l_char_end_line_int \tex_endlinechar:D
\cs_new:Npn \tlist_rescan:n #1 {
    \etex_everyeof:D {\exp_not:N}
    \int_set:Nn \l_char_end_line_int {\c_minus_one}
    \toks_set:Nx \l_tmpa_toks { \etex_scantokens:D {#1} }
  \toks_use:N \l_tmpa_toks
\char_make_other:N \$
\char_make_other:N \^
\texttt{\tlist_rescan:n { $a^1$ }} ~vs.~$a^1$