FizzBuzz record edition
John Rose
john.r.rose at oracle.com
Wed Sep 2 01:46:54 UTC 2020
On Sep 1, 2020, at 12:59 PM, Remi Forax <forax at univ-mlv.fr> wrote:
>
> There are two tricks,
> - the Stream in Item.create() uses a <Item>map(s -> s) to see a Stream<Special> as a Stream<Iteam>
I wonder how the type-changing `id` works out in the JIT.
Does it optimize away, or does each value get moved from one
iteration-control-block to the next? That might be a job for
stream customization.
> - the result of Special.values() is stored in an immutable List otherwise each call to values() create a new array.
(If we had target typing we could have values() return the right
thing in all enums, for callers that knew to ask for the right thing.
Then deprecate the old values() call, and downgrade to synthetic
for link-compatibility. I can dream.)
> Everything works nicely in both IntelliJ 2020 and the upcoming Eclipse 2020.9 (4.17).
>
> enjoy,
Very enjoyable!
More information about the amber-dev
mailing list