1 matches bool, 2 matches long

Steven Schveighoffer schveiguy at yahoo.com
Tue Apr 30 07:47:12 PDT 2013


On Mon, 29 Apr 2013 11:39:27 -0700, Walter Bright  
<newshound2 at digitalmars.com> wrote:

> On 4/29/2013 10:10 AM, Steven Schveighoffer wrote:
>>
>> I think you are inventing a strawman problem that this bug solves.   
>> There is no
>> need for a "Better" scheme, partial ordering works great, and so do  
>> true and false.
>>
>> bool isn't an integer.  It can implicitly cast to an integer, but  
>> that's it.
>> Once we implement that rule, everything falls into place.  If you want  
>> to pass a
>> "true" boolean literal, use true.  If you want to pass a "false"  
>> boolean literal
>> use false.  Using 1 and 0 may be convenient, and may also be valid, but  
>> when it
>> matches an integral type as well as bool, then it's ambiguous.
>
> Carefully reading your statement, you are still arguing that matching 1  
> to long should be "better" than matching it to bool.

Yes, just like it's better matching to long than string.

-Steve


More information about the Digitalmars-d mailing list