also sprach Rupert <[EMAIL PROTECTED]> [2002.11.19.1932 +0100]:
> This compares the complete expansions of whatever you throw at it:

nice. i didn't even think that far...

> \def\same#1#2{00\fi%
>   \edef\tmpone{#1}%
>   \edef\tmptwo{#2}%
>   \ifx\tmpone\tmptwo}   
> 
> \def\variable{somevalue}
> 
> \if\same{\variable}{somevalue}
> same\else diff\fi

given that \ifx is part of the defintion, you don't need that \if,
right? then again i don't understand the 00\fi notation...

anyway, i think i'll just do this:

\def\same#1#2#3#4{
  \edef\tmpone{#1}%
  \edef\tmptwo{#2}%
  \ifx\tmpone\tmptwo}#3\else#4\fi}

what's \edef compared to \def?
and why do TeX people put % at the end of the line so frequently?

-- 
 .''`.     martin f. krafft <[EMAIL PROTECTED]>
: :'  :    proud Debian developer, admin, and user
`. `'`
  `-  Debian - when you have better things to do than fixing a system

Attachment: msg14066/pgp00000.pgp
Description: PGP signature

Reply via email to