Editions Ideas

Richard (Rikki) Andrew Cattermole richard at cattermole.co.nz
Mon Jan 12 01:50:13 UTC 2026


On 12/01/2026 3:15 AM, Vladimir Panteleev wrote:
> On Sunday, 11 January 2026 at 06:47:42 UTC, IchorDev wrote:
>> One big thing I'd love would be for us to stop requiring a `break` at 
>> the end of each `case`; instead a case should default to breaking at 
>> the end, which is what you want 99% of the time. We already require an 
>> explicit `goto case` for fall-through, and give an error otherwise, so 
>> this won't break existing code.
> 
> I don't think this is going to happen due to C source compatibility 
> being one of the design goals of D - if you paste in C code, it should 
> either compile and work in the same way, or fail to compile. C has 
> implicit fallthrough (which is presumably used intentionally) so it 
> would be the exactly same syntax in both C and D but which do very 
> different things. The most likely way towards improving this is probably 
> a new pattern-matching syntax to replace the C-like switch/case.
 From my edition meeting notes:

- Single statement case, does not need a break.
	- ``case Foo statement;``

This should work, replacing the colon with the statement.

Not valid C, and shouldn't impact existing code.


More information about the Digitalmars-d mailing list