Suggestion: A wiki page for all answered "Why don't you ...?"
Archie Cobbs
archie.cobbs at gmail.com
Thu Dec 12 18:34:22 UTC 2024
On Thu, Dec 12, 2024 at 10:07 AM Brian Goetz <brian.goetz at oracle.com> wrote:
> There is the amber-docs repo which gets published to `
> openjdk.org/projects/amber` <http://openjdk.org/projects/amber>, which is
> probably a better place to put it, and people can contribute via PRs.
>
I think putting something online under amber-docs is a great idea -
especially the part where people can contribute using PR's, which fosters
decentralized collaboration on the maintenance of the list.
While it would be ideal to have a complete directory of ideas with
accompanying summaries of all that has been discussed, we should probably
start with something simpler and more maintainable.
Here's a proposal: Have a list of "previously discussed ideas". Each idea
has a one line description, a one paragraph summary, an optional example,
and a bullet-point list of one or more links to the thread(s) in the
archive that contain all the gory details of the discussion.
Here's a simple example...
*Idea:* Using switch statements for if/else control flow
*Description:* Support "switches on nothing" where the cases simply provide
the conditions on which to execute various code branches.
*Example:*
public double toInches(String value) {
switch {
case when value.endsWith("mm") -> return 0.0393701 *
Integer.parseInt(value.substring(0, value.length() - 2));
case when value.endsWith("ft") -> return 12 *
Integer.parseInt(value.substring(0, value.length() - 2));
case when value.endsWith("light-years") -> return 3.725e+17 *
Integer.parseInt(value.substring(0, value.length() - 2));
default -> throw new IllegalArgumentException("can't parse value");
}
}
*Discussion:*
- https://mail.openjdk.org/pipermail/amber-dev/2024-October/008939.html
Just now seeing Eirik's reference to Project Jigsaw's Issue Summary
document. I like this even better but someone would have to step up and
take ownership.
-Archie
--
Archie L. Cobbs
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/amber-dev/attachments/20241212/ef092cba/attachment.htm>
More information about the amber-dev
mailing list