Call for bikeshed -- break replacement in expression switch

Guy Steele guy.steele at oracle.com
Mon May 13 19:13:09 UTC 2019



> On May 13, 2019, at 10:20 AM, Brian Goetz <brian.goetz at oracle.com> wrote:
> 
>> I kind a like the simplicity of the keyword yield but i don't think it's a good idea to use it.
>> - as you said, yield in other language has a different meaning, so even if Java doesn't use yield in a generator it will be confusing for people discovering Java after Python by example. 
> 
> Everything is a tradeoff.  There are two dimensions here to consider: 
>  - What percentage of the user base has a polluted perspective?  
>  - How badly are they polluted, and how hard is it to get over?  
> 
> My suspicion is that the first number is actually pretty small, and for most of them, they can get over it.  And also: the percentage of people _on this list_ that are polluted is probably dramatically higher than for the ambient Java developer population (those that take an active interest in language evolution are probably familiar with more languages.). 

It’s true; I have been polluted for “yield” for a long, long time.  I think I would still prefer “produce”.

> So, do we want to pick something that is clear for most people, but polluted for a minority, or something that is crappy for everyone, but unpolluted?  It depends, of course, but my main point is that I think the “pollution” angle is overblown, and we shouldn’t over-rotate to it.  
> 
>> - currently for loom the way to yield from a continuation is to use Continuation.yield(scope) with scope being a continuation scope, so it might be confusing if there is a static import because "yield scope;" and "yield(scope);" have two different meaning.
> 
> Yes,  but of course these can be changed, and if we went with yield in the language, we would of course update Loom APIs accordingly.  
> 
> 
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/amber-spec-experts/attachments/20190513/27265a89/attachment.html>


More information about the amber-spec-experts mailing list