Lazy evaluation question

P

Peter Nilsson

Boltar said:
Willem said:
Now that we're talking about it anyway, here's a gripe I
have about the logicaloperators in C:

Why oh why is (a || b) not equivalent to (a ? a : b)  [1]

How should you interpret this where a is a double and b is
a pointer?
And why isn't there alogical XOR operator? eg: a ^^ b

Same reason people don't check the archives before asking
a question that has been repeated many times: some people
just don't think that's necessary even though the time
and bandwidth savings are obvious. ;-)
LogicalXORmight not be required often

Bingo. The C standard isn't meant to codify everything that
might possibly be useful, rather the first standard mostly
codified existing _minimum_ practice. True, there were
some major additions (void, unsigned types, etc...) but
there's no shortage of 'wish list' items that were
rejected.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,175
Latest member
Vinay Kumar_ Nevatia
Top