Re: Test

Behdad Esfahbod <[email protected]> Mon, 5 Jan 2004 08:34:24 -0500
Newsgroups gmane.comp.tex.omega.devel
Message-ID <[email protected]>
  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.
  Send mail to [email protected] for more info.

--1686162181-1876538077-1073309348=:11241
Content-Type: TEXT/PLAIN; CHARSET=US-ASCII
Content-ID: <[email protected]>

On Mon, 5 Jan 2004, Chris Rowley wrote:

> Behdad
>
> > Anybody still out there?
>
> Yes, but I did not know that the list was working again!
>
> chris

Happy new year Chris and others,

I was wondering about the exactly same thing :-).

BTW, lets ask a question.  I'm implementing a macro aliasing
system.  The idea is that when translating macro names in
localized TeX systems, you need to somehow specify that eg. \b
and \B are the same thing.  Means, whenever \b is changed, \B
should also change, and vice versa.

The attached code tries to do this by defining \def family and
\let as macros.  Then all you need to do is \alias\B=\b.  But
I've got a few problems:

* Overriding \def works in both TeX and LaTeX, but when I
override \let, TeX works fine, but LaTeX drops a paragraph ended
while scanning \let error.

Actually it's fine with this:

\let\oldlet\let
\def\newlet{\oldlet}
\let\let\newlet

but not with this:

\let\oldlet\let
\def\newlet#1{\oldlet#1}
\let\let\newlet

Any idea what's LaTeX doing here?


* Another problem is that I don't want my new \*def and \let
macros be expanded in case of errors.  I know LaTeX2e does this
by providing \DeclareRobustCommand and actually using \protect
tricks, but I cannot see how to do that in plain TeX.  Actually I
cannot even understand how it's implementing \protect.

Cheers,
behdad

PS.  While this implementation has its own problems, like not
being symmetric and actually doing \def\B{\b}, but I prefer it to
other ones as 1. it does not double the needed memory by copying
\b to \B, and 2. it's as transparent as possible to non-alias
macros, should be more robust.

--1686162181-1876538077-1073309348=:11241
Content-Type: APPLICATION/X-TEX; NAME="alias.tex"
Content-Transfer-Encoding: BASE64
Content-ID: <[email protected]>
Content-Description: 
Content-Disposition: ATTACHMENT; FILENAME="alias.tex"

XGlmeFxkb2N1bWVudHN0eWxlXHVuZGVmaW5lZFxyZWxheFxlbHNlClxkb2N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