matt tighe
11/18/2019, 9:28 PMfilter {}.isEmpty()
be simplified? IDE is complaining that it can beNew111
11/18/2019, 11:01 PMThe C Programming Language
by Kernighan and Ritchie ? I mean not by lets start with variables etc but more like start with short programs while explaining all Kotlin syntax and then get more complicated functionality.Joey
11/19/2019, 7:25 AMSebi Sheldin Sebastian
11/20/2019, 6:46 AMRajiv
11/20/2019, 12:48 PMdf
11/20/2019, 3:14 PMget() {
if (_fulfillmentDetails == null) {
_fulfillmentDetails = FulfillmentDetails(this)
}
return _fulfillmentDetails!!
}
New111
11/20/2019, 5:32 PM!!
at the end ^^^ ?Ellen Spertus
11/21/2019, 1:47 AMfun Payload.toString(errorReporter: (String) -> Unit = { (_: String) -> Unit } )String? { ... }
Shawn Witte
11/21/2019, 3:31 AMabstract class A<X,Y,Z: A<X,Y,Z>>
which I am subclassing to class CompositeA<X,Y>: A<X,Y,CompositeA<X,Y>>
Now, A
has an abstract fun copy(): Z
and CompositeA
has a property components: List<A<X,Y,*>>
.
When I try to iterate through objects from components
, call copy()
on them,and put the put the results into a List<A<X,Y,*>>
the IDE gives me an error saying I'm trying to put something of type of type A<*,*,*>
into the List, which is incompatible. I can cast the result of copy()
by using as A<X,Y,*>
, but then I get an unchecked cast warning.
Any ideas what I'm not seeing here?Hullaballoonatic
11/21/2019, 6:31 PMsealed class Foo {
object Bar : Foo()
}
vs
sealed class Foo
object Bar : Foo()
standard class syntax would imply Bar
has its own Bar
object in the first oneHullaballoonatic
11/21/2019, 7:15 PMMani
11/21/2019, 7:22 PMIvy Gourd- 2 kg fav_variety : Fresh fav_quantity : 2 kg pcp_packaging_type : Loose packing fav_unit_of_measurement : Per kg fav_average_weight : 2 kg is_assortment : false num_items_assortment : 0 length_mm : 250 breadth_mm : 180 height_mm : 120 dead_weight```
Hullaballoonatic
11/21/2019, 7:28 PMF
and Foo<F>
here:
interface Foo<F: Foo<F>> {
val a: F
val b: Foo<F>
}
so what is assignable to a and b?Mark
11/22/2019, 5:02 AMobject
modifier
3. keep the Utils class and put the methods in a companion object
Mark
11/22/2019, 7:04 AMtook: $`it`ms
the compiler gives a warning saying the backticks are redundant. But then removing the backticks gives a compiler error!Hullaballoonatic
11/22/2019, 10:57 PMfoo
into bar
?
val foo = listOf(
'a' to 1,
'a' to 2,
'b' to 3
)
val bar = mapOf(
'a' to listOf(1, 2),
'b' to listOf(3)
)
UPDATE: I found the answer
fun <T, K, V> Iterable<T>.groupBy(
keySelector: (T) -> K,
valueTransform: (T) -> V
): Map<K, List<V>>
victor-mntl
11/23/2019, 1:13 PMenum class Foo1 (val bar:Int) {FIRST(11), SECOND(222)}
so we would be able to call their bar
value:
println(Foo1.FIRST.bar)
11
Now, if we look at this one (see that it is missing val
between the parenthesis):
enum class Foo2 (bar:Int) {FIRST(110), SECOND(2220)}
in this case, bar
doesn't exist on any call to a value of the enum class:
println(Foo2.FIRST.bar)
error: unresolved reference: bar
So, my question is, does it have any utility to create an enum class with arguments without a val or var expression (= with arguments that are not parameters)? Are the values 110
and 2220
in this example lost?Florian
11/23/2019, 6:53 PMlateinit
, all properties of a class need to be initialized when the object is constructed, right?Joey
11/25/2019, 4:57 AMpush
in firebase? If yes what is the best way to do this in kotlin?Dennis Tel
11/25/2019, 9:28 AMrikusen0335
11/25/2019, 11:00 AMjava.lang.NoClassDefFoundError: org/jetbrains/exposed/sql/Database
.
Does anyone know how this happen and a solution for this? Thanks.
This project using Gradle, JVM.Luismi
11/25/2019, 11:42 AModay
11/25/2019, 11:55 AMNew111
11/25/2019, 12:02 PMKstabks
11/25/2019, 12:57 PMJukka Siivonen
11/25/2019, 3:47 PMfun <T : Any?> execute(queryId: (() -> UUID)? = null, operation: Operation<T>): T? {
but I can't invoke this by
execute(Operation(...))
only
execute(null, Operation(...))
works, any pointers?victor-mntl
11/25/2019, 4:10 PMMap.Entry<K,V>
(that appears when you select only one entry of a Map) works exactly the same as Pair<K,V>
? Are there any differences that should be taken care of?victor-mntl
11/25/2019, 4:44 PMval mutableMap<String, mutableSet<String>> myMap = mutableMapOf ("first key" to mutableSetOf("value1 of first entry","value2 of first entry"))
if (myMap["another key"]==null)
myMap["another key"] = mutableSetOf("value1 of second entry")
else
//at this point, we know that myMap["another key"] is NOT NULL
myMap["another key"].add("value1 of second entry")
It marks the last line (marked in bold) and says that I should use ?. instead of . because it says the receiver of the call is of type MutableSet<String>?
(nullable) but it is verified that it is not. Am I missing something?Matthias R
11/25/2019, 5:07 PMrikusen0335
11/26/2019, 11:08 AMrikusen0335
11/26/2019, 11:08 AMIvan Kubyshkin [JetBrains]
11/26/2019, 11:13 AMrikusen0335
11/26/2019, 11:27 AM