Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
apply() 要らなくない?
Search
Motoi Washida
August 22, 2017
Programming
2
1.3k
apply() 要らなくない?
2017年の夏のKotlin LT祭での発表資料です。
https://kotlin.connpass.com/event/61427/
Motoi Washida
August 22, 2017
Tweet
Share
More Decks by Motoi Washida
See All by Motoi Washida
アプリのための「レイヤー化」アーキテクチャ / Droid Meetup 2019-03
wm3
0
2.5k
Material Design の社内勉強会を行った / Android Engineer Design 1
wm3
1
170
API仕様書から自前でコード生成して運用した話 / DroidKaigi 2018 Reject Conference
wm3
0
830
Firebase Analytics で 画像ロードのパフォーマンス を測定し、改善をした話
wm3
2
1.4k
Tunnel 社内勉強会 Swift の紹介
wm3
0
270
iOS の Reactive 系ライブラリ
wm3
1
900
Other Decks in Programming
See All in Programming
Snowflake x dbtで作るセキュアでアジャイルなデータ基盤
tsoshiro
2
520
NSOutlineView何もわからん:( 前編 / I Don't Understand About NSOutlineView :( Pt. 1
usagimaru
0
330
.NET のための通信フレームワーク MagicOnion 入門 / Introduction to MagicOnion
mayuki
1
1.5k
GitHub Actionsのキャッシュと手を挙げることの大切さとそれに必要なこと
satoshi256kbyte
5
430
Nurturing OpenJDK distribution: Eclipse Temurin Success History and plan
ivargrimstad
0
900
Macとオーディオ再生 2024/11/02
yusukeito
0
370
みんなでプロポーザルを書いてみた
yuriko1211
0
260
型付き API リクエストを実現するいくつかの手法とその選択 / Typed API Request
euxn23
8
2.2k
TypeScriptでライブラリとの依存を限定的にする方法
tutinoko
2
660
Remix on Hono on Cloudflare Workers
yusukebe
1
290
とにかくAWS GameDay!AWSは世界の共通言語! / Anyway, AWS GameDay! AWS is the world's lingua franca!
seike460
PRO
1
860
CSC509 Lecture 11
javiergs
PRO
0
180
Featured
See All Featured
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
0
89
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
159
15k
jQuery: Nuts, Bolts and Bling
dougneiner
61
7.5k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
31
2.7k
Product Roadmaps are Hard
iamctodd
PRO
49
11k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
10
720
Become a Pro
speakerdeck
PRO
25
5k
We Have a Design System, Now What?
morganepeng
50
7.2k
The Pragmatic Product Professional
lauravandoore
31
6.3k
Typedesign – Prime Four
hannesfritz
40
2.4k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
356
29k
The MySQL Ecosystem @ GitHub 2015
samlambert
250
12k
Transcript
BQQMZ 銲זֻזְ 똲歊㛇
荈䊹稱➜
荈䊹稱➜ ˖ せ똲歊㛇 ˖ 5XJUUFS!XN ˖ "OESPJEؒٝآص، J04瘝װ ˖
3PPN$MJQהְֲ؎ٝذٔ،ⱖ溪ך $(.涪⚥
(PPHMF*0ך傈ח,PUMJO䱰欽׃ת׃
ַֿ ,PUMJO娖♲٠剢ך 蕯鰳罏ָזַ鎉ְתׅ
➙傈鎉ְְ✲
None
BQQMZ
銲זֻזְ
None
BQQMZ
أ؝٦فꟼ侧ך♧א ⴱ劍⻉ָٖؒؖٝز ח剅ֽ
BQQMZ ⢪זְה // { "key1": 1, "key2": 8 } //
ΛҾʹͯؔ͠Λݺͼ͍ͨ val map = Bundle() map.putInt("key1", 1) map.putInt("key2", 8) someFunction(map)
BQQMZ ⢪ֲה // { "key1": 1, "key2": 8 } //
ΛҾʹͯؔ͠Λݺͼ͍ͨ someMethod(Bundle().apply { putInt("key1", 1) putInt("key2", 8) })
瀉ְ
ֶ׃ׯ
,PUMJOזדכ ˟ הְֲ״+BWB 4XJGU鴟חכזְ
ד✉欽ׅה 汤ְ湡鋅ֲ
None
ㄎן⳿׃㼎韋ָ ♶僇然ח
⢽
⢽ class Point { var x = 0; var y
= 0 } var y = 0 // มએݴ val p = Point().apply { x = 3 y = 4 // Ͳͬͪͷ y? } println("p = (${p.x}, ${p.y})") // p = (3, 4) Λग़ྗͦ͠͏
⢽ class Point { var x = 0; var y
= 0 } var y = 0 // มએݴ val p = Point().apply { x = 3 y = 4 // Ͳͬͪͷ y? } println("p = (${p.x}, ${p.y})") // p = (3, 0) Λग़ྗ (※)
➿剏周
BMTP
➿剏周 class Point { var x = 0; var y
= 0 } var y = 0 val p = Point().apply { x = 3 y = 4 } println("p = (${p.x}, ${p.y})") // p = (3, 0) Λग़ྗ
➿剏周 BMTP class Point { var x = 0; var
y = 0 } var y = 0 val p = Point().also { it.x = 3 it.y = 4 } println("p = (${p.x}, ${p.y})") // p = (3, 4) Λग़ྗ
せ➰ֹ䒷侧
➿剏周 class Point { var x = 0; var y
= 0 } var y = 0 val p = Point().apply { x = 3 y = 4 } println("p = (${p.x}, ${p.y})") // p = (3, 0) Λग़ྗ
➿剏周 せ➰ֹ䒷侧 class Point(val x: Int, val y: Int) var
y = 0 val p = Point( x = 3, y = 4 ) println("p = (${p.x}, ${p.y})") // p = (3, 4) Λग़ྗ
猘鋅
BQQMZ ״BMTP ך倯ָ㸜Ⰻ
➙儗ךⶰ⡲欽ָ㼰זְ 鏣鎘أة؎ٕז ⢪ֲ堣⠓ָקרזְ
את
BQQMZ SVO XJUIכ MFU BMTPד➿欽
דְְךדכ
None
׀䠐鋅꧊⚥
ΤϯδχΞืूத ͓ؾܰʹ࿈བྷ͍ͩ͘͞ʂ