Re:Kotlin: A Language with a Bright Future
by dmitriid on Monday November 20, 2017 @02:40PM
(#15742557)
I wish they'd leave the math notation as is. Haskell's and Erlang's notations which keep it (maybe with slight modifications) are so much nicer and readable.
Erlang [1]:
[X || X <- [1,2,a,3,4,b,5,6], X > 3].
Pythagorean triplets
[ {A,B,C} ||
A <- lists:seq(1,N),
B <- lists:seq(1,N),
C <- lists:seq(1,N),
A+B+C =< N,
A*A+B*B == C*C
].
Erlang [1]:
[1] http://erlang.org/doc/programming_examples/list_comprehensio...