just throwing it out how about list comprehensions...
# language-evolution
s
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
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
Yeah i thought a library would be a good start to test the waters
h
would it be a compiler plugin?
s
Ruby core team were not too thrilled either
Lol
h
i'd imagine not 😮
s
I am still learning and deciding whether to go native route or not
h
list comprehensions are a bit like regex in the way of very: "easy to write; hard to read"
s
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
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
Sure it could be open source