Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Kotlinのリストのmap関数、自動生成されているって!
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
RyotaMurohoshi
August 25, 2018
Technology
650
3
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Kotlinのリストのmap関数、自動生成されているって!
2018年8月25日(土)のKotlin FestのLT資料です!
RyotaMurohoshi
August 25, 2018
More Decks by RyotaMurohoshi
See All by RyotaMurohoshi
Tilemapのアップデートについて
ryotamurohoshi
0
100
Unityの合同同人誌や合同商業誌を書いてる僕は感想やレビューや評価が欲しい
ryotamurohoshi
0
640
Unity 2021.1での Unityパッケージの名称変更について
ryotamurohoshi
0
930
Odin Validationはいいぞ!
ryotamurohoshi
2
1.1k
Tilemapはいいぞ!2020 〜すごいぞ、プロジェクト専用拡張Brush〜
ryotamurohoshi
0
2.6k
Unityでも、新しいC#
ryotamurohoshi
0
1.6k
Riderはいいぞ!
ryotamurohoshi
1
3.9k
Riderのススメ〜俺はRiderここが好き〜
ryotamurohoshi
1
2.8k
Unity開発者に伝えたい.NETのこと
ryotamurohoshi
4
38k
Other Decks in Technology
See All in Technology
分析作業をどこまで任せるか自分で決められる AIネイティブBI『Golden Analytics』が 良さげな話 /golden-analytics-is-ai-native-bi
shinyaa31
0
120
Consistency for mere mortals - A gentle guide to consistency
ufried
0
120
「いつか使う」の「いつか」は来ない 〜AI駆動開発における「作らない」判断について〜
ikki0006
0
110
Sizing, Benchmarking and Performance Tuning Apache Flink Clusters
rmetzger
0
120
基本から分かる!AWSセキュリティ運用の考え方と任せ方
cmusudakeisuke
1
410
Deep Data Security 機能解説
oracle4engineer
PRO
3
1k
IoTとは〜? 数字で見るSORACOM UG【SORACOM UG Explorer 2026】
soracom
PRO
0
180
セキュリティ専任チームなしで攻撃を先回りするSREが実践したSIEM on Amazon OpenSearch Service
cscengineer
PRO
0
250
The future of architectural work
ufried
0
170
Strands Decider 2BでAWSアップデートの目利きをしてみた
sato4mi
1
120
AIエージェント統制はAPIから——押さえるべき5つの要素
nagix
0
120
業務でAWSをあまり使っていない私が、AWSへのモチベを保つ方法
smt7174
0
140
Featured
See All Featured
Fantastic passwords and where to find them - at NoRuKo
philnash
53
4k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
2.2k
Speed Design
sergeychernyshev
33
2.2k
How to train your dragon (web standard)
notwaldorf
96
6.9k
Dominate Local Search Results - an insider guide to GBP, reviews, and Local SEO
greggifford
PRO
0
400
Being A Developer After 40
akosma
PRO
92
590k
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
3
1.4k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
28
3.7k
brightonSEO & MeasureFest 2025 - Winning Strategies for Black Friday CRO & PPC - Christian Goodrich
cargoodrich
3
890
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
2.2k
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
Kristin Tynski - Automating Marketing Tasks With AI
techseoconnect
PRO
0
580
Transcript
Kotlinのリストのmap関数のコード 自動生成されてるって! @RyotaMurohoshi 2018/08/25(土) Kotlin Fest LT
Kotlin 1.3にて 符号なし整数値型が登場予定! ※現状はまだExperimental
ソースコードを覗いてみましょう! https://github.com/JetBrains/kotlin/tree/v1.3-M1/libraries/stdlib/unsigned/src/kotlin
UInt
UShort
None
ほぼ一緒じゃん! ※ ここチョイ笑いするとこですよ
ところでちょっと気になるコメントに 気が付きましたか?
UInt
拡大すると・・・
ここ!!!
符号なし整数値型のコード 自動生成されてる! ※ ここ「へー」っていうことですよ!
`kotlin/generators`ディレクトリの `builtins/generateBuiltIns.kt`をみてね! https://github.com/JetBrains/kotlin/blob/v1.3-M1/generators/builtins/arrayIterators.kt `ranges`や`iterator`も生成されているよ!
ところで、Kotlinのstdlib・・・
https://github.com/JetBrains/kotlin/tree/1.2.60/libraries/stdlib Standard LibraryのReadMeには・・・
https://github.com/JetBrains/kotlin/tree/1.2.60/libraries/stdlib Standard LibraryのReadMeには・・・
そう、stdlibにも自動生成されたコードが! ※ ここ「へー」っていうことですよ!
どんなコードが自動生成されている? みんながよく使うアレも自動生成されている!
これ!map拡張関数! みんなが大好きリストのmap関数!
map拡張関数の実装も・・・? https://github.com/JetBrains/kotlin/blob/1.2.60/libraries/stdlib/common/src/generated/_Collections.kt#L1217
こいつも自動生成!!! ※ ここみんなが大きな声で「へー」っていうことですよ!
そう、mapもfilterも 実は、自動生成されているんです! ※ ここ”も”みんなが大きな声で「へー」っていうことですよ!
kotlin/libraries/tools/kotlin-stdlib-gen https://github.com/JetBrains/kotlin/tree/v1.3-M1/libraries/tools/kotlin-stdlib-gen
kotlin/libraries/tools/kotlin-stdlib-gen https://github.com/JetBrains/kotlin/tree/v1.3-M1/libraries/tools/kotlin-stdlib-gen Kotlinでのコード生成に興味があったら、読んでみて! @DslMarkerも利用した、コードジェネレータDSL! KDocも、DSLでいい感じに作っている!
kotlin/libraries/tools/kotlin-stdlib-gen https://github.com/JetBrains/kotlin/tree/v1.3-M1/libraries/tools/kotlin-stdlib-gen • `src/generators/GenerateStandardLib.kt`がエントリポイント • `src/templates/dsl`以下に、DSLのためのクラス群がある • `src/templates`以下に、DSLを利用したメソッドを実際に生成するクラス群
まとめ • Kotlinのコード、自動生成されているよ! • `kotlin/generators/builtins` • `kotlin/libraries/tools/kotlin-stdlib-gen` • stdlibのコード、DSLやコードジェネレーターの参考になるよ! •
ドメインがKotlinだから、他の知識なしでも理解が!
詳しくはブログで!
2018/08/25(土) Kotlin Fest LT @RyotaMurohoshi リストのmap関数のコード 自動生成されてるって!
時間が余ったのでみなさん大きな声で 「へーーー!」 って言っください! リストのmap関数のコード 自動生成されてるって!
Kotlinかわいい!