Re:Kotlin: A New Hope in a Java 6 Wasteland
by mike_hearn on Tuesday September 29, 2015 @01:20PM
(#10297810)
"foo".asSequence() works fine. I understood your long hypothetical conversation: you want to avoid an intermediary method that returns a collection of chars. I just fail to see why anyone would care about this.
[ Parent
| on HN ]
Re:Kotlin: A New Hope in a Java 6 Wasteland
by justthistime_ on Tuesday September 29, 2015 @01:41PM
(#10297980)
No, I don't think you understood it. There is a large qualitative gap between what you propose, and what Scala does:
In Scala, it is an _one_ time effort to make String act "like" collections, while the only solution Kotlin provides means doing the work manually _n_ times: At every call site of the string in question.
Kotlin developers also didn't feel like your point was too convincing: https://github.com/JetBrains/kotlin/blob/master/libraries/st...
Re:Kotlin: A New Hope in a Java 6 Wasteland
by mike_hearn on Wednesday September 30, 2015 @07:48AM
(#10303191)
That file contains the definitions of asList and asSequence, for example. If you're saying "but look at the other methods", that's not very convincing to me either because honestly I don't think having a fold method directly on String is very useful - if they scrapped a lot of those extension methods I'd be totally OK with that.
At any rate, you never addressed the core point I raised. Saying "implicit resolution isn't related to implicit classes" doesn't seem very convincing. If solving that issue was so easy then why is the use of implicits so frequently identified as a performance issue for tools?