Version very simple?

Steven Schveighoffer schveiguy at yahoo.com
Sun Feb 27 11:19:01 PST 2011


On Sun, 27 Feb 2011 10:20:46 -0500, David Nadlinger <see at klickverbot.at>  
wrote:

> On 2/27/11 4:14 PM, Steven Schveighoffer wrote:
>> But here is essentially the way to do your thingy.
>>
>> version(IDENT)
>> {
>> }
>> else version(IDENT2)
>> {
>> }
>> else
>> {
>> version=NOT_IDENT_OR_IDENT2;
>> }
>>
>> version(NOT_IDENT_OR_IDENT2)
>> {
>> ...
>> }
>
> Wouldn't that be »!(IDENT || IDENT2)«, as opposed to »!IDENT || !IDENT2«?
>
> David

Yes, my version is wrong.  simendsjo's version is probably the only way to  
do it.  It's difficult to reason about negative booleans.

-Steve


More information about the Digitalmars-d-learn mailing list