Dias
01/08/2019, 1:14 PMpow
doesn't use **
operator? is it some java limitation?karelpeeters
01/08/2019, 1:43 PM**
operator in Kotlin.karelpeeters
01/08/2019, 1:44 PMmarstran
01/08/2019, 1:54 PMpow
is so rarely used outside math, that it isn't worth reserving an operator for. Also **
only saves 1 character and is less readable than pow
.karelpeeters
01/08/2019, 1:55 PM**
, like all operators, is more readable because it breaks up the text around it.marstran
01/08/2019, 1:56 PMmarcinmoskala
01/14/2019, 1:47 PM**
. We read pow
and we intuitively hear power
. I believe that most of us would need a second to remind ourselves what **
is. It might me intuitive, but we would first need to see it many times in many different contexts. Since it is not a popular idiom, I believe that it would take too much effort to force it.karelpeeters
01/14/2019, 4:53 PMDias
01/14/2019, 5:16 PM**
as power
. Google is doing that in the google calculator, and it's **
in python, which might be the go-to scientific/financial programming language nowadayskarelpeeters
01/14/2019, 5:19 PMCzar
01/14/2019, 6:43 PM**
Czar
01/14/2019, 7:33 PMcbruegg
01/14/2019, 7:50 PM**
is one of those operators I'd be happy to have, but I wouldn't benefit from it so much that I'd say I need it in the language. If we have lots of language features added that only serve a small share of users, then the language will quickly become bloated. One of my favorite Kotlin features is that it's easy to learn, unlike very feature-rich languages like Scala and C++.cbruegg
01/14/2019, 7:50 PMvoddan
01/15/2019, 11:37 AMpow
for basic integer types, but it died out because there were no use-cases outside of long arithmetic. Basically, JVM's Long
is too short to make a power operation useful. Languages such as Python and Haskell that have an operator for integer power, all have long arithmetic build-indiesieben07
01/15/2019, 12:27 PM**
existed as an operator (overloaded as operator fun pow
or something like that), it could be applied to BigInteger
/ BigDecimal
.serebit
01/15/2019, 4:38 PMfun <E> Iterable<E?>.noNullsOrEmpty(): List<E> = if (null in this) emptyList() else requireNoNulls()
Possible addition to the stdlib?Marc Knaup
01/28/2019, 12:39 PMString.replaceFirst
but no String.replaceLast
😕gregorbg
02/09/2019, 2:47 PMIterable<T>.associateBy
that returns Map<K, Collection<T>>
instead of Map<K, T>
such that items that map to the same key are accumulated instead of overwritten?ylemoigne
03/13/2019, 9:36 AMdiesieben07
03/13/2019, 11:04 AMsomeString.takeIf { it.isNotEmpty() }?.let {... }
asad.awadia
03/19/2019, 11:51 PMwhen
is implemented? I am curious to see how it’s implemented as a dslShawn
03/19/2019, 11:57 PMwhen
? It’s not a DSL, though? Just a control flow construct?Shawn
03/19/2019, 11:58 PMasad.awadia
03/20/2019, 12:03 AMasad.awadia
03/20/2019, 12:04 AMkarelpeeters
03/25/2019, 3:16 PMchan
03/31/2019, 8:31 AMKClass<*>
from annotation using Annotation Processor?chan
03/31/2019, 8:31 AM@Target(AnnotationTarget.CLASS)
@Retention(AnnotationRetention.RUNTIME)
annotation class Wire(val parent: KClass<*>)
chan
03/31/2019, 8:32 AMparent
to KClass<*>