Sasso
03/04/2020, 9:40 AMphldavies
03/04/2020, 11:06 AMPawel
03/04/2020, 11:22 AMJulio Zynger
03/04/2020, 12:17 PMmyCollection.indexOf(myCollection.find { predicate(it) })
(plus avoid the handling of -1
as a result type.Ola Gawell
03/04/2020, 12:35 PMforEach
but that doesn't end the squence/iterator. I can do it with map
and then return the item in the end, but I guess there is an operator for this already.
list.map { it ->
doSomethingWithIt(it)
it
}
Egor Okhterov
03/04/2020, 1:57 PM1.3.70
?
Build time has increased dramatically, appeared a lot of warnings (about absent directories) and some tasks don't produce artifacts as they did before.
I will be waiting for 1.3.71
😃Nikola Milovic
03/04/2020, 5:22 PMLuke
03/04/2020, 6:06 PMgroupBy
but returns a List<List<T>>
instead of a map? I don’t need the keys.Sourabh Rawat
03/05/2020, 1:57 AMMarc Knaup
03/05/2020, 2:48 AM!== null
and === null
instead of != null
and == null
due to not using equals
?jimn
03/05/2020, 9:13 AMprivate fun scheduleTask(address: MemberAddress, command: Runnable, delay: Int, units: TimeUnit) {
waiting.computeIfAbsent(address) { a: MemberAddress? ->
lateinit var future: ScheduledFuture<*>
executor.schedule(loggingExceptions(Runnable {
waiting.remove(address, future )
command.run()
}), delay.toLong(), TimeUnit.MILLISECONDS) .also { future=it }
}
}
Slackbot
03/05/2020, 9:14 AMRobert Jaros
03/05/2020, 3:13 PMdam5s
03/05/2020, 4:56 PMSmart cast to 'String' is impossible because 'myObject.myProperty' is a public API property declared in different module
Sylvain Patenaude
03/05/2020, 7:59 PMdarkmoon_uk
03/06/2020, 5:34 AMgian
03/06/2020, 8:43 AMfun main() {
val foo: Foo? = Foo("")
if (foo?.bar != null && foo.bar.isNotEmpty()) {
println(foo.bar.length) // smart cast
}
if (!foo?.bar.isNullOrEmpty()) {
println(foo.bar.length) // no smart cast
}
}
class Foo(val bar: String?)
Cyberpunk Keanu
03/06/2020, 10:42 AMtim
03/06/2020, 11:13 AMdata class Outer(val inner: Inner)
data class Inner(val value: Int)
val state = Outer(Inner(1))
val keyOuter = "inner"
val keyInner = "value"
state[keyOuter][keyInner] // returns 1
Ultimately I'd like to do is specify a 'path' so I can get at the nested value: dataClass["inner.someValue.value"]
(similar to how lodash does it for javascript objects).XQDD
03/06/2020, 1:16 PMkevinherron
03/06/2020, 7:01 PMBob Glamm
03/06/2020, 7:23 PMLastExceed
03/06/2020, 8:54 PMinterface MyInterface<T> {} //interface declaration
class MyClass<T> : MyInterface<String> {} //class declaration and interface implementation
val x = MyClass<String>() //class construction
fun <T> foo() {} //function declaration
val y = foo<String>() //function call
type parameters are always specified after the name, except in the case of function declarations. why this inconsistency? why isnt the syntax for it like this
fun foo<T>() {}
to be consistent ?Jakub Pi
03/06/2020, 10:18 PMfun byTagCategoryAndTag(tagCategory : TagCategory, vararg tags : TagInfo) : (TagCategory, TagInfo) -> Boolean = { cat, tag -> tagCategory == cat && tag in tags}
fun byMatchingTags(vararg tags : TagInfo) : (TagInfo) -> Boolean = partial(::byTagCategoryAndTag, TagCategory.ROOT)
qwert_ukg
03/07/2020, 6:29 AMkotlinx-html
to my project, getting an error Could not transfer artifact org.jetbrains.kotlinx:kotlinx-html:pom:0.7.1
kotlin 1.3.61
<dependency>
<groupId>org.jetbrains.kotlinx</groupId>
<artifactId>kotlinx-html</artifactId>
<version>0.7.1</version>
</dependency>
<repository>
<id>jcenter</id>
<name>jcenter</name>
<url><https://jcenter.bintray.com></url>
</repository>
What the reason could be?steenooo
03/07/2020, 1:45 PMe.entity
is "Entity". Many classes derive of this interface. But, I only want to do something with them if they're either Horse or Panda. And if they are, I want to do something general, for both panda and horse. And I want to also do something specific for them pandas and for horses
I know It is possible to do the current construction, or copy the code which should be executed for both. But I was wondering if there was a more concise way to do this.Joshlemer
03/07/2020, 4:42 PMRobert Jaros
03/07/2020, 10:43 PMpublishToMavenLocal
task is executed (it doesn't even assemble jars). I have added id("maven-publish")
plugin. The subproject in kotlin/js and the parent project is mpp.LastExceed
03/07/2020, 10:49 PMreified
have to be declared explicitly ? are there cases where you'd want the type parameter of an inline
function to NOT be reified ?Hullaballoonatic
03/08/2020, 5:11 PMmyList.toArray { it + 1 }
v
myList.map { it + 1 }.toArray()
to be precise, I'm wondering if Kotlin performs equally well, not simply that they have the same runtime complexity.