for compounds,
if (x)
y;z;a;b;
else
c;d;e;f;
becomes
((x) && ((y)|(z)|(a)|(b))
||((c)|(d)|(e)|(f));
C is so much fun to obfuscate. Gotta love ISO 9899.
The result is still more readable than perl, though.
Uh oh, | isn't gonna work on for- or while-loops.
> Uh oh, | isn't gonna work on for- or while-loops.
But it does work for pure-sequentials e.g., do{ ... }while(0), etc.
> Uh oh, | isn't gonna work on for- or while-loops.
and void()s
but void() => int() by changing return to return 0
I tried your suggestion, with `exit(0)' for `z', and
my compiler complained. Should I sue the vendor?
> for compounds,
> if (x)
> y;z;a;b;
> else
> c;d;e;f;
... is a syntax error.
--
Eric Sosman
eso...@ieee-dot-org.invalid
> Eric Sosman <eso...@ieee-dot-org.invalid> wrote:
> > I tried your suggestion, with `exit(0)' for `z', and
> >my compiler complained. Should I sue the vendor?
>
> vendor==MICROSOFT && printf("Sue Sue!\n"); // ;-)
You surprise me. I'd expect a M$-written implementation, if it started
emitting girls' names, to choose "Daisy, Daisy...".
Richard
It has to become something like
(x) && (y, 1)
|| (z);
And both forms are illegal if z has void type. See 6.5.13 p2.
--
Morris Keesan -- mke...@post.harvard.edu
I see no love in that. "plonk" for false advertising.
> for compounds,
> if (x)
> y;z;a;b;
> else
> c;d;e;f;
> becomes
> ((x) && ((y)|(z)|(a)|(b))
> ||((c)|(d)|(e)|(f));
Codswallop. You clearly have avoided learning anything about
order of evaluation. Which, given that it's one of the most
commonly discussed things on c.l.c, is either terribly sloppy,
or deliberate. Neither being commendable.
> C is so much fun to obfuscate. Gotta love ISO 9899.
> The result is still more readable than perl, though.
Almost any language can be made practically un readable.
Some just make it trivial, or even natural.
Phil
--
Any true emperor never needs to wear clothes. -- Devany on r.a.s.f1