[External] : Re: Rehabilitating switch -- a scorecard

Brian Goetz brian.goetz at oracle.com
Tue May 18 17:07:41 UTC 2021


> to fill the gap, we need
>   - _ as pattern equivalent to var _ + _ not be entered in the scope

On the list, will come at some point.

>   - constant as pattern, Foo(constant) being equivalent to Foo(var x) && x == constant

Maybe, not sure it carries its weight.

>   - inference of Type in a destructuring pattern, case Foo(var x, var y) becomes case (var x, var y) if the type of the switched value is Foo
>     This kind of inference is also useful in pattern assignment
>       with Foo(var x, var y) = foo; being written (var x, var y) = foo;

Coming.

>   
>   - tuple as first class citizen

Sorry, no.  I know you really want this, but this is similar to the 
function-type-vs-functional-interface issue.  We made our choice when we 
did records -- records are our tuples.




More information about the amber-spec-experts mailing list