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:
Fri, 17 Sep 2010 14:51:30 +0930
Content-Type:
text/plain
Parts/Attachments:
text/plain (36 lines)
Hi,

In, say, breqn and unicode-math, we have a need to occasionally assign meanings to characters that may or may not be active at the time they're defined. The usual method for doing this is to use the \lowercase trick with something like

\def\foo{...
  \lccode`#1=`\~
  \lowercase{%
    \def ~{...}
  }
}

But this requires that ~ is naturally active; and that's not necessarily always a good assumption (well, in expl3 isn't definitely not).

breqn uses a better technique:

\edef\tmp{\catcode\z@=\the\catcode\z@}
\catcode\z@=\active
...
  as above but with ^^@ instead of ~
...
\tmp % restore catcode

Do you think it would be a good addition to expl3 to formalise this sort of programming structure? I guess it would be something like

\begin_active_char:n {^^@}
  ...
\end_active_char:

which doesn't really gain us too much.

What if ^^@ were *always* active as part of the expl3 syntax?

Just thinking out loud, really. Comments, thoughts?

-- Will

ATOM RSS1 RSS2