Seba
11/02/2017, 5:29 AMfred.deschenes
11/03/2017, 2:45 PMinterface Wtf<out A, out B, out C : Ftw<A, B>>
interface Ftw<out A, out B>
Nathan Desmet
11/03/2017, 2:53 PMSudhir Singh Khanger
11/03/2017, 3:41 PMprintln("item at $index is ${items[index]}")
What is the role of curly and square brackets in the above example?pastjean
11/03/2017, 3:44 PMcconstable
11/03/2017, 7:31 PM->
is used to specify return types in some cases but not others (e.g. :
is used in fun
). Is there a reason for this perceived inconsistency?CodeCrazy99
11/04/2017, 4:05 AMkristofdho
11/05/2017, 2:45 PM.pairwise()
, even better (also 1.2)Slackbot
11/06/2017, 3:58 PMAndreas Sinz
11/06/2017, 5:42 PMadrik77
11/06/2017, 6:57 PMval list1 = listOf("a", "b")
val list2 = listOf(1,2,3)
val cartesianProduct = list1.map { e1-> list2.map { e2-> e1 to e2 } }.flatten()
elaborate tissue
11/07/2017, 6:48 AMwineluis
11/08/2017, 10:41 AMvar clazz: Class<LAObject>? = null
Sandm
11/08/2017, 8:52 PMjamie-purchase
11/09/2017, 7:38 PMgetAttribute("something")
on an instance of com.sun.net.httpserver.HttpHandler
and I need to cast it to HashMap<String, Any>
but i'm unfamiliar with how to do thatdiegog
11/10/2017, 6:29 PMshodan45
11/10/2017, 8:39 PMkarelpeeters
11/10/2017, 9:18 PMkarelpeeters
11/11/2017, 9:12 AMscottc
11/13/2017, 2:09 AMRuckus
11/13/2017, 6:38 PMamatos
11/14/2017, 1:44 AMperson
class that has district
and district has a region
and region has a country
, how should person
have the reference to district? atm I have it like: var district:District?=null
elye
11/14/2017, 2:45 PMkevin_abrioux
11/14/2017, 5:52 PMMainActivity.this
what is the equivalent in Kotlin ?Trevor
11/14/2017, 8:13 PMshamrock_frost
11/15/2017, 7:01 AMnull
?
sealed class E {
data class A(val string : String) : E()
sealed class B : E() {
data class C(val int : Int) : B()
}
}
val x : MutableList<E> = mutableListOf(E.A("a"), E.B.C(1))
println(x as? MutableList<E.B>)
viliusk
11/15/2017, 1:30 PMholgerbrandl
11/16/2017, 1:28 PMlet
, but I actually would like to use a non-extension function on my argument:
(listOf(1,2)).let { (x, y) -> x+y} //works
somefun(listOf(1,2)) { (x, y) -> x+y} //want that
Rafael Schneider
11/17/2017, 1:05 AMelect
11/17/2017, 9:21 AMval console = object { fun draw() }
fun a() = console.draw() // error draw unresolved
elect
11/17/2017, 9:21 AMval console = object { fun draw() }
fun a() = console.draw() // error draw unresolved
Fré Dumazy
11/17/2017, 9:33 AMdraw()
in the first lineval console = object { fun draw() { } }
elect
11/17/2017, 9:35 AMorangy
11/17/2017, 11:50 AMconsole
is public, and we don’t have any (named) type to expose to other modules. Make it internal, and it should work.