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
Condense Mail Headers

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

Print Reply
Mime-Version:
1.0 (Apple Message framework v929.2)
Content-Type:
text/plain; charset=US-ASCII; format=flowed; delsp=yes
Date:
Sat, 6 Dec 2008 14:20:09 +1030
Reply-To:
Mailing list for the LaTeX3 project <[log in to unmask]>
Subject:
From:
Will Robertson <[log in to unmask]>
In-Reply-To:
Content-Transfer-Encoding:
7bit
Sender:
Mailing list for the LaTeX3 project <[log in to unmask]>
Parts/Attachments:
text/plain (83 lines)
On 06/12/2008, at 9:43 AM, Joseph Wright wrote:

> BTW, I'd missed
> the point that "\exp_args: ...  not to be used within the code": I'll
> have to revisit some of my ideas.

Maybe we need some more programming tools that do similar things,  
then. (I've been tempted to use things like \exp_args:NNO instead of  
chains of \exp_after:NN.)

I guess we could do something like this...?

   \let_new:NN \exp_after:NNN  \exp_args:NNO
   \let_new:NN \exp_after:NNNN \exp_args:NNNO

Where:
   \def_long_new:Npn \exp_args:NNO #1#2#3 {
     \exp_after:NN #1 \exp_after:NN #2 #3
   }

Both have the naming problems of \exp_after:NN itself, where they can  
be used to expand past a brace in a situation like

    \exp_after:NNNN \foo \bar { \baz }
-> \exp_after:NN \foo \exp_after:NN \bar \exp_after:NN { \baz }

So they should probably be

   \exp_after:wN
   \exp_after:NwN
   \exp_after:NNwN

* * *

I know the idea of expl3 is to move away from these sorts of things,  
but I think that the \expandafter functionality is pretty unavoidable  
in some circumstances; consider:

\def_new:Npn \toks_use_clear:N #1 {
   \exp_after:NN
     \toks_clear:N
   \exp_after:NN
     #1
     \toks_use:N#1
}

which could be written simply as

\def_new:Npn \toks_use_clear:N #1 {
   \exp_after:NwN \toks_clear:N #1 \toks_use:N #1
}

* * *

Open questions:

  - is "exp_after" the best name, still?
    "exp_last" ?
    \exp_ii:wN / \exp_iii:NwN / \exp_iv:NNwN ? (I like this; see below)

  - can these be nested/threaded/whatever-the-word for simplifying  
situations like
      \@xa\@xa\@xa\foo\@xa\bar\baz ?

       \exp_after:NNwN \exp_after:wN \foo \bar \baz
    or \exp_iv:NNwN \exp_ii:wN \foo \bar \baz

    Seems okay.
    Could then write

      \def:Npn \exp_iii_ii:NNN { \exp_after:NNwN \exp_after:wN }
      \exp_iii_ii:NNN \foo \bar \baz

    Seems nice, and fits in with the nomenclature of \use_ to an extent.

* * *

Thoughts? There is definite overlap between these functions and what  
the \exp_args functions do, but I think there's enough justification  
to include functions like this, carefully, into l3expan.

Will

ATOM RSS1 RSS2