June 23, 2018
On 2018-06-22 17:46, Steven Schveighoffer wrote:
> On 6/22/18 11:31 AM, Jacob Carlborg wrote:
>> On 2018-06-20 10:16, Mike Parker wrote:
>>> This is the feedback thread for the first round of Community Review for
>>> DIP 1015, "Deprecation and removal of implicit conversion from integer
>>> and character literals to bool":
>>
>> The text says: "Only literals that evaluate to 0 or 1 are affected;
>> all other literals are to remain unchanged" [1]. This goes against
>> example A [2].
>>
>> [1]
>> https://github.com/dlang/DIPs/blob/7c2c39243d0d747191f05fb08f87e1ebcb575d84/DIPs/DIP1015.md#description
>>
>>
>> [2]
>> https://github.com/dlang/DIPs/blob/7c2c39243d0d747191f05fb08f87e1ebcb575d84/DIPs/DIP1015.md#example-a
>>
>>
>
> Which literals don't evaluate to 0 or 1 in example A?

I read that as only the 0 and 1 literals would be affected by this proposal, i.e. the integer literals. But the examples are mentioning character literals as well. But if the character literals are evaluated to 0 or 1, perhaps everything is covered. But at least to me it's a bit unclear.

> Also, example A is just showing what currently compiles, not what is to
> be affected.

Then Example D is a better example [1].

[1] https://github.com/dlang/DIPs/blob/7c2c39243d0d747191f05fb08f87e1ebcb575d84/DIPs/DIP1015.md#example-d

-- 
/Jacob Carlborg
June 23, 2018
On Saturday, 23 June 2018 at 08:03:40 UTC, Jacob Carlborg wrote:

> I read that as only the 0 and 1 literals would be affected by this proposal, i.e. the integer literals. But the examples are mentioning character literals as well. But if the character literals are evaluated to 0 or 1, perhaps everything is covered. But at least to me it's a bit unclear.

The DIP attempts to disambiguate that by using conventions.  When referring to code it always uses backticks.  When referring to English interpretation of the words, it does not.

The DIP states "integer and character literals that evaluate to 0 and 1".  Note that it doesn't say "`int` literals" and "`char` literals", nor does it say "`0`" or "`1`".  Therefore, the DIP is using the English interpretation of the words "integer", "character", "0", and "1".  "integer" means `int`, `uint`, `long`, etc, "character" means `char`, `dchar`, `wchar`, etc, "0" means `0`, `0L`, `'\0'`, etc. and "1" means `1`, `1L`, `'\1'`, etc.

I hope that helps.

Mike


June 23, 2018
On Saturday, 23 June 2018 at 10:18:04 UTC, Mike Franklin wrote:

> The DIP states "integer and character literals that evaluate to 0 and 1".

But I see that in the "Description" it uses `0` and `1`, so I'll remedy that with my next round of edits.

Thanks for the feedback.

Mike


1 2 3
Next ›   Last »