Re: Updated patterns-in-switch doc

2020-09-22 Thread Brian Goetz
with the possible temporary exception of the three primitive types not currently permitted I believe, there are four of them: boolean, long, double, and float RIght. #2 Disallowing switch expressions inside guards And worse if we allow switch expressions inside guards, which we shouldn

Re: Updated patterns-in-switch doc

2020-09-19 Thread Tagir Valeev
Hello! Found a couple of minutes to read this. Below are some of my thoughts. #1 Number of not covered primitive types. > with the possible temporary exception of the three primitive types not > currently permitted I believe, there are four of them: boolean, long, double, and float Similarly,

Re: Updated patterns-in-switch doc

2020-09-13 Thread Brian Goetz
che 13 Septembre 2020 20:34:54 *Objet: *Re: Updated patterns-in-switch doc I don’t quite get the leap from “no constant patterns” to changing the syntax of deconstruction patterns, but in any case, we definitely don’t want this (and in fact, for the same r

Re: Updated patterns-in-switch doc

2020-09-13 Thread forax
> De: "Brian Goetz" > À: "Remi Forax" > Cc: "amber-spec-experts" > Envoyé: Dimanche 13 Septembre 2020 20:34:54 > Objet: Re: Updated patterns-in-switch doc >>> I don’t quite get the leap from “no constant patterns” to changing the >>

Re: Updated patterns-in-switch doc

2020-09-13 Thread Brian Goetz
I don’t quite get the leap from “no constant patterns” to changing the syntax of deconstruction patterns, but in any case, we definitely don’t want this (and in fact, for the same reasons cited in the section on constant patterns, and others.) if case Point(x, y) can not mean i

Re: Updated patterns-in-switch doc

2020-09-13 Thread forax
> De: "Brian Goetz" > À: "Remi Forax" > Cc: "amber-spec-experts" > Envoyé: Dimanche 13 Septembre 2020 15:53:18 > Objet: Re: Updated patterns-in-switch doc >> if we don't have constant pattern, it may also means that the type of a bound &

Re: Updated patterns-in-switch doc

2020-09-13 Thread Brian Goetz
> if we don't have constant pattern, it may also means that the type of a bound > variables can be implicit too. > i.e. case Point(x, y) having the same meaning as case Point(var x, var y) > like with lambdas. I don’t quite get the leap from “no constant patterns” to changing the syntax of deco

Re: Updated patterns-in-switch doc

2020-09-13 Thread Brian Goetz
> The sentence "Guarded patterns should be ignored entirely for purposes of > computing totality." implies that if two patterns that only differ from one > having a where and the other have not it's not valif to have them both in a > switch seems wrong for me. I suspect you have drawn the wrong

Re: Updated patterns-in-switch doc

2020-09-13 Thread Remi Forax
Foo(c): ... } is not valid anymore and should be written like this int c = ... switch(getFoo()) { case Foo(x) where x == c: ... } Rémi > De: "Brian Goetz" > À: "amber-spec-experts" > Envoyé: Mardi 8 Septembre 2020 18:43:01 > Objet: Updated patterns-in-swit

Re: Updated patterns-in-switch doc

2020-09-13 Thread Remi Forax
ern without a where clause, whatever the where clause is exactly. Rémi [1] https://github.com/openjdk/amber-docs/blob/master/site/design-notes/type-patterns-in-switch.md#refining-totality > De: "Brian Goetz" > À: "amber-spec-experts" > Envoyé: Mardi 8 Sep

Updated patterns-in-switch doc

2020-09-08 Thread Brian Goetz
I have updated https://github.com/openjdk/amber-docs/blob/master/site/design-notes/type-patterns-in-switch.md based on our discussions.