On 7/12/17 5:24 PM, Johan Engelen wrote:
On Wednesday, 12 July 2017 at 20:12:03 UTC, Steven Schveighoffer wrote:
...
Which means this may cause a bunch of nuisance errors.
It's a trade-off between nuisance in some cases (the Phobos ones can be
solved with val = abs(val), or with static if), a
On 7/11/2017 12:46 PM, Johan Engelen wrote:
So, adding the error may be nice, but it would make generic code a little more
verbose.
The particular issue you were having appears to be a bug in the compiler (I
already filed it as a bug report). Being a bug, we need more evidence that
adding an
On Wednesday, 12 July 2017 at 20:12:03 UTC, Steven Schveighoffer
wrote:
...
Which means this may cause a bunch of nuisance errors.
It's a trade-off between nuisance in some cases (the Phobos ones
can be solved with val = abs(val), or with static if), and
possibly catching bugs in other cases.
On 7/12/17 11:00 AM, Andrei Alexandrescu wrote:
On 07/11/2017 03:46 PM, Johan Engelen wrote:
So, adding the error may be nice, but it would make generic code a
little more verbose.
Ideas? People OK with that?
A compelling argument is that the rule exposed two bugs in Phobos. --
Andrei
Th
On 07/11/2017 03:46 PM, Johan Engelen wrote:
So, adding the error may be nice, but it would make generic code a
little more verbose.
Ideas? People OK with that?
A compelling argument is that the rule exposed two bugs in Phobos. -- Andrei
Walter Bright wrote:
On 7/11/2017 12:46 PM, Johan Engelen wrote:
uint total = 0;
void add(int x) { total += x; }
ubyte popCount() { return 5; }
add(popCount());
add(-popCount());
writeln(total); // <-- what does this print? (behavior is different from
C)
The behavior should be the same.
htt
On 7/11/2017 12:46 PM, Johan Engelen wrote:
uint total = 0;
void add(int x) { total += x; }
ubyte popCount() { return 5; }
add(popCount());
add(-popCount());
writeln(total); // <-- what does this print? (behavior is different from C)
The behavior should be the same.
https://issues.dlang.org/s
On Tuesday, 11 July 2017 at 20:05:43 UTC, Johan Engelen wrote:
On Tuesday, 11 July 2017 at 20:02:07 UTC, Johan Engelen wrote:
On Tuesday, 11 July 2017 at 19:57:06 UTC, Johan Engelen wrote:
On Tuesday, 11 July 2017 at 19:46:00 UTC, Johan Engelen wrote:
[...]
Also this nice hackery would need
On Tuesday, 11 July 2017 at 19:46:00 UTC, Johan Engelen wrote:
The Weka folks would like to see a compile error on negating
unsigned types:
The error would be great!
I've filed a bug yesterday:
https://issues.dlang.org/show_bug.cgi?id=17633
In it I asked to change the result type, b
<
digitalmars-d@puremagic.com> wrote:
> On Tuesday, 11 July 2017 at 19:46:00 UTC, Johan Engelen wrote:
>
>> The Weka folks would like to see a compile error on negating unsigned
>> types:
>>
>
> Also this nice hackery would need a workaround:
> ```
>if ((y&(-y))==y)
> ```
>
>
>
On Tuesday, 11 July 2017 at 20:02:07 UTC, Johan Engelen wrote:
On Tuesday, 11 July 2017 at 19:57:06 UTC, Johan Engelen wrote:
On Tuesday, 11 July 2017 at 19:46:00 UTC, Johan Engelen wrote:
The Weka folks would like to see a compile error on negating
unsigned types:
Also this nice hackery
On Tuesday, 11 July 2017 at 19:57:06 UTC, Johan Engelen wrote:
On Tuesday, 11 July 2017 at 19:46:00 UTC, Johan Engelen wrote:
The Weka folks would like to see a compile error on negating
unsigned types:
Also this nice hackery would need a workaround:
```
if ((y&(-y))==y)
```
On Tuesday, 11 July 2017 at 19:46:00 UTC, Johan Engelen wrote:
The Weka folks would like to see a compile error on negating
unsigned types:
Also this nice hackery would need a workaround:
```
if ((y&(-y))==y)
```
The Weka folks would like to see a compile error on negating
unsigned types:
```
uint total = 0;
void add(int x) { total += x; }
ubyte popCount() { return 5; }
add(popCount());
add(-popCount());
writeln(total); // <-- what does this print? (behavior is
different from C)
```
After adding
14 matches
Mail list logo