Re: [External] : Re: Guards

2021-03-09 Thread Guy Steele
> On Mar 9, 2021, at 1:47 PM, Brian Goetz wrote: > > >> Apart from what have said about letting grobble to fully access to the >> bindings > > Except that argument doesn't make sense. Accessing the bindings is not a > special behavior of grobble, but a natural consequence of flow scoping.

Re: [External] : Re: Two new draft pattern matching JEPs

2021-03-09 Thread Guy Steele
> On Mar 9, 2021, at 1:17 PM, fo...@univ-mlv.fr wrote: >> . . . >> Now this example is not exactly analogous to your original, because we have >> not >> provided explicit variables for this purpose. I believe that in an earlier >> version of the design one would write >> >> case Rectangle

Re: [External] : Re: Guards

2021-03-09 Thread John Rose
On Mar 9, 2021, at 2:57 PM, fo...@univ-mlv.fr wrote: > > > > De: "John Rose" > À: "Remi Forax" > Cc: "Brian Goetz" , "amber-spec-experts" > > Envoyé: Mardi 9 Mars 2021 23:05:28 > Objet: Re: [External] : Re: Guards > On Mar 9, 2021, at 1:45 PM, fo...@univ-mlv.fr >

Re: [External] : Re: Guards

2021-03-09 Thread forax
> De: "John Rose" > À: "Remi Forax" > Cc: "Brian Goetz" , "amber-spec-experts" > > Envoyé: Mardi 9 Mars 2021 23:05:28 > Objet: Re: [External] : Re: Guards > On Mar 9, 2021, at 1:45 PM, [ mailto:fo...@univ-mlv.fr | fo...@univ-mlv.fr ] > wrote: >> I see the pattern + parameters has a partial app

Re: [External] : Re: Guards

2021-03-09 Thread John Rose
On Mar 9, 2021, at 1:45 PM, fo...@univ-mlv.fr wrote: > > I see the pattern + parameters has a partial application, i.e. the parameters > other than the target are constants, > the keys of the map are constant, the java.util.regex.Pattern (or the string) > of a metch is a constant, etc > > So ye

Re: [External] : Re: Guards

2021-03-09 Thread Brian Goetz
There are two kinds of input args, one is the implicit target, the others are other arguments. It's not obvious to me that the parameters other than the target have to have access to the bindings. You keep saying "access to the bindings" as if that is a special thing.  Bindings are ordinar

Re: [External] : Re: Guards

2021-03-09 Thread forax
- Mail original - > De: "John Rose" > À: "Brian Goetz" > Cc: "Remi Forax" , "amber-spec-experts" > > Envoyé: Mardi 9 Mars 2021 19:56:42 > Objet: Re: [External] : Re: Guards > On Mar 9, 2021, at 10:47 AM, Brian Goetz wrote: >> >> >>> Apart from what have said about letting grobble to

Re: [External] : Re: Fwd: Two new draft pattern matching JEPs

2021-03-09 Thread John Rose
On Mar 9, 2021, at 12:23 PM, John Rose wrote: > > If switch refactors > to an if-chain, why then continue-switch would refactor to > continue-if, which turns out to branch to the next “else”, > if any. A bit more detail in case that was cryptic: switch (obj) { ... case P &&guard G: … … } <=ref

Re: [External] : Re: Fwd: Two new draft pattern matching JEPs

2021-03-09 Thread John Rose
On Mar 5, 2021, at 8:29 AM, Brian Goetz wrote: > >> >> The one objection I still have to grobble is one I've raised before: it >> makes it hard to imagine ever representing disjunctions as guards. I always >> bring up stuff like >> >> switch (people) { >> case Pair(Person(String name1, int

Re: [External] : Re: Guards

2021-03-09 Thread John Rose
On Mar 9, 2021, at 10:47 AM, Brian Goetz wrote: > > >> Apart from what have said about letting grobble to fully access to the >> bindings > > Except that argument doesn't make sense. Accessing the bindings is not a > special behavior of grobble, but a natural consequence of flow scoping. If

Re: [External] : Re: Guards

2021-03-09 Thread Brian Goetz
Apart from what have said about letting grobble to fully access to the bindings Except that argument doesn't make sense.  Accessing the bindings is not a special behavior of grobble, but a natural consequence of flow scoping.  If I have P && g (or P & grobble(g)), then the scoping rules wi

Re: Guards

2021-03-09 Thread Remi Forax
Apart from what have said about letting grobble to fully access to the bindings, i think that using parenthesis to call grobble here is already too much. case Foo(var x) when x > y is far more readable than case Foo(var x) when (x > y) because for a pattern the parenthesis describes a notion

Re: Two new draft pattern matching JEPs

2021-03-09 Thread forax
> De: "John Rose" > À: "Guy Steele" > Cc: "Remi Forax" , "Gavin Bierman" > , "amber-spec-experts" > > Envoyé: Samedi 6 Mars 2021 00:36:53 > Objet: Re: Two new draft pattern matching JEPs > On Mar 5, 2021, at 2:41 PM, Guy Steele < [ mailto:guy.ste...@oracle.com | > guy.ste...@oracle.com ] > wrot

Re: Two new draft pattern matching JEPs

2021-03-09 Thread forax
- Mail original - > De: "Guy Steele" > À: "Remi Forax" > Cc: "Gavin Bierman" , "amber-spec-experts" > > Envoyé: Vendredi 5 Mars 2021 23:41:30 > Objet: Re: Two new draft pattern matching JEPs >> On Mar 3, 2021, at 7:50 AM, Remi Forax wrote: >> >> - Mail original - >>> De: "Gav

Re: [External] : Re: Two new draft pattern matching JEPs

2021-03-09 Thread forax
- Mail original - > De: "Brian Goetz" > À: "Remi Forax" > Cc: "Gavin Bierman" , "amber-spec-experts" > > Envoyé: Jeudi 4 Mars 2021 17:28:05 > Objet: Re: [External] : Re: Two new draft pattern matching JEPs >> I want to separate the discussions about & between patterns and >> true()/fa