On Friday, 21 April 2017 at 08:36:12 UTC, Nick Treleaven wrote:
Converting from char types -> integers, whilst (arguably) bug
prone, at least is numerically sound. So perhaps we could
disallow uint -> dchar, which is unsound.
That is in the general case - when VRP can prove an integer fits
On Thursday, 20 April 2017 at 11:05:00 UTC, Nick Treleaven wrote:
On Wednesday, 19 April 2017 at 14:50:38 UTC, Stanislav Blinov
wrote:
Because integrals implicitly convert to characters of same
width (byte -> char, short -> wchar, int -> dchar).
Despite char.min > byte.min, char.max <
On Wednesday, 19 April 2017 at 14:50:38 UTC, Stanislav Blinov
wrote:
On Wednesday, 19 April 2017 at 14:36:13 UTC, Nick Treleaven
Why is it legal to append an integer?
Because integrals implicitly convert to characters of same
width (byte -> char, short -> wchar, int -> dchar).
Huh... I
On Thu, Apr 20, 2017 at 10:39:01PM +, Stanislav Blinov via
Digitalmars-d-learn wrote:
> On Thursday, 20 April 2017 at 19:20:28 UTC, H. S. Teoh wrote:
>
>
> > Another pernicious thing I encountered recently, related to implicit
> > conversions, is this:
> >
> >
On Thursday, 20 April 2017 at 19:20:28 UTC, H. S. Teoh wrote:
Another pernicious thing I encountered recently, related to
implicit conversions, is this:
https://issues.dlang.org/show_bug.cgi?id=17336
It drew a very enunciated "WAT?!" from me.
Yeah, that one is annoying. I've dealt
On 04/19/2017 01:34 PM, Jonathan M Davis via Digitalmars-d-learn wrote:
Yeah, which reduces the number of casts required when doing arithmetic on
characters and thus reduces bugs there,
Ugh, because apparently doing arithmetic on characters is such a common,
important use-case in this modern
On Thu, Apr 20, 2017 at 11:05:00AM +, Nick Treleaven via
Digitalmars-d-learn wrote:
[...]
> This is also a problem for overloading:
>
> alias foo = (char c) => 1;
> alias foo = (int i) => 4;
>
> static assert(foo(7) == 4); // fails
>
> I would like to see some small changes to mitigate
On Wednesday, 19 April 2017 at 14:50:38 UTC, Stanislav Blinov
wrote:
Because integrals implicitly convert to characters of same
width (byte -> char, short -> wchar, int -> dchar).
Despite char.min > byte.min, char.max < byte.max. Anyway,
appending an integer is inconsistent because
On Wednesday, 19 April 2017 at 18:40:23 UTC, H. S. Teoh wrote:
A few extra keystrokes to type cast(int) or cast(char) ain't
gonna kill nobody. In fact, it might even save a few people by
preventing certain kinds of bugs.
Yup. Not to mention one could have
@property
auto
On Wed, Apr 19, 2017 at 05:56:18PM +, Stanislav Blinov via
Digitalmars-d-learn wrote:
> On Wednesday, 19 April 2017 at 17:34:01 UTC, Jonathan M Davis wrote:
> > Personally, I think that we should have taken the stricter approach
> > and not had integral types implicit convert to character
On Wednesday, 19 April 2017 at 17:34:01 UTC, Jonathan M Davis
wrote:
Personally, I think that we should have taken the stricter
approach and not had integral types implicit convert to
character types, but from what I recall, Walter feels pretty
strongly about the conversion rules being the
On Wednesday, April 19, 2017 14:50:38 Stanislav Blinov via Digitalmars-d-
learn wrote:
> On Wednesday, 19 April 2017 at 14:36:13 UTC, Nick Treleaven wrote:
> > This bug is fixed as the code no longer segfaults but throws
> > instead:
> > https://issues.dlang.org/show_bug.cgi?id=5995
> >
> > void
On Wednesday, 19 April 2017 at 14:36:13 UTC, Nick Treleaven wrote:
This bug is fixed as the code no longer segfaults but throws
instead:
https://issues.dlang.org/show_bug.cgi?id=5995
void main(){
string ret;
int i = -1;
ret ~= i;
}
Why is it legal to append an integer?
This bug is fixed as the code no longer segfaults but throws
instead:
https://issues.dlang.org/show_bug.cgi?id=5995
void main(){
string ret;
int i = -1;
ret ~= i;
}
Why is it legal to append an integer?
14 matches
Mail list logo