https://kotlinlang.org logo
#language-evolution
Title
# language-evolution
s

Samuel Michael

11/26/2019, 12:16 AM
just throwing it out how about list comprehensions in kotlin, i made a gem for Ruby support thinking of a Kotlin library for the same
😱 1
h

Hullaballoonatic

12/01/2019, 1:41 AM
a few years back, JB released annual public poles about how receptive to a handful of potential features the community were. it included list comprehensions, but they proved to be middlingly popular, and afaik, JB has yet (if ever) to announce any intentions to include them in Kotlin otherwise.
s

Samuel Michael

12/01/2019, 1:42 AM
Yeah i thought a library would be a good start to test the waters
h

Hullaballoonatic

12/01/2019, 1:42 AM
would it be a compiler plugin?
s

Samuel Michael

12/01/2019, 1:42 AM
Ruby core team were not too thrilled either
Lol
h

Hullaballoonatic

12/01/2019, 1:42 AM
i'd imagine not 😮
s

Samuel Michael

12/01/2019, 1:43 AM
I am still learning and deciding whether to go native route or not
h

Hullaballoonatic

12/01/2019, 1:43 AM
list comprehensions are a bit like regex in the way of very: "easy to write; hard to read"
s

Samuel Michael

12/01/2019, 1:43 AM
And haven't been able to get my hello world library working
Yeah in ruby had to do a lot of interesting metaprogramming
To get it work I'm sure it's gonna be an adventure
Thanks
Yeah I am more interested in it as intellectual exercise and as an ambassador to language like Julia python to try kotlin
I wouldn't imagine using it much personal ly
Can be fun and good for multiple dimensions and prototyping
And good for beginners don't have to learn filter map or filtermap etc.
h

Hullaballoonatic

12/01/2019, 1:47 AM
i bet, but i'll give it a shot if you do. i like the idea for sure. would feel weird without list literals, though:
Copy code
listOf(x * 2 for x in 3..6)
just doesn't feel right by comparison to
Copy code
[x * 2 for x in 3..6]
you might want to play with a syntax for the default
it
iterator value, too
Copy code
listOf(it * 2 in 3..6)
or something
s

Samuel Michael

12/01/2019, 1:48 AM
Sure it could be open source
2 Views