English binary logic operators
Sean Kelly
sean at f4.ca
Tue Nov 28 08:16:26 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?
No. They actually alias '&&' with 'and'. Macros are a wonderful (read:
terrifying) thing.
> You're comparing this:
>
> > (expr1 and expr2) or (expr2 and expr3)
>
> with this:
>
> > or(and(expr1, expr2), and(expr2, expr3))
>
> Given the choice between the existing boolean operators and the second
> lot, I'd choose the existing ones any day. Given the choice between the
> existing operators and the first lot, I'd chose the first lot.
Then you're in luck, so long as you're using C/C++ :-)
Sean
More information about the Digitalmars-d-learn
mailing list