Re: Derived record creation and Data Oriented programming

2024-04-30 Thread Brian Goetz
So let's back up: what problem are we trying to solve here? The problem is that the syntax of "with" does not show that with depends on the deconstructor and the constructor of the record, so the behavior in case of separate compilation is not clear. I think the lack of clarity you

Re: Derived record creation and Data Oriented programming

2024-04-30 Thread forax
> From: "Brian Goetz" > To: "Remi Forax" , "amber-spec-experts" > > Sent: Tuesday, April 30, 2024 3:32:35 PM > Subject: Re: Derived record creation and Data Oriented programming > Interesting idea. Of the two sides, allowing explicit *constructor*

Re: Derived record creation and Data Oriented programming

2024-04-30 Thread Brian Goetz
Interesting idea.  Of the two sides, allowing explicit *constructor* calls is significantly more practical (`yield` has control flow consequences understood by the language, and obviously means "yield this value from the current expression", whereas doing a random pattern match with `this` as

Derived record creation and Data Oriented programming

2024-04-30 Thread Remi Forax
Hello, they have been several messages on amber-dev about the compatibility of the derived record creation. I think part of the issue reported is that with the proposed syntax, the call to the desconstructor and the canonical constructor is implicit. Let's take an example record Point(int