groovy-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Guillaume Laforge <glafo...@gmail.com>
Subject Re: [VOTE]About the Union Type for method/constructor declaration
Date Mon, 24 Jul 2017 08:14:00 GMT
On Mon, Jul 24, 2017 at 10:04 AM, Jochen Theodorou <blackdrag@gmx.org>
wrote:
>
> On 23.07.2017 17:21, Guillaume Laforge wrote:
> [...]
>
>> Speaking of pattern matching, there's Brian Goetz' proposal here, for
>> pattern matching for Java:
>> http://cr.openjdk.java.net/~briangoetz/amber/pattern-match.html
>> We should also avoid offering a different syntax as to what might come
>> up in the JDK later on, to avoid having two distinct syntaxes for the
>> same thing.
>> (although this proposal doesn't cover union types per se, it's something
>> to factor in, in our decisions)
>>
>
> I see one possible influence depending if we can declare a sum type or
> not. Because if you can really declare one (and I really think you will
> want to do that), you will potentially use it in a switch-case. That will
> open a lot of problems
>

Indeed, we'd certainly want to have it in switch / case, good point.

-- 
Guillaume Laforge
Apache Groovy committer & PMC Vice-President
Developer Advocate @ Google Cloud Platform

Blog: http://glaforge.appspot.com/
Social: @glaforge <http://twitter.com/glaforge> / Google+
<https://plus.google.com/u/0/114130972232398734985/posts>

Mime
View raw message