22
5
Given Google's recent announcement of official Kotlin support for Android development, I thought it might be timely to poll the community for some awesome golfing tips for this relatively new JVM language.
Kotlin includes a unique combination of features among it's JVM siblings which makes it potentially attractive for golfing:
- operator overloading
- local, infix, and static extension functions
- smart casts
- Groovy-style type-safe builders
- type aliases
- ranges
- an extensive functional collections package
- scripting support
So, how do I squeeze the last few bytes out of my Kotlin program? One tip per answer, please.
2Would there be interest in a golfing language that shortens some of Kotlin's longer names, but doesn't add a lot of extras (at least initially)? I am thinking of making common 1 letter, making string char counts shorter and adding single letter strings with only 1 quote mark? – jrtapsell – 2017-09-18T18:03:11.993
*Common functions – jrtapsell – 2017-09-18T18:15:36.400
Seems Kotlin golfing interest is not that high :( http://data.stackexchange.com/codegolf/query/793250/top-kotlin-golfers
– jrtapsell – 2018-01-28T22:58:01.730I plan to start submitting more Kotlin solutions! I'll have to check out that project of yours as well. – Tyler MacDonell – 2018-01-30T00:48:08.993