Re: DIP 1015--Deprecation of Implicit Conversion of Int. & Char. Literals to bool--Formal Assement

2018-11-13 Thread Walter Bright via Digitalmars-d-announce
On 11/13/2018 8:37 PM, Isaac S. wrote: It probably depends on where someone is from (asinine isn't considered a big insult where I live [rural US]). Regardless of that, I will admit I did overstep (especially in calling Walter ignorant) and so I do apologize to Walter (I'm sorry that sounds in

Re: DIP 1015--Deprecation of Implicit Conversion of Int. & Char. Literals to bool--Formal Assement

2018-11-13 Thread Walter Bright via Digitalmars-d-announce
On 11/13/2018 8:49 PM, Jonathan M Davis wrote: Not AFAIK, but calling someone or something extremely stupid or foolish is almost always a terrible idea in a professional discussion (or pretty much any discussion that you want to be civil) - especially if it can be interpreted as calling the perso

Re: DIP 1015--Deprecation of Implicit Conversion of Int. & Char. Literals to bool--Formal Assement

2018-11-13 Thread Nicholas Wilson via Digitalmars-d-announce
On Wednesday, 14 November 2018 at 06:56:12 UTC, aliak wrote: On Tuesday, 13 November 2018 at 09:17:51 UTC, Walter Bright wrote: [...] Ok, thanks! [...] Bummer. At least if this enum : int case is fixed that doesn't seem like it's hard to work out in my head at least - but I guess I'm miss

Re: DIP 1015--Deprecation of Implicit Conversion of Int. & Char. Literals to bool--Formal Assement

2018-11-13 Thread aliak via Digitalmars-d-announce
On Tuesday, 13 November 2018 at 09:17:51 UTC, Walter Bright wrote: On 11/13/2018 12:23 AM, aliak wrote: Doesn't the above miss a step, and wouldn't it be: 1) A.a => 2) A.a => So basically for the f(short) path you have 3 steps instead of 2 for the f(int) path. So does it matter how many

Re: DIP 1015--Deprecation of Implicit Conversion of Int. & Char. Literals to bool--Formal Assement

2018-11-13 Thread Isaac S. via Digitalmars-d-announce
On Wednesday, 14 November 2018 at 04:37:38 UTC, Isaac S. wrote: On Wednesday, 14 November 2018 at 04:27:29 UTC, Nicholas Wilson wrote: asinine, adjective: extremely stupid or foolish. Is there some additional connotation I am missing on this living (comparatively) in the middle of nowhere? (Gen

Re: DIP 1015--Deprecation of Implicit Conversion of Int. & Char. Literals to bool--Formal Assement

2018-11-13 Thread Jonathan M Davis via Digitalmars-d-announce
On Tuesday, November 13, 2018 9:27:29 PM MST Nicholas Wilson via Digitalmars-d-announce wrote: > On Wednesday, 14 November 2018 at 04:24:20 UTC, Jonathan M Davis > > wrote: > > Given how strong the negative response is to this and how > > incomprenhensible a number of us find the reasoning behind

Re: DIP 1015--Deprecation of Implicit Conversion of Int. & Char. Literals to bool--Formal Assement

2018-11-13 Thread Nicholas Wilson via Digitalmars-d-announce
On Wednesday, 14 November 2018 at 04:33:23 UTC, Isaac S. wrote: On Wednesday, 14 November 2018 at 04:27:05 UTC, Walter Bright wrote: There have been various attempts over the years to "fix" various things in the D matching system by adding "just one more" match level. I've rejected all of them,

Re: DIP 1015--Deprecation of Implicit Conversion of Int. & Char. Literals to bool--Formal Assement

2018-11-13 Thread Isaac S. via Digitalmars-d-announce
On Wednesday, 14 November 2018 at 04:27:29 UTC, Nicholas Wilson wrote: asinine, adjective: extremely stupid or foolish. Is there some additional connotation I am missing on this living (comparatively) in the middle of nowhere? (Genuine question.) It probably depends on where someone is from (a

Re: DIP 1015--Deprecation of Implicit Conversion of Int. & Char. Literals to bool--Formal Assement

2018-11-13 Thread Isaac S. via Digitalmars-d-announce
On Wednesday, 14 November 2018 at 04:27:05 UTC, Walter Bright wrote: There have been various attempts over the years to "fix" various things in the D matching system by adding "just one more" match level. I've rejected all of them, because things that look simple and obvious with trivial exampl

Re: DIP 1015--Deprecation of Implicit Conversion of Int. & Char. Literals to bool--Formal Assement

2018-11-13 Thread Nicholas Wilson via Digitalmars-d-announce
On Wednesday, 14 November 2018 at 04:24:20 UTC, Jonathan M Davis wrote: Given how strong the negative response is to this and how incomprenhensible a number of us find the reasoning behind how bool functions in some scenarios, Walter probably does need to sit back and think about this, but usin

Re: DIP 1015--Deprecation of Implicit Conversion of Int. & Char. Literals to bool--Formal Assement

2018-11-13 Thread Walter Bright via Digitalmars-d-announce
On 11/13/2018 7:12 PM, Isaac S. wrote: why should an enum not convert to its declared type, rather than blindly using its literal value. Just using the literal value discards the secondary-type information the programmer had given it. D has the following match levels: 1. exact 2. conversion

Re: DIP 1015--Deprecation of Implicit Conversion of Int. & Char. Literals to bool--Formal Assement

2018-11-13 Thread Jonathan M Davis via Digitalmars-d-announce
On Tuesday, November 13, 2018 8:47:01 PM MST Nicholas Wilson via Digitalmars-d-announce wrote: > On Wednesday, 14 November 2018 at 03:02:48 UTC, Walter Bright > > wrote: > > On 11/13/2018 3:50 PM, Isaac S. wrote: > >> is asinine and ignorant. > > > > Some friendly advice - nobody is going to pay s

Re: DIP 1015--Deprecation of Implicit Conversion of Int. & Char. Literals to bool--Formal Assement

2018-11-13 Thread Nicholas Wilson via Digitalmars-d-announce
On Wednesday, 14 November 2018 at 03:02:48 UTC, Walter Bright wrote: On 11/13/2018 3:50 PM, Isaac S. wrote: is asinine and ignorant. Some friendly advice - nobody is going to pay serious attention to articles that sum up with such unprofessional statements. Continuing the practice will just

Re: DIP 1015--Deprecation of Implicit Conversion of Int. & Char. Literals to bool--Formal Assement

2018-11-13 Thread Isaac S. via Digitalmars-d-announce
On Wednesday, 14 November 2018 at 03:02:48 UTC, Walter Bright wrote: On 11/13/2018 3:50 PM, Isaac S. wrote: is asinine and ignorant. Some friendly advice - nobody is going to pay serious attention to articles that sum up with such unprofessional statements. Continuing the practice will just

Re: DIP 1015--Deprecation of Implicit Conversion of Int. & Char. Literals to bool--Formal Assement

2018-11-13 Thread Walter Bright via Digitalmars-d-announce
On 11/13/2018 3:50 PM, Isaac S. wrote: is asinine and ignorant. Some friendly advice - nobody is going to pay serious attention to articles that sum up with such unprofessional statements. Continuing the practice will just result in the moderators removing them.

Re: DIP 1015--Deprecation of Implicit Conversion of Int. & Char. Literals to bool--Formal Assement

2018-11-13 Thread Isaac S. via Digitalmars-d-announce
On Wednesday, 14 November 2018 at 02:45:38 UTC, Walter Bright wrote: In your articles, it is crucial to understand the difference between a manifest constant of type `int` and one of type `A`. Still doesn't change the fact that a typed enum should convert to its own type first (rather than bli

Re: DIP 1015--Deprecation of Implicit Conversion of Int. & Char. Literals to bool--Formal Assement

2018-11-13 Thread Walter Bright via Digitalmars-d-announce
On 11/13/2018 3:29 PM, Rubn wrote: enum : int { a = 127 } To reiterate, this does not create an anonymous enum type. 'a' is typed as 'int'. Technically, `a` is a manifest constant of type `int` with a value of `127`. > enum A : int { a = 127 } `a` is a manifest constant of type `A` with a

Re: DIP 1015--Deprecation of Implicit Conversion of Int. & Char. Literals to bool--Formal Assement

2018-11-13 Thread Neia Neutuladh via Digitalmars-d-announce
On Wed, 14 Nov 2018 00:43:54 +, Rubn wrote: > I wonder what these examples are? What did C++ do instead, cause > something tells me it didn't do what D is doing. An enum in C++ doesn't > call different function overloads based on the constant value. Long long and unsigned long long give an amb

Re: DIP 1015--Deprecation of Implicit Conversion of Int. & Char. Literals to bool--Formal Assement

2018-11-13 Thread Rubn via Digitalmars-d-announce
On Monday, 12 November 2018 at 22:07:39 UTC, Walter Bright wrote: One could have be treated as "better than" , and it sounds like a good idea, but even C++, not known for simplicity, tried that and had to abandon it as nobody could figure it out once the code examples got beyond trivial exam

Re: DIP 1015--Deprecation of Implicit Conversion of Int. & Char. Literals to bool--Formal Assement

2018-11-13 Thread Isaac S. via Digitalmars-d-announce
On Monday, 12 November 2018 at 22:07:39 UTC, Walter Bright wrote: int f(short s) { return 1; } int f(int i) { return 2; } enum : int { a = 0 } enum A : int { a = 0 } pragma (msg, f(a)); // calls f(int) pragma (msg, f(A.a)); // calls f(short) *snip* So f(short) is selected, because the "Most

Re: DIP 1015--Deprecation of Implicit Conversion of Int. & Char. Literals to bool--Formal Assement

2018-11-13 Thread NoMoreBugs via Digitalmars-d-announce
On Monday, 12 November 2018 at 10:05:09 UTC, Jonathan M Davis wrote: *sigh* Well, I guess that's the core issue right there. A lot of us would strongly disagree with the idea that bool is an integral type and consider code that treats it as such as inviting bugs. We _want_ bool to be consider

Re: DIP 1015--Deprecation of Implicit Conversion of Int. & Char. Literals to bool--Formal Assement

2018-11-13 Thread Rubn via Digitalmars-d-announce
On Monday, 12 November 2018 at 22:07:39 UTC, Walter Bright wrote: On 11/12/2018 12:34 PM, Neia Neutuladh wrote: Tell me more about this "consistency". int f(short s) { return 1; } int f(int i) { return 2; } enum : int { a = 0 } enum A : int { a = 0 } pragma (msg, f(a)); // calls f(int) pra

Re: DMD backend now in D

2018-11-13 Thread Joakim via Digitalmars-d-announce
On Tuesday, 13 November 2018 at 20:42:00 UTC, Temtaime wrote: On Monday, 12 November 2018 at 02:37:54 UTC, Walter Bright wrote: On 11/11/2018 3:58 PM, Mike Franklin wrote: This is a significant milestone.  Congratulations, Walter! Many people helped out with this, too. There are still a few

Re: DMD backend now in D

2018-11-13 Thread Temtaime via Digitalmars-d-announce
On Monday, 12 November 2018 at 02:37:54 UTC, Walter Bright wrote: On 11/11/2018 3:58 PM, Mike Franklin wrote: This is a significant milestone.  Congratulations, Walter! Many people helped out with this, too. There are still a few .c files in https://github.com/dlang/dmd/tree/master/src/dmd/b

Re: DIP 1015--Deprecation of Implicit Conversion of Int. & Char. Literals to bool--Formal Assement

2018-11-13 Thread Neia Neutuladh via Digitalmars-d-announce
On Tue, 13 Nov 2018 17:53:27 +, 12345swordy wrote: > Ok, now that has got to be a bug. If you explicit cast the number to an > integer then you expect the overload function with int to be called. > > -Alex ...my mistake, I can't reproduce that anymore. Pretend I didn't say anything.

Re: DIP 1015--Deprecation of Implicit Conversion of Int. & Char. Literals to bool--Formal Assement

2018-11-13 Thread Neia Neutuladh via Digitalmars-d-announce
On Tue, 13 Nov 2018 09:46:17 -0500, Steven Schveighoffer wrote: > Maybe the biggest gripe here is that enums don't prefer their base types > over what their base types convert to. In the developer's mind, the > conversion is: > > A => int => (via VRP) short > > which seems more complex than just

Re: DIP 1015--Deprecation of Implicit Conversion of Int. & Char. Literals to bool--Formal Assement

2018-11-13 Thread 12345swordy via Digitalmars-d-announce
On Tuesday, 13 November 2018 at 17:50:20 UTC, Neia Neutuladh wrote: On Tue, 13 Nov 2018 09:46:17 -0500, Steven Schveighoffer wrote: Maybe the biggest gripe here is that enums don't prefer their base types over what their base types convert to. In the developer's mind, the conversion is: A =>

Re: DIP 1015--Deprecation of Implicit Conversion of Int. & Char. Literals to bool--Formal Assement

2018-11-13 Thread Steven Schveighoffer via Digitalmars-d-announce
On 11/13/18 11:26 AM, Chris M. wrote: On Monday, 12 November 2018 at 09:45:14 UTC, Mike Parker wrote: DIP 1015, "Deprecation and removal of implicit conversion from integer and character literals to bool, has been rejected, primarily on the grounds that it is factually incorrect in treating boo

Re: DIP 1015--Deprecation of Implicit Conversion of Int. & Char. Literals to bool--Formal Assement

2018-11-13 Thread Chris M. via Digitalmars-d-announce
On Monday, 12 November 2018 at 09:45:14 UTC, Mike Parker wrote: DIP 1015, "Deprecation and removal of implicit conversion from integer and character literals to bool, has been rejected, primarily on the grounds that it is factually incorrect in treating bool as a type distinct from other integr

Re: DIP 1015--Deprecation of Implicit Conversion of Int. & Char. Literals to bool--Formal Assement

2018-11-13 Thread Chris M. via Digitalmars-d-announce
On Tuesday, 13 November 2018 at 16:26:55 UTC, Chris M. wrote: On Monday, 12 November 2018 at 09:45:14 UTC, Mike Parker wrote: [...] I was going to write something up about how you can't do arithmetic on bool types therefore they aren't integral, but I tested and realized D allows this (i.e.

Re: DIP 1015--Deprecation of Implicit Conversion of Int. & Char. Literals to bool--Formal Assement

2018-11-13 Thread Steven Schveighoffer via Digitalmars-d-announce
On 11/12/18 4:38 PM, Walter Bright wrote: On 11/12/2018 8:28 AM, 12345swordy wrote: The issue that I see is unintended implicit conversation when passing values to functions that have both int and bool overloads. The exact same thing happens when there are both int and short overloads. The un

Re: NES emulator written in D

2018-11-13 Thread blahness via Digitalmars-d-announce
On Tuesday, 13 November 2018 at 08:24:05 UTC, Manu wrote: A great test is to emulate an Atari2600; you'll know your 6502 is 100% perfect if you can play pitfall or some other complex 2600 games ;) I can't see how your cycle counting logic works, it looks like it's missing a lot of cycles. How d

Re: DIP 1015--Deprecation of Implicit Conversion of Int. & Char. Literals to bool--Formal Assement

2018-11-13 Thread Walter Bright via Digitalmars-d-announce
On 11/13/2018 12:23 AM, aliak wrote: Doesn't the above miss a step, and wouldn't it be: 1) A.a => 2) A.a => So basically for the f(short) path you have 3 steps instead of 2 for the f(int) path. So does it matter how many implicit conversions need to happen before D stops trying? Or is i

Re: DIP 1015--Deprecation of Implicit Conversion of Int. & Char. Literals to bool--Formal Assement

2018-11-13 Thread NoMoreBugs via Digitalmars-d-announce
On Tuesday, 13 November 2018 at 07:13:01 UTC, NoMoreBugs wrote: You nailed it on the head. The only sensible course of action, therefore, is to give programmers the option to disable implicit conversions, completely (or if doable, more precisely). And while you're thinking about how to do t

Re: DIP 1015--Deprecation of Implicit Conversion of Int. & Char. Literals to bool--Formal Assement

2018-11-13 Thread aliak via Digitalmars-d-announce
On Monday, 12 November 2018 at 22:07:39 UTC, Walter Bright wrote: On 11/12/2018 12:34 PM, Neia Neutuladh wrote: Tell me more about this "consistency". int f(short s) { return 1; } int f(int i) { return 2; } enum : int { a = 0 } enum A : int { a = 0 } pragma (msg, f(a)); // calls f(int) pra

Re: NES emulator written in D

2018-11-13 Thread Manu via Digitalmars-d-announce
On Mon, Nov 12, 2018 at 10:30 PM blahness via Digitalmars-d-announce wrote: > > On Tuesday, 13 November 2018 at 05:59:52 UTC, Manu wrote: > > > > Nice work. > > > > Oh wow, this is pretty rough! > > ``` > > void createTable() { > > this.table = [ > > &this.brk, &this.ora, &this.kil, &this.sl