jw
05/12/2017, 3:06 AMfind
and ^
at the beginning of the patternilya.gorbunov
05/12/2017, 4:34 PMRegex
functions, like matchesAt(string, index): Boolean
and matchAt(string, position): MatchResult?
, although I'm not sure we could implement them effectively on all platforms.jw
05/12/2017, 5:49 PMjw
05/12/2017, 5:49 PMjw
05/12/2017, 5:49 PMilya.gorbunov
05/12/2017, 5:53 PMjw
05/12/2017, 5:54 PMudalov
isName
specifically which determines whether or not a string is a keyword in the language
1 reply
There’s a private API in kotlin-reflect
for this, used to render declarations properly for toString, see kotlin.reflect.jvm.internal.impl.renderer.KeywordStringsGenerated
msink
05/16/2017, 5:05 PMvoddan
05/22/2017, 9:19 AMFile.forEachLine {}
is NOT inline
?
Original SO question: http://stackoverflow.com/q/44108489/3144601Bart
05/22/2017, 9:21 AMilya.gorbunov
05/22/2017, 5:51 PMuseLines { lines -> lines.forEach { } }
voddan
05/22/2017, 6:19 PMvoddan
05/22/2017, 6:19 PMvoddan
05/22/2017, 6:20 PMburak.eregar
05/23/2017, 4:34 PMdimsuz
05/24/2017, 6:28 PMMap.minus()
extension always creates a new Map, even if key ends up to not exist in a current map. Using logic like return if (containsKey(key)) minus(key) else this
would save an extra allocation (for Android users). Would it be sensible to create a YouTrack issue for this? Or there are reasons not to go this way?kirillrakhman
05/24/2017, 6:29 PMdimsuz
05/24/2017, 6:29 PMkirillrakhman
05/24/2017, 6:30 PMdimsuz
05/24/2017, 6:31 PMcontainsKey()
is somehow costly or not wanted. it's a good optimization for those of us who like an immutable world 🙂jw
05/24/2017, 6:31 PMjw
05/24/2017, 6:31 PMjw
05/24/2017, 6:32 PMminus
jw
05/24/2017, 6:32 PMdimsuz
05/24/2017, 6:33 PMcontainsKey()
, usually prefer []
(or get()
), but would containsKey()
be more costly than an allocation?dimsuz
05/24/2017, 6:33 PMjw
05/24/2017, 6:33 PMjw
05/24/2017, 6:33 PMjw
05/24/2017, 6:33 PM