class AnyType { … } var obj = Obj() obj.method(arg: v) var, val fun f(arg: Any): Any class AnyType { … } var obj = Obj() obj.method(v) see also: http://nilhcem.com/swift-is-like-kotlin/
func f() } extension P { func f() { /* do something */ } } interface I { fun f() } fun I.f() { /* do something */ } class A: I {} // error P f() extension extension P f()
body: (Element) throws -> Void ) rethrows { for element in self { try body(element) } } public inline fun <T> Iterable<T>.forEach(action: (T) -> Unit): Unit { for (element in this) action(element) }
body: (Element) throws -> Void ) rethrows { for element in self { try body(element) } } public inline fun <T> Iterable<T>.forEach(action: (T) -> Unit): Unit { for (element in this) action(element) }
body: (Element) throws -> Void ) rethrows { for element in self { try body(element) } } public inline fun <T> Iterable<T>.forEach(action: (T) -> Unit): Unit { for (element in this) action(element) } inline: ݺͼग़͠ݩʹதΛల։ inline: ݺͼग़͠ݩʹதΛల։
body: (Element) throws -> Void ) rethrows { for element in self { try body(element) } } public inline fun <T> Iterable<T>.forEach(action: (T) -> Unit): Unit { for (element in this) action(element) } inline: ϩδοΫʹӨڹ͠ͳ͍ inline: ϩδοΫʹӨڹ͢Δ
body: (Element) throws -> Void ) rethrows { for element in self { try body(element) } } public inline fun <T> Iterable<T>.forEach(action: (T) -> Unit): Unit { for (element in this) action(element) } { if (it == 2) { return } println(it) } inline: ݺͼग़͠ݩʹதΛల։
4) https://developer.apple.com/library/content/documentation/Swift/Conceptual/Swift_Programming_Language/AboutTheLanguageReference.html Programming Kotlin by Stefan Bocutiu, Stephen Samuel Swift is like Kotlin: Hacker News (discussion) https://news.ycombinator.com/item?id=14364612 Swift is like Kotlin http://nilhcem.com/swift-is-like-kotlin/ SwiftKotlin https://github.com/angelolloqui/SwiftKotlin Swift vs Kotlin for real iOS/Android apps (ͱͯྑ͍هࣄͰͨ͠ʂ) http://angelolloqui.com/blog/38-Swift-vs-Kotlin-for-real-iOS-Android-apps Swift is NOT like Kotlin..? http://blog.applibot.co.jp/blog/2017/04/03/swift-is-not-like-kotlin/ iOSΞϓϦ։ൃऀ͔ΒݟͨKotlin (࣌ؒͷ߹Ͱল͍ͨ෦͋Γ·͕͢ɺߏจͷൺֱ͕៉ྷʹ·ͱ·͍ͬͯ·͢) https://speakerdeck.com/koishi/iosapurikai-fa-zhe-karajian-takotlin null҆શͰͳ͍ݴޠɺϨΨγʔݴޠͩ (nullable ͷछྨͱಛ) http://qiita.com/koher/items/e4835bd429b88809ab33#nullable-%E3%81%AE%E7%A8%AE%E9%A1%9E%E3%81%A8%E7%89%B9%E5%BE%B4 Android։ൃΛड͔ͨ͠ΒKotlinΛΨοπϦͬͯΈͨΒ࠷ߴͩͬͨ http://qiita.com/omochimetaru/items/98e015b0b694dd97f323 ͍͠SwiftΤϯδχΞͷͨΊͷKotlinೖ https://speakerdeck.com/inamiy/mang-siiswiftenziniafalsetamefalsekotlinru-men Kotlin and Swift. Is it a whole new era in Mobile Development? https://medium.com/@andycherkashyn/kotlin-and-swift-is-it-a-new-mobile-development-era-b4c5e81feb08 Swift/Kotlin߹ಉษڧձ https://oi-study.connpass.com/event/62521/