LATEX-L Archives

Mailing list for the LaTeX3 project

LATEX-L@LISTSERV.UNI-HEIDELBERG.DE

Options: Use Classic View

Use Proportional Font
Show Text Part by Default
Condense Mail Headers

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

Print Reply
Sender: Mailing list for the LaTeX3 project <[log in to unmask]>
Date: Fri, 12 Sep 2008 12:57:04 +0200
Reply-To: Mailing list for the LaTeX3 project <[log in to unmask]>
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
In-Reply-To: <[log in to unmask]>
Content-Type: text/plain; charset=us-ascii
From: Frank Mittelbach <[log in to unmask]>
Parts/Attachments: text/plain (67 lines)
Joseph Wright writes:
 > Will Robertson wrote:
 >  > If it's going to need such contents, would it make more sense to use a
 > > _toks datatype the whole way though?
 > 
 > Okay, I have "redone the exercise" in this way.
 > 
 > >> I wonder if there
 > >> is a reason not to do:
 > >>
 > >> \def_long_new:Npn \tlp_put_right:Nn #1#2{
 > >>  \tlp_set:Nx #1{\exp_not:o{#1}\exp_not:n{#2}}
 > >> }
 > >>
 > >> which does not suffer from the same issue.
 > > 
 > > Unless the whole point is to restrict its use in this case, I can't see
 > > why this isn't a better approach. I suspect it wasn't coded like this in
 > > the first place because \exp_not:n isn't available without eTeX. But I
 > > don't  think we should worry about that these days.
 > 
 > That was my guess too.

some history, perhaps Morten can say more because I think he did some of the
updates ...

very early definition:

  \def_long_new:Npn \tlp_put_right:Nn #1#2{\tlp_set:No #1{#1#2}}

current documentation says

% A word of warning is appropriate here: Token list pointers are
% implemented as macros and as such currently inherit some of the
% peculiarities of how \TeX\ handles "#"s in the argument of
% macros. In particular, the following actions are legal
% \begin{verbatim}
% \tlp_set:Nn \l_tmpa_tlp{##1}
% \tlp_put_right:Nn \l_tmpa_tlp{##2}
% \tlp_set:No \l_tmpb_tlp{\l_tmpa_tlp ##3}
% \end{verbatim}
% |x| type expansions where macros being expanded contain |#|s do not
% work and will not work until there is an |\expanded| primitive in
% the engine. If you want them to work you must double |#|s another
% level.
%


from which I infer that the 

  \tlp_set:Nn \l_exp_tlp{#2}

was actually added to raise the error when setting / adding to the tlp and not
during some later expansion deep down.

However, we could do better now I guess given that we assume for expl3 that
eTeX is the underlying engine nowadays


however the problem will be to ensure that the single # will work in all
circumstances ie all usages of tlps and I'm not sure that wil be possible

if not then prohibiting them if not doubled (for tlps) might be the better
solution)

frank

ATOM RSS1 RSS2