Re: [External] : Re: Record pattern, the runtime side

2022-03-17 Thread Brian Goetz
On 3/16/2022 4:34 PM, fo...@univ-mlv.fr wrote: - Original Message - From: "Brian Goetz" To: "Remi Forax" , "amber-spec-experts" Sent: Wednesday, March 16, 2022 5:41:49 PM Subject: Re: Record pattern, the runtime side It works in 3 steps: Step 1,

Re: Record pattern, the runtime side

2022-03-16 Thread forax
- Original Message - > From: "Brian Goetz" > To: "Remi Forax" , "amber-spec-experts" > > Sent: Wednesday, March 16, 2022 5:41:49 PM > Subject: Re: Record pattern, the runtime side >> It works in 3 steps: >> Step 1, at compil

Re: Record pattern, the runtime side

2022-03-16 Thread Brian Goetz
It works in 3 steps: Step 1, at compile time, the compiler takes all the patterns and creates a tree of pattern from the list of patterns, pattern that starts with the same prefix are merged together. We can "normalize" a complex pattern into a sequence of simpler conditionals.  For exampl

Record pattern, the runtime side

2022-03-13 Thread Remi Forax
Following the discussions we had, i've implemented a prototype of what can be the runtime part of the pattern matching that supports record pattern. It works in 3 steps: Step 1, at compile time, the compiler takes all the patterns and creates a tree of pattern from the list of patterns, pattern