Google Mail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
I love relational operators so much
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  10 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Follow-up To:
Add Cc | Add Follow-up to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers that you hear
 
Andrey Vul  
View profile   Translate to Translated (View Original)
 More options 8 Nov, 01:08
Newsgroups: comp.lang.c
From: Andrey Vul <andrey....@gmail.com>
Date: Sat, 7 Nov 2009 17:08:32 -0800 (PST)
Local: Sun 8 Nov 2009 01:08
Subject: I love relational operators so much
C's handling of 'if' leads to a lot of room for obfuscation. All you
have to do is replace ';' with '|' for compound expressions and add
parentheses as neccessary.
if (x)
 y;
else
 z;
becomes
((x)&&(y))
||(z);

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.


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Andrey Vul  
View profile   Translate to Translated (View Original)
 More options 8 Nov, 01:13
Newsgroups: comp.lang.c
From: Andrey Vul <andrey....@gmail.com>
Date: Sat, 7 Nov 2009 17:13:44 -0800 (PST)
Local: Sun 8 Nov 2009 01:13
Subject: Re: I love relational operators so much
On Nov 7, 8:08 pm, Andrey Vul <andrey....@gmail.com> wrote:

Uh oh, | isn't gonna work on for- or while-loops.

    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Andrey Vul  
View profile   Translate to Translated (View Original)
 More options 8 Nov, 01:14
Newsgroups: comp.lang.c
From: Andrey Vul <andrey....@gmail.com>
Date: Sat, 7 Nov 2009 17:14:58 -0800 (PST)
Local: Sun 8 Nov 2009 01:14
Subject: Re: I love relational operators so much
On Nov 7, 8:13 pm, Andrey Vul <andrey....@gmail.com> wrote:

> Uh oh, | isn't gonna work on for- or while-loops.

But it does work for pure-sequentials e.g., do{ ... }while(0), etc.

    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Andrey Vul  
View profile   Translate to Translated (View Original)
 More options 8 Nov, 01:21
Newsgroups: comp.lang.c
From: Andrey Vul <andrey....@gmail.com>
Date: Sat, 7 Nov 2009 17:21:20 -0800 (PST)
Local: Sun 8 Nov 2009 01:21
Subject: Re: I love relational operators so much
On Nov 7, 8:13 pm, Andrey Vul <andrey....@gmail.com> wrote:

> Uh oh, | isn't gonna work on for- or while-loops.

and void()s

but void() => int() by changing return to return 0


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Eric Sosman  
View profile   Translate to Translated (View Original)
 More options 8 Nov, 13:33
Newsgroups: comp.lang.c
From: Eric Sosman <esos...@ieee-dot-org.invalid>
Date: Sun, 08 Nov 2009 08:33:24 -0500
Local: Sun 8 Nov 2009 13:33
Subject: Re: I love relational operators so much

Andrey Vul wrote:
> C's handling of 'if' leads to a lot of room for obfuscation. All you
> have to do is replace ';' with '|' for compound expressions and add
> parentheses as neccessary.
> if (x)
>  y;
> else
>  z;
> becomes
> ((x)&&(y))
> ||(z);

     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
esos...@ieee-dot-org.invalid


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Richard Bos  
View profile   Translate to Translated (View Original)
 More options 9 Nov, 16:23
Newsgroups: comp.lang.c
From: ralt...@xs4all.nl (Richard Bos)
Date: Mon, 09 Nov 2009 16:23:14 GMT
Local: Mon 9 Nov 2009 16:23
Subject: Re: I love relational operators so much

Beej Jorgensen <b...@beej.us> wrote:
> Eric Sosman  <esos...@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


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
dSpam@arcor.de  
View profile   Translate to Translated (View Original)
 More options 10 Nov, 13:51
Newsgroups: comp.lang.c
From: "dS...@arcor.de" <dS...@arcor.de>
Date: Tue, 10 Nov 2009 05:51:06 -0800 (PST)
Local: Tues 10 Nov 2009 13:51
Subject: Re: I love relational operators so much
On 8 Nov., 02:08, Andrey Vul <andrey....@gmail.com> wrote:

> if (x)
>  y;
> else
>  z;
> becomes
> ((x)&&(y))
> ||(z);

It has to become something like
(x) && (y, 1)
    || (z);

    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Morris Keesan  
View profile   Translate to Translated (View Original)
 More options 11 Nov, 04:04
Newsgroups: comp.lang.c
From: "Morris Keesan" <mkee...@post.harvard.edu>
Date: Tue, 10 Nov 2009 23:04:10 -0500
Local: Wed 11 Nov 2009 04:04
Subject: Re: I love relational operators so much

On Tue, 10 Nov 2009 08:51:06 -0500, dS...@arcor.de <dS...@arcor.de> wrote:
> On 8 Nov., 02:08, Andrey Vul <andrey....@gmail.com> wrote:
>> if (x)
>>  y;
>> else
>>  z;
>> becomes
>> ((x)&&(y))
>> ||(z);

> 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 -- mkee...@post.harvard.edu


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
dragan  
View profile   Translate to Translated (View Original)
 More options 22 Nov, 06:13
Newsgroups: comp.lang.c
From: "dragan" <spambus...@prodigy.net>
Date: Sun, 22 Nov 2009 00:13:31 -0600
Local: Sun 22 Nov 2009 06:13
Subject: Re: I love relational operators so much

Andrey Vul wrote:
> C's handling of 'if' leads to a lot of room for obfuscation. All you
> have to do is replace ';' with '|' for compound expressions and add
> parentheses as neccessary.

I see no love in that. "plonk" for false advertising.

    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Phil Carmody  
View profile   Translate to Translated (View Original)
 More options 22 Nov, 12:59
Newsgroups: comp.lang.c
From: Phil Carmody <thefatphil_demun...@yahoo.co.uk>
Date: Sun, 22 Nov 2009 14:59:24 +0200
Local: Sun 22 Nov 2009 12:59
Subject: Re: I love relational operators so much

Andrey Vul <andrey....@gmail.com> writes:
> C's handling of 'if' leads to a lot of room for obfuscation. All you
> have to do is replace ';' with '|' for compound expressions and add
> parentheses as neccessary.
> 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


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google