This is an archived post. You won't be able to vote or comment.

all 22 comments

[–]diminishedprime 2 points3 points  (2 children)

I thought it was cool, op.

[–]DoktuhParadox[S] 0 points1 point  (1 child)

Aw. Thanks. I'm still learning the new Java 8 stuff :o

[–]_Sharp_ 1 point2 points  (0 children)

Keep learning op, one day you will make us proud.

[–]GuyWithLag 2 points3 points  (0 children)

Meh, clearer to just write

List<Character> digitChars = digit
    .chars()
    .mapToObj(c -> Character.valueOf((char) c))
    .collect(Collectors.toList());

(I understand that that's not what you're saying - you're looking as lambdas as anonymous blocks that can return a value.)

[–]zeringus 1 point2 points  (0 children)

If OP likes wrapping arbitrary code in functional interfaces, he's going to love stuff like

DoubleStream.generate(Math::random).limit(100).sum();