Re: Collections patterns

2022-05-20 Thread Brian Goetz
Or maybe you mean something else; if so, please share! The current proposal is more about matching and extracting the first arguments It is really about matching *the whole array*.   Pattern matching is about destructuring.  Arrays are part of the language.  They have structure.  We

Re: Collections patterns

2022-05-19 Thread forax
> From: "Brian Goetz" > To: "Remi Forax" > Cc: "amber-spec-experts" > Sent: Thursday, May 19, 2022 3:03:55 PM > Subject: Re: Collections patterns >> We may want to extract sub-parts of the array / collections by example, and i >> wou

Re: Collections patterns

2022-05-19 Thread Brian Goetz
We may want to extract sub-parts of the array / collections by example, and i would prefer to have the same semantics and a similar syntax. This is pretty vague, so I'll have to guess about what you might mean. Maybe you mean: "I want to match a list if it contains the a subsequence that ma