Re: [External] : Re: Record pattern and side effects

2022-04-21 Thread forax
> From: "Brian Goetz" > To: "Remi Forax" > Cc: "amber-spec-experts" > Sent: Thursday, April 21, 2022 6:20:24 PM > Subject: Re: [External] : Re: Record pattern and side effects >>> We’ve already asked one of the questions on side effects (though not sure we >>> agreed on the answer): what if the

Re: [External] : Re: Record pattern and side effects

2022-04-21 Thread Brian Goetz
We’ve already asked one of the questions on side effects (though not sure we agreed on the answer): what if the dtor throws? The working story is that the exception is wrapped in a MatchException. (I know you don’t like this, but let’s not rehash the same arguments.) Wrapping exceptions into

Re: [External] : Re: case null / null pattern (v2)

2022-04-21 Thread Brian Goetz
"case Foo fooButNull" is equivalent to "case null" but with a binding typed as Foo that's why i ask if it should even compile, the compiler should ask for an explicit "case null". It may be "equivalent" in our eyes, but the language doesn't currently incorporate nullity into the type system.

Re: Record pattern and side effects

2022-04-21 Thread forax
- Original Message - > From: "Brian Goetz" > To: "Remi Forax" > Cc: "amber-spec-experts" > Sent: Sunday, April 17, 2022 4:58:26 PM > Subject: Re: Record pattern and side effects > Yes, this is something we have to get “on the record”. > > Record patterns are a special case of deconstru

Re: case null / null pattern (v2)

2022-04-21 Thread forax
> From: "Brian Goetz" > To: "Remi Forax" , "amber-spec-experts" > > Sent: Tuesday, April 19, 2022 10:02:22 PM > Subject: Re: case null / null pattern (v2) > With the currently specified semantics, the second pattern is dead, because > switches will only match null at the top level with a case nu