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
Hotwire or React? ~アフタートーク・本編に含めなかった話~ / Hotwire or React? after talk
harunatsujita
1
110
WEBエンジニア向けAI活用入門
sutetotanuki
0
330
AWS IaCの注目アップデート 2024年10月版
konokenj
3
3.2k
「今のプロジェクトいろいろ大変なんですよ、app/services とかもあって……」/After Kaigi on Rails 2024 LT Night
junk0612
4
1.9k
Duckdb-Wasmでローカルダッシュボードを作ってみた
nkforwork
0
100
CSC509 Lecture 09
javiergs
PRO
0
140
Outline View in SwiftUI
1024jp
1
280
3rd party scriptでもReactを使いたい! Preact + Reactのハイブリッド開発
righttouch
PRO
1
580
外部システム連携先が10を超えるシステムでのアーキテクチャ設計・実装事例
kiwasaki
1
280
Generative AI Use Cases JP (略称:GenU)奮闘記
hideg
0
190
現場で役立つモデリング 超入門
masuda220
PRO
15
3.1k
JavaでLチカしたい! / JJUG CCC 2024 Fall LT
nhayato
0
110
Featured
See All Featured
Faster Mobile Websites
deanohume
305
30k
Thoughts on Productivity
jonyablonski
67
4.3k
4 Signs Your Business is Dying
shpigford
180
21k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
43
6.8k
The Pragmatic Product Professional
lauravandoore
31
6.3k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
38
1.8k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
15
2k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
126
18k
We Have a Design System, Now What?
morganepeng
50
7.2k
How to train your dragon (web standard)
notwaldorf
88
5.7k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
229
52k
How To Stay Up To Date on Web Technology
chriscoyier
788
250k
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
׀䠐鋅꧊⚥
ΤϯδχΞืूத ͓ؾܰʹ࿈བྷ͍ͩ͘͞ʂ