Re: [External] : Re: Declared patterns -- translation and reflection

2022-03-29 Thread Brian Goetz
The mangling has to be stable across compilations with respect to any source- and binary-compatible changes to the pattern declaration.  One mangling that works quite well is to use the "symbolic-freedom encoding" of the erasure of the pattern descriptor.  Because the erasur

Re: [External] : Re: Declared patterns -- translation and reflection

2022-03-29 Thread Brian Goetz
1/ conceptually there is a mismatch, the syntax introduce names for the bindings, but they have no names at that point, bindings only have names AFTER the pattern matching succeed. I think you have missed the point here.  The names serve the implementation of the pattern, not the interface

Re: [External] : Re: Declared patterns -- translation and reflection

2022-03-29 Thread Brian Goetz
I am disappointed that you took this as an invitation to digress into syntax here, when it should have been blindingly obvious that this was not the time for a syntax discussion.  (And when there is a syntax discussion, which this isn't, we need to cover all the different forms of declared patt

Re: Declared patterns -- translation and reflection

2022-03-29 Thread Remi Forax
> From: "Brian Goetz" > To: "amber-spec-experts" > Sent: Tuesday, March 29, 2022 11:01:18 PM > Subject: Declared patterns -- translation and reflection > Time to take a peek ahead at _declared patterns_. Declared patterns come in > three varieties -- deconstruction patterns, static patterns, and

Re: Declared patterns -- translation and reflection

2022-03-29 Thread Remi Forax
> From: "Brian Goetz" > To: "amber-spec-experts" > Sent: Tuesday, March 29, 2022 11:01:18 PM > Subject: Declared patterns -- translation and reflection > Time to take a peek ahead at _declared patterns_. Declared patterns come in > three varieties -- deconstruction patterns, static patterns, and

Declared patterns -- translation and reflection

2022-03-29 Thread Brian Goetz
Time to take a peek ahead at _declared patterns_.  Declared patterns come in three varieties -- deconstruction patterns, static patterns, and instance patterns (corresponding to constructors, static methods, and instance methods.)  I'm going to start with deconstruction patterns, but the basic