[texhax] macro help
Philip TAYLOR
P.Taylor at Rhul.Ac.Uk
Wed Aug 9 23:59:07 CEST 2006
Some missing \expandafters, Aditya.
Philip Taylor
-------
Aditya Mahajan wrote:
> I was testing whether it is possible to have macro name with numbers
> and came across something surprising. The following works in plain tex
>
> \def\csname street1\endcsname{First street}
> \def\tagentry#1{#1 \quad \csname #1\endcsname}
>
> \tagentry{street1}
>
> \bye
>
> But the corresponding latex code
>
> \documentclass{minimal}
> \def\csname street1\endcsname{First street}
> \def\tagentry#1{#1 \quad \csname #1\endcsname}
>
> \begin{document}
> \tagentry{street1}
> \end{document}
>
> gives
>
>
> ! Use of \csname doesn't match its definition.
> <argument> d
> ocument
> l.6 \begin{document}
>
> ?
>
> The corresponding context code
>
> \def{\csname street1\endcsname}{First street}
> \def\tagentry#1{#1 \quad \csname #1\endcsname}
>
> \starttext
> \tagentry{street1}
> \stoptext
>
> gives
>
> ! Use of \csname doesn't match its definition.
> \doprocesscommalist ...after \def \csname \s!next
> \the \commalevel
> \endcsnam...
>
> \loadtwopassdata ...passlists ]\doloadtwopassdata
> \globallet
> \alltwopassdata...
> <inserted text> \loadtwopassdata
> \resetutilities \globallet
> \ignorerestoftex...
>
> \doateverystarttext ->\the \everystarttext
> \global \everystarttext
> \emptytoks
> \starttext ->\doateverystarttext
> \ifnum \textlevel =\zerocount
> \registerfile...
> l.4 \starttext
>
>
> Do latex and context redefine the meaning of \def or \csname?
>
> Aditya
> _______________________________________________
> TeX FAQ: http://www.tex.ac.uk/faq
> Mailing list archives: http://tug.org/pipermail/texhax/
> More links: http://tug.org/begin.html
>
> Automated subscription management: http://tug.org/mailman/listinfo/texhax
> Human mailing list managers: postmaster at tug.org
More information about the texhax
mailing list