News for hackers. Stuff that matters.
Re:JEP draft: Exception handling in switch by extraduder_ire on Friday April 19, 2024 @02:58PM (#40090716)
From my reading, they wanted it to match the sort of grammar that type constructor/type cases have. (looks like a declaration) I have not read the mailing list discussion to see what other alternatives were suggested.

My kneejerk reaction would be to prefer something like "threw" in place of "throws", but I'm sure there's a reason not to.

Re:JEP draft: Exception handling in switch by lolinder on Friday April 19, 2024 @03:42PM (#40091185)
> I'm sure there's a reason not to

Language designers try to avoid adding new keywords if at all possible, especially ones that are short and common. Doing so requires either breaking thousands of projects and APIs or adding a bunch of complexity to the grammar and syntax highlighting tooling (so threw is only a keyword in some contexts but not others).