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
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,
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
> 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
>>
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
> 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
&
> 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
> 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
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
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
I have updated
https://github.com/openjdk/amber-docs/blob/master/site/design-notes/type-patterns-in-switch.md
based on our discussions.
11 matches
Mail list logo