Switch expressions -- some revisions
kevinb at google.com
Thu Dec 14 22:34:10 UTC 2017
On Thu, Dec 14, 2017 at 2:17 PM, John Rose <john.r.rose at oracle.com> wrote:
> On Dec 14, 2017, at 2:12 PM, Brian Goetz <brian.goetz at oracle.com> wrote:
> With statement switches, it's even more of a stretch. Sure, you can
> squint and say "the case arm is like a lambda whose args are the binding
> variables and whose body is the RHS", but it does require squinting.
> +1 In short:
> Using break to mean "exit the current switch with a value" is
> the only conservative keyword-based solution, because break
> already means "exit the switch".
> C'mon, Kevin, you see that, right?
> The naked expression move has already been weighed and
> discarded, during the Lambda exercise. I don't see any new
> information that would cause us to reopen that as an option.
> (Although it would have been my preference at the time.)
Fair enough... knowing that option is out, and starting to see that
`return` is more problematic than I first realized, is getting me closer to
being able to tolerate "break this value". The "return/return
e/break/break e" analogy Brian just gave helps as well.
Kevin Bourrillion | Java Librarian | Google, Inc. | kevinb at google.com
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the amber-spec-experts