Field initialization before 'super'

2023-12-12 Thread Dan Smith
In Valhalla we've been building on the language changes in JEP 447 (Statements Before Super) to move towards a more safe and reliable programming pattern for initializing final fields. Some of these ideas could make their way into the next iteration of Statements Before Super, to be further augm

Re: Effect cases in switch

2023-12-12 Thread Brian Goetz
Exception cases can be used in all forms of `switch`: expression and statement switches, switches that use traditional (colon) or single-consequence (arrow) case labels.  Exception cases can have guards like any other pattern case. I think I would prefer "case throws

Re: Effect cases in switch

2023-12-12 Thread Archie Cobbs
On Tue, Dec 12, 2023 at 4:41 PM Remi Forax wrote: > Your proposal is fighting against the physics of the VM, when you enter in > an exception handler (a catch block), the whole stack disapear so you need > some compiler magic to store everything which is on stack into locals > before calling a sw

Re: Effect cases in switch

2023-12-12 Thread Remi Forax
> From: "Brian Goetz" > To: "amber-spec-experts" > Sent: Tuesday, December 12, 2023 10:23:09 PM > Subject: Effect cases in switch > Based on some inspiration from OCaml, and given that the significant upgrades > to > switch so far position it to do a lot more than it could before, we've been >

Effect cases in switch

2023-12-12 Thread Brian Goetz
Based on some inspiration from OCaml, and given that the significant upgrades to switch so far position it to do a lot more than it could before, we've been exploring a further refinement of switch to incorporate failure handling as well. (I realize that this may elicit strong reactions from s