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
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
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
99
Unityの合同同人誌や合同商業誌を書いてる僕は感想やレビューや評価が欲しい
ryotamurohoshi
0
630
Unity 2021.1での Unityパッケージの名称変更について
ryotamurohoshi
0
900
Odin Validationはいいぞ!
ryotamurohoshi
2
1.1k
Tilemapはいいぞ!2020 〜すごいぞ、プロジェクト専用拡張Brush〜
ryotamurohoshi
0
2.6k
Unityでも、新しいC#
ryotamurohoshi
0
1.5k
Riderはいいぞ!
ryotamurohoshi
1
3.8k
Riderのススメ〜俺はRiderここが好き〜
ryotamurohoshi
1
2.8k
Unity開発者に伝えたい.NETのこと
ryotamurohoshi
4
38k
Other Decks in Technology
See All in Technology
AIによるクリエイティブ生成を行う上での試行錯誤
plaidtech
PRO
0
160
Goodbye ShellScript, Hello File-based App
shunsock
0
380
ADKで始める業務改善 - AIエージェント開発時の考えと設計
harappa80
2
240
AI時代の「技術的負債」の変質ー概念の終焉と再解釈、エージェントと共に向かう先
nwiizo
1
2.9k
開発投資の期待値を上げるプロダクトロードマップづくり ~プロダクトエンジニアが越境して事業を伸ばす~
kekekenta
1
220
Issue 駆動でスペシャリストの意図を届ける、AI 実装のアクセシビリティ向上
thkt
0
120
.NET WebAssemblyで実現するクライアントサイドAI推論:NuGetからViteまで、2つのエコシステムを繋ぐビルド戦略
yamachu
0
240
AIは推し活である。
kurazuuuuuu
1
850
負債のメタファと2026年 / Debt Metaphor in Agentic Engineering Age 202609 Edition
twada
PRO
10
4.3k
え、こんなに早く改修できるの?──新人エンジニアとスクラムマスターの2人が語る、AI×アジャイル開発の現場
ysasago
2
530
品質と信頼性を地続きにする
grimoh
2
820
「ピッケル本」日本語版は4.0(第6版)が出版されるべき / pickaxe4-nagoyark05
kakutani
2
210
Featured
See All Featured
The #1 spot is gone: here's how to win anyway
tamaranovitovic
4
1.2k
Imperfection Machines: The Place of Print at Facebook
scottboms
270
14k
A brief & incomplete history of UX Design for the World Wide Web: 1989–2019
jct
2
510
Self-Hosted WebAssembly Runtime for Runtime-Neutral Checkpoint/Restore in Edge–Cloud Continuum
chikuwait
0
810
The browser strikes back
jonoalderson
0
1.7k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
50
10k
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
530
Money Talks: Using Revenue to Get Sh*t Done
nikkihalliwell
0
500
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
1
6.2k
The World Runs on Bad Software
bkeepers
PRO
72
12k
Leo the Paperboy
mayatellez
10
2.3k
The agentic SEO stack - context over prompts
schlessera
0
940
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かわいい!