English binary logic operators

Bill Baxter wbaxter at gmail.com
Tue Nov 28 08:20:22 PST 2006


Daniel Keep wrote:
> Thomas Kuehne wrote:
> 
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA1
>>
>> David Qualls schrieb am 2006-11-28:
>>
>>
>>> Perhaps a few more BRIEF opinions regarding whether the standard
>>> English operators should be adopted within the D language would be
>>> enough to send the think-tank to their Cave Of Contemplation to
>>> debate it amongst themselves. 
>>
>>
>>
>> Adding addtional keywords that have exactly the same functions like
>> already present keywords (actually keytokens) seems to be against D's
>> spirit.
>>
>> The more general issue: Iv'e checked 10 random C/C++ projects
>> (taken from Gentoo's portage) and none of them used iso646.h's 
>> alternative
>> spellings.
>>
>> Thomas
>>
>>
>> -----BEGIN PGP SIGNATURE-----
>>
>> iD8DBQFFa+7ZLK5blCcjpWoRAgQdAJ0UBatA3czG0A5+wZdMwcl50q/39gCghILf
>> fpEBz2SVezekjI+rWqpibfE=
>> =nQ5N
>> -----END PGP SIGNATURE-----
> 
> 
> Hang on... doesn't that header define macros that look like normal 
> prefix functions?  You're comparing this:
> 
>  > (expr1 and expr2) or (expr2 and expr3)
> 
> with this:
> 
>  > or(and(expr1, expr2), and(expr2, expr3))
> 
[snip]

> 
> Blech; I'm rambling.  Sorry about that :)

And not doing your homework either. :-)

A rudimentary google search turns up:

#define and && [keyword in C++]
#define and_eq &= [keyword in C++]
#define bitand & [keyword in C++]
#define bitor | [keyword in C++]
#define compl ~ [keyword in C++]
#define not ! [keyword in C++]
#define not_eq != [keyword in C++]
#define or || [keyword in C++]
#define or_eq |= [keyword in C++]
#define xor ^ [keyword in C++]
#define xor_eq ^= [keyword in C++]

So, no, iso464.h is not about prefix operators.  Just some simple #defines.

Interesting story about Australia not becoming a republic though.  :-)

--bb



More information about the Digitalmars-d-learn mailing list