The case for no case
Kevin Bourrillion
kevinb at google.com
Fri Jun 5 02:20:22 UTC 2020
For what it's worth, I don't think that users want to discriminate finely
between different kinds of patterns. Some just happen to only match one
thing.
Even in the math world, when reading a proof by exhaustion, often the cases
are heterogeneous, and I don't think it really bothers anyone. You just
want to be able to see that everything is covered by the time you're done.
On Thu, Jun 4, 2020 at 5:14 PM John Rose <john.r.rose at oracle.com> wrote:
> On Jun 4, 2020, at 2:17 AM, Remi Forax <forax at univ-mlv.fr> wrote:
>
>
> One simple solution is to use different keyword for different kind of
> patterns,
> by example, "case" for a constant pattern, "instanceof" for the type
> pattern, "default" the default pattern, etc
>
>
> That strikes me as making the job of mechanical parsing easier, and the
> job of *reading* harder.
> You’d replace a uniform left column of case/case/case with a heterogeneous
> mix of keywords.
> And most of the time you wouldn’t care which is which.
>
>
--
Kevin Bourrillion | Java Librarian | Google, Inc. | kevinb at google.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/amber-spec-experts/attachments/20200604/9524a7e8/attachment.htm>
More information about the amber-spec-experts
mailing list