Xavier F. Gouchet
12/06/2019, 12:17 PMval transforms = listOf<(String) -> String>(
{ it.toLowerCase() },
{ it.split(",").first() }
)
val data = listOf("foo, 42", "BAR, 33")
val result = data.mapAll(transforms) // result has ["foo", "bar"]
ribesg
12/06/2019, 1:56 PMallPositions
instead of allProducts
I think https://www.jetbrains.com/lp/mobilecrossplatform/arekolek
12/06/2019, 3:30 PMRoute
is not a Router
.handler()
doesn’t return a Router
probably even .route()
doesn’t return it alreadyLastExceed
12/06/2019, 9:19 PMbbaldino
12/06/2019, 9:44 PM.Companion
?
class Foo {
companion object {
val bar: Int = 42
}
}
// Works
val member2 = Foo.Companion::bar
// Doesn't work: unresolved reference
val member = Foo::bar
Gerard Klijs
12/07/2019, 2:11 PMprivate fun filterFunction(direction: DType?, iban: String?, minAmount: Int?,
maxAmount: Int?, descrIncluded: String?): Predicate<Transaction> {
val predicates: MutableList<Predicate<Transaction>> = ArrayList()
direction?.let { predicates.add(Predicate { t: Transaction -> t.direction == direction }) }
iban?.let { predicates.add(Predicate { t: Transaction -> t.iban.equals(iban) }) }
minAmount?.let { predicates.add(Predicate { t: Transaction -> t.amount >= minAmount }) }
maxAmount?.let { predicates.add(Predicate { t: Transaction -> t.amount <= maxAmount }) }
descrIncluded?.let { predicates.add(Predicate { t: Transaction -> t.descr.contains(descrIncluded, true) }) }
return Predicate { transaction: Transaction ->
predicates.all { predicate: Predicate<Transaction> -> predicate.test(transaction) }
}
}
Quy D X Nguyen
12/08/2019, 6:35 AMdmcg
12/08/2019, 10:11 AMAshutosh Panda
12/08/2019, 1:32 PMval fishnet="Net"to"Catch fish"
val(tool,use)=fishnet
println("$tool and $use")
Ashutosh Panda
12/08/2019, 1:47 PMMatthew
12/08/2019, 1:54 PMTim McCormack
12/08/2019, 2:28 PMasad.awadia
12/08/2019, 3:50 PMCzar
12/08/2019, 4:56 PMif(x != null) y = x
vs x?.let { y = x }
vs custom ifNotNull(x) { y = it }
vs y = x ?: y
? (I know, that the last one is not 100% equivalent to others as in case of property it invokes setter in any case)russhwolf
12/08/2019, 6:39 PMHIDDEN
instead of the default WARNING
?
(I’d love to ask this in a more specific channel, but not sure what a good one would be)Robert
12/08/2019, 10:06 PMAshutosh Panda
12/09/2019, 6:33 AMMarcin Wisniowski
12/09/2019, 7:11 AMBigInteger
s, both when I use +
and plus()
. I get a compiler error about overload ambiguity: <https://ss.nohus.eu/14331/03576c27>
How to fix this error?
This does not compile:
fun main() {
BigInteger.ONE + BigInteger.ONE
}
Robert
12/09/2019, 7:54 AMlibpaycoin_kref_com_ionspin_kotlin_bignum_integer_BigInteger
but it's methods aren't published. I tried typealiassing it, but it ignores this.fradiati
12/09/2019, 8:23 AMcoletz
12/09/2019, 8:50 AMdmcg
12/09/2019, 9:10 AMWesley Acheson
12/09/2019, 11:48 AMSummary
and I wanted to create a data class SummaryCalculation
that had all the fields of Summary but had new field also.
data class Summary(val aProperty:String, val items:List<BillableItem>)
//This I don't know
data class BillingSummary(initialSummary:Summary, totalItemsBilled:Long):Summary
It doesn't actually need to share an equals/hashcode, just expose the same api. I'm more or less trying to create an envelope that holds addition properties. that can be created from the initial object.Ashutosh Panda
12/09/2019, 12:11 PMsteenooo
12/09/2019, 1:27 PMLastExceed
12/09/2019, 2:32 PMhttps://i.imgur.com/6kNkSRr.png▾
poohbar
12/09/2019, 6:17 PMfun main() {
var value: Any? = "hello"
if (value != null) {
for (i in 1..10) {
value = nonNullFoo(value) // smart casting fails
}
}
}
fun nonNullFoo(obj: Any): Any {
return "World"
}
thymecypher
12/09/2019, 8:15 PMsteenooo
12/09/2019, 8:23 PMPacane
12/09/2019, 9:43 PM@NotNull
from org.jetbrains.annotations
but the converter doesn't care about those apparentlyPacane
12/09/2019, 9:43 PM@NotNull
from org.jetbrains.annotations
but the converter doesn't care about those apparentlygildor
12/09/2019, 11:35 PMArian Stolwijk
12/10/2019, 2:17 PM