Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Multiplatform Projectsの向かう先 #m3kt

Multiplatform Projectsの向かう先 #m3kt

Takaki Hoshikawa

January 18, 2018
Tweet

More Decks by Takaki Hoshikawa

Other Decks in Technology

Transcript

  1.  • i e • d # k • 7

    A N T S • 1@7 5 KC 3 5 78 7 • laD • • 7 27 7 # nm N • 0 / # bo g DN # KE O 7 8 #
  2.   kotlin.io.readLine000 JVM 58 # 3126 / / fun

    main(args: Array<String>) { val name = readLine() println("Hello $name!") }
  3. # 2013 / / import java.io.BufferedReader import java.io.File fun main(args:

    Array<String>) { val name = File("name.txt") .bufferedReader() .use { it.readLine() } println("Hello $name!") }
  4.  • 2 /-1 3 /- 20021 C 8 #

    # # 2 /-1 0 # fun main(args: Array<String>) { println("Hello world!") } 20021 2 /-1 5
  5.  • 15 2/ 2/- 0 1 # *5 2/

    3 1 fun main(args: Array<String>) { val name = readLine() println("Hello $name!") } *5 2/ 8
  6.  # 53 01 / 1 # import java.io.BufferedReader import

    java.io.File fun main(args: Array<String>) { val name = File("name.txt") .bufferedReader() .use { it.readLine() } println("Hello $name!") } 01 / 28
  7.  • /350-2 5 0- # # # 8 350-2

    1 /5 # fun main(args: Array<String>) { window.alert("Hello World!") } 350-2
  8.   # 2013 / / actual object Hello {

    actual fun say() = showDialog("Hello!") } actual object Hello { actual fun say() = window.alert("Hello!") }
  9. • 72 3 8 • 2 5 # 1 0

    / expect open class BigInteger(`val`: String) { open fun add(`val`: BigInteger): BigInteger } actual typealias BigInteger = java.math.BigInteger  
  10. • ,8 , 31132 13 0, 0 351 13 0,

    # # # 3 0 2 1 / # fun main(args: Array<String>) { val bi = BigInteger(”10”) val sum = bi.add(BigInteger(”20”)) ... } 
  11. • 8 9 0 0 351 13 0 # 3

    0 2 1 / fun main(args: Array<String>) { val bi = BigInteger(”10”) val div = bi.divide(BigInteger(”5”)) ... } 
  12. # D C 8 # 5 5 K K 163

    K MO A 56 0 6 6 2 2 2 D 56 0 6 6 56 0 6 6 /6 /6 /6 /6   C
  13. # ) ) LJK D D ( 12 5 7

    D D D 3 CD 3 CD 3 CD 0 3 CD VSW 0VSW b T 0 8D // 0VSW 0 8D 2VSW 0 8D D 8 CCML 0 a A 8D  J O dc
  14. # ( ( SN A ( ) CA b 12

    b 5 b A CA C A CA C A CA C 3 D 3 D 3 D /A 3 D fl aJc / aJc fn J /A 8 / aJc /A 8 2 aJc /A 8 8 DDTS  N M i /A me 8 po K A 0 VW / AC kd O LTL
  15. # ( ( D 8 9 ) 58 V M

    T 1 M T V L 58 23 28 1 M T 58 23 28 / M T 58 23 28 2 2 382 K S 1 M T K S 1 M T K S / M T K S V M T 05 K SJ V L 58 5 53
  16.   • U X K in RK el m

    -3- 0 K • - 15K ck /- R15 20 /- K U 8 U oa R U I R # # # 5 20 3 1
  17.   • 5820 aK D D • K0 8

    / 8fJ J • e JI 8 • S c 5820 D k i # I 5820 3 18
  18.  # 8 53 /- 2 13 2 - .8

    8-8/ 3 3 8 53 5 3 5 08: 5/
  19.      • 4 30 / 0

    8 4 K • 53354 58204 C TS K # 58204 3 18 val hoge: dynamic = object {} hoge.fuga = {} // OK hoge.piyo().xxx.yyy() // OK
  20.         • 351

    2 3 23 3 8 K # 8 03 / 3 expect class System { companion object { fun currentTimeMillis(): Long } } // NG actual typealias System = java.lang.System
  21.         • 6

    0 5 8 K 8 31 2 32 3 6 K # 360 2 1 /6 // OK actual class System { actual companion object { actual fun currentTimeMillis() = java.lang.System.currentTimeMillis() } }
  22.         • 7

    0 5 8 K 8 31 2 32 3 K # 3 0 2 1 / // OK actual fun System.Companion.currentTimeMillis() = java.lang.System.currentTimeMillis() class System { companion object } expect fun System.Companion.currentTimeMillis(): Long
  23.     • - C5 # A A

    5BB • .A ,A Wkp df • 8CA 8 03 3 C C .A RrM J • 03W sWtOWv 0 ,RrM J • .A # A ACA • a b e cef • / B 5 AC uio • 2 -5 5 -3W1CA SWj nJ mK / B 5 AC lJ J # # PR .A
  24.  • 0 3 8 521 M 9 iK 9

    9 ,0 2 l akJk • 0 3 8f X X e N /080 9 f jKJ S • cK # # # P 9 8