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, 6 Aug 2009 18:03:42 +0930
Content-Type:
multipart/signed
Parts/Attachments:
text/plain (1825 bytes) , smime.p7s (2446 bytes)
On 06/08/2009, at 5:42 PM, Joseph Wright wrote:

>> I like this way of doing coordinates. Could 'd{}{-default-}' be
>> shoe-horned into this syntax as well? I suppose that would mean
>> completely re-writing the parser. But then we wouldn't need another
>> letter for my feature of limited value.
>
> I thought about this.  There is an issue, though.  For a standard
> delimited argument, the two "ends" are arbitrary: [) will work as well
> as [].  You can easily pick up:
>
> d{ ...
>
> for the opening-group token, but in this case you have to have a  
> closing
> group token as the closing token (both for d{} and for gathering the
> argument).  So d[]{default} and d{}{default} are subtly but  
> importantly
> different.  I'm not opposed, though:
>
> "d{}{<default>} can be used to include an optional argument surrounded
> by braces.  Note that in this case the closing token *must* be a
> close-group token (usually `}')."

Yep, sounds good.
So, to perhaps summarise:

m M - mandatory braced argument
d D <x><y> - optional delimited argument; picks up material between  
<x> and <y>. Can be used for {}, (), etc. Can be followed by a default  
value to use.
o O - shorthand for d[]
t <x> - lookahead for optional <x>
s   - shorthand for t*
l L - everything before the next brace (not often used, but sometimes  
useful)

No longer:

c<x><y> - as d() but mandatory; can perform the check manually (only a  
small processing overhead?).
p - shorthand for d(); drop this to keep things simple.

* * *

Open issues:

  - Do we want to support something like 'd{[[}{]]}{default}' to allow  
\foo[[bar]] ? (I'd say no.)
  - Do we want to support something analogous to
        \def\foo #1\endfoo{...#1...}
    Consider active quotes, and macros like '\<...>'
    Maybe this is as important to support as 'l'.
    Could use the letter 'u{<token>}' for "until".

Any thoughts?

Will



ATOM RSS1 RSS2