May 13, 2021

On Thursday, 13 May 2021 at 14:34:15 UTC, IGotD- wrote:

>

On Thursday, 13 May 2021 at 14:25:53 UTC, rempas wrote:

>

Exactly! We can mix things up a little! Or even add a new statement called "match" idk

That could be possibility to add pattern matching capabilities to D and renew switch that way and add new features as well. D already has some kind of "match" but implemented as a library, maybe D should extend that and bring into the language.

Not "should", they "must" do it! Like I said, a language must always move forward! However I said my opinion, now it's up to them to decide if they want to do it or not...

May 13, 2021

On Thursday, 13 May 2021 at 14:12:40 UTC, Ola Fosheim Grøstad wrote:

>

On Thursday, 13 May 2021 at 13:55:10 UTC, IGotD- wrote:

>

In practice this is possible by just add another keyword. Something like "switch2", "switchb", can't really come up with good name. Then you just have a switch with break as default. What I have against it is that a new type of bugs will occur where the programmers accidentally mix up the two.

Just use a different keyword than "case"? Like "when"?

or "on", if this does not cause problems with the try catch construct.

May 13, 2021

On Thursday, 13 May 2021 at 13:28:07 UTC, rempas wrote:

>

Yeah yeah I know I know, Code that looks like C should have the same behavior to C. I've asked about that and I got the same answer. But come one! We can make an exception on this one! We don't need that in D as we can add more cases.

I really love the work the contributors do with D but IMO is things like that who really stop D from REALLY going forward in the next level. Doing things just for doing them NEVER helped anyone!

what are you proposing is not clear. Is that

"turn the deprecation into an error for good" or "remove the deprecation" ?

May 13, 2021
On 5/13/21 10:27 AM, rempas wrote:
> On Thursday, 13 May 2021 at 14:15:15 UTC, Steven Schveighoffer wrote:
>> On 5/13/21 9:28 AM, rempas wrote:
>>> [...]
>>
>> It's already deprecated, since 2.072. It's also been a warning since 2.054. I'm not sure if this is intended to be removed or not, but removing it today would put it at a 4.5 year deprecation period, and 10 years since it's been a warning.
>>
>>> [...]
>>
>> Nobody thinks case fallthrough is good, this is why it's a warning and deprecated.
>>
> 
> My mistake for not being clear, like I said to the other comments, I mean that we should not need the "break" anymore.

First step is to make implicit fallthrough an error instead of a deprecation. Then after a time, we might be able to make break optional.

-Steve
May 13, 2021

On Thursday, 13 May 2021 at 14:25:53 UTC, rempas wrote:

>

On Thursday, 13 May 2021 at 14:12:40 UTC, Ola Fosheim Grøstad wrote:

>

On Thursday, 13 May 2021 at 13:55:10 UTC, IGotD- wrote:

>

In practice this is possible by just add another keyword. Something like "switch2", "switchb", can't really come up with good name. Then you just have a switch with break as default. What I have against it is that a new type of bugs will occur where the programmers accidentally mix up the two.

Just use a different keyword than "case"? Like "when"?

Exactly! We can mix things up a little! Or even add a new statement called "match" idk

Please don't add more to the language. Just remove fallthrough. Done.

May 13, 2021

On Thursday, 13 May 2021 at 16:51:07 UTC, Imperatorn wrote:

>

Please don't add more to the language. Just remove fallthrough. Done.

Or better yet just leave it alone (existing deprecation to error is ok though). The explicit status quo is a solid situation.

May 13, 2021

On Thursday, 13 May 2021 at 16:51:07 UTC, Imperatorn wrote:

>

Please don't add more to the language. Just remove fallthrough. Done.

That makes all C code break when ported to D with no warning.

May 13, 2021

On Thursday, 13 May 2021 at 17:16:01 UTC, Ola Fosheim Grøstad wrote:

>

On Thursday, 13 May 2021 at 16:51:07 UTC, Imperatorn wrote:

>

Please don't add more to the language. Just remove fallthrough. Done.

That makes all C code break when ported to D with no warning.

Indeed, warning is needed when and if this gets implemented.

May 13, 2021
On Thursday, 13 May 2021 at 16:48:36 UTC, Steven Schveighoffer wrote:
> First step is to make implicit fallthrough an error instead of a deprecation. Then after a time, we might be able to make break optional.
>
> -Steve

Exactly! I hope the community will think about it. Like I said, I don't think having some stuff like they are just to do it is a good thing for anyone.
May 13, 2021

On Thursday, 13 May 2021 at 16:56:58 UTC, Adam D. Ruppe wrote:

>

On Thursday, 13 May 2021 at 16:51:07 UTC, Imperatorn wrote:

>

Please don't add more to the language. Just remove fallthrough. Done.

Or better yet just leave it alone (existing deprecation to error is ok though). The explicit status quo is a solid situation.

Well, yeah. I personally don't really have a problem with adding break. I always do it anyway