On Tue, 21 Jun 2016 19:31:55 +0900, Simon Walter wrote:
[About short-circuiting logical operators]
> I am thinking we might use single ampersand or pipe (bitwise). Can we 
> use bitwise operators as what would be a non-short-circuiting logical 
> operator in C (or other languages)?

We could. But it is a kludge, and very bad style. 

Consider: 

  Eager logical AND:  ( !!(A) & !!(B) )
  Eager logical OR:   ( !!(A) | !!(B) )

The double logical NOT "normalizes" the range of possible 
values to the set (0;1). Thus you could even get away with 
using above with expressions of non-integer type, e.g. 
pointers. But at least in my book it'd count as "unwanted 
chumminess with the C standard". ;-)

Regards
Urban

_______________________________________________
Dng mailing list
[email protected]
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng

Reply via email to