[texhax] Macro Problem

Tom t152 at vmars.tuwien.ac.at
Mon May 5 18:10:38 CEST 2003


That's exactly the point; I have extended your example:

INPUT:

\def\truefalseX#1{%
  \ifx#1\empty\typeout{X:true}\else\typeout{X:false}\fi}

\def\truefalseY#1{%
  \ifx#1\empty\else\typeout{Y:false}\fi}

\truefalseX{}
\truefalseX{\empty}
\truefalseX{hello}

\truefalseY{}
\truefalseY{\empty}
\truefalseY{hello}

OUTPUT:

X:false
X:true
X:false
% empty string
% empty string
Y:false


-> it works properly if I remove the true-expression.

greetings

Tom

On Mon, 5 May 2003, Manoj Kummini wrote:

>  --- Thomas Losert <tl at vmars.tuwien.ac.at> wrote:
>
> > This line works as expected (output nothing or "false", depending
> > on parameter #4):
> >
> >     \ifx#4\empty \else false \fi
> >
> > This line doesn't work since it produces "false" always
> > (independent
> > of parameter #4):
> >
> >     \ifx#4\empty true \else false \fi
>
> I could not reproduce your problem. I tried the following code:
>
> \makeatletter
> \def\truefalse#1{%
>   \ifx#1\empty\typeout{true}\else\typeout{false}\fi}
> \makeatother
>
> \truefalse{}
> \truefalse{\empty}
> \truefalse{hello}
>
> It prints `false', `true' and `false' in that order. I don't know why
> it wrote `false' for \truefalse{}.
>
> Manoj.
>
>
> =====
> --
> Manoj Kummini
> http://www.geocities.com/kummini/index.html
> 12 deg 58 min N, 77 deg 35 min E
>
> ________________________________________________________________________
> Missed your favourite TV serial last night? Try the new, Yahoo! TV.
>        visit http://in.tv.yahoo.com
>







More information about the texhax mailing list