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
関数の話
Search
yuroyoro
July 13, 2016
Programming
20
17k
関数の話
Supershipの社内勉強会で使ったやつ
yuroyoro
July 13, 2016
Tweet
Share
More Decks by yuroyoro
See All by yuroyoro
Goに無名関数の糖衣構文いれたらどうなるの? / Considering the introduction of the anonymous function syntax sugar into Go
yuroyoro
4
3.1k
Scala で 作る奇妙なプログラミング言語??
yuroyoro
4
16k
Other Decks in Programming
See All in Programming
3 Effective Rules for Using Signals in Angular
manfredsteyer
PRO
0
120
Flutterを言い訳にしない!アプリの使い心地改善テクニック5選🔥
kno3a87
1
190
cmp.Or に感動した
otakakot
3
200
タクシーアプリ『GO』のリアルタイムデータ分析基盤における機械学習サービスの活用
mot_techtalk
4
1.4k
Webの技術スタックで マルチプラットフォームアプリ開発を可能にするElixirDesktopの紹介
thehaigo
2
1k
Streams APIとTCPフロー制御 / Web Streams API and TCP flow control
tasshi
2
350
2024/11/8 関西Kaggler会 2024 #3 / Kaggle Kernel で Gemma 2 × vLLM を動かす。
kohecchi
5
930
Creating a Free Video Ad Network on the Edge
mizoguchicoji
0
120
Snowflake x dbtで作るセキュアでアジャイルなデータ基盤
tsoshiro
2
520
Arm移行タイムアタック
qnighy
0
330
Jakarta EE meets AI
ivargrimstad
0
110
3 Effective Rules for Using Signals in Angular
manfredsteyer
PRO
1
100
Featured
See All Featured
Embracing the Ebb and Flow
colly
84
4.5k
No one is an island. Learnings from fostering a developers community.
thoeni
19
3k
Java REST API Framework Comparison - PWX 2021
mraible
PRO
28
8.2k
How STYLIGHT went responsive
nonsquared
95
5.2k
A Modern Web Designer's Workflow
chriscoyier
693
190k
5 minutes of I Can Smell Your CMS
philhawksworth
202
19k
Producing Creativity
orderedlist
PRO
341
39k
Fashionably flexible responsive web design (full day workshop)
malarkey
405
65k
Keith and Marios Guide to Fast Websites
keithpitt
409
22k
Code Reviewing Like a Champion
maltzj
520
39k
Teambox: Starting and Learning
jrom
133
8.8k
Practical Orchestrator
shlominoach
186
10k
Transcript
ؔͷ !ZVSPZPSP
ؔͱ
Z G Y ೖྗYʹରͯ͠ɺग़ྗZͷΛܾఆ͢Δنଇ
" # $ % *OU 4USJOH
ࣸ૾ͭͷू߹ͷରԠؔ
JOU TUS JOH ू߹ܕͱߟ͑ΔͱɺܕͱܕͷରԠنଇ
͕ؔ ϑΝʔετΫϥε
MFUGaY TIPX Y มʹʮؔʯΛೖ ଋറ Ͱ͖Δ )BTLFMM
G Y \YUP@T ^ มʹʮؔʯΛೖ ଋറ Ͱ͖Δ 3VCZ
DPOTUG Y \SFUVSOYUP4USJOH ^ มʹʮؔʯΛೖ ଋറ Ͱ͖Δ +BWB4DSJQU
ؔద༻
ධՁʮؔʯʹҾΛ༩͑ͯ݁ՌΛಘΔ͜ͱ SFUVSOYUP4USJOH GJOUTUSJOH SFUVSO ʠʡ ҾY
G H I 2Ͳͷ͔ؔΒʮධՁʯ͢Δ
G H I ਖ਼֨ධՁଆ͔Βɻී௨ͷݴޠ $+43VCZ+BWBʜ
G H I ඇਖ਼֨ධՁ֎ଆ͔ΒɻԆධՁ )BTLFMM*0ʜ
ߴ֊ؔ
MFUH *OU4USJOH TUSJOH HBʠIFMMPʠ B ʮؔʯΛड͚औΔؔ )BTLFMM
H GO \ʠIFMMPʠ GO ^ ʮؔʯΛड͚औΔؔ 3VCZ
DPOTUH GO \SFUVSOʠIFMMPʠ GO ^ ʮؔʯΛड͚औΔؔ +BWB4DSJQU
ʮؔHʯͷҾGOʹʮؔGʯΛ༩͑Δ SFUVSOYUP4USJOH SFUVSOʠIFMMPʠ GO GJOUTUSJOH H JOUTUSJOH TUSJOH lIFMMPz
SFUVSO ҾGO
ड͚औͬͨʮؔʯGOΛͬͯTUSJOHΛฦ͢ H JOUTUSJOH TUSJOH SFUVSOʠIFMMPʠ SFUVSOYUP4USJOH GOJOUTUSJOH lIFMMPz SFUVSO
ҾY SFUVSOYUP4USJOH GOJOUTUSJOH
Ϋϩʔδϟ
MFUB MFUIaYY B पғͷʮڥʯΛऔΓࠐΜͩʮؔʯ )BTLFMM
B I Y \Y B^ पғͷʮڥʯΛऔΓࠐΜͩʮؔʯ 3VCZ
DPOTUB DPOTUI Y \SFUVSOY B^ पғͷʮڥʯΛऔΓࠐΜͩʮؔʯ +BWB4DSJQU
ʮؔIʯʮBʯͱ͍͏ڥΛ͍֮͑ͯΔ SFUVSOY IJOUJOU B B ڥΛऔΓࠐΉ
ʮؔʯ͕ʮঢ়ଶʯΛ͍࣋ͬͯΔͱݴ͑Δ SFUVSOY IJOUJOU B SFUVSO
Ϋϩʔδϟͱ ߴ֊ؔ
MFUJ*OU *OU4USJOH JYaZTIPX Y Z ҾΛऔΓࠐΜͩʮΫϩʔδϟʯΛ࡞ͬͯฦ͢ʮؔʯ )BTLFMM Ϋϩʔδϟ
J Y \ Z \ Y Z UP@T^ ^
ҾΛऔΓࠐΜͩʮΫϩʔδϟʯΛ࡞ͬͯฦ͢ʮؔʯ 3VCZ Ϋϩʔδϟ
DPOTUJ Y \ SFUVSO Z \ SFUVSO Y Z UP4USJOH
^ ^ ҾΛऔΓࠐΜͩʮΫϩʔδϟʯΛ࡞ͬͯฦ͢ʮؔʯ +BWB4DSJQU Ϋϩʔδϟ
ड͚औͬͨҾΛऔΓࠐΜͩʮΫϩʔδϟʯΛฦ͢ JJOUJOUTUSJOH SFUVSO JOUTUSJOH SFUVSO Y ڥΛऔΓࠐΉ SFUVSO Z UP4USJOH
Y Y SFUVSO Z UP4USJOH ҾY JOUTUSJOH
ؔ߹
GɾH Y G H Y ̎ͭͷؔG HΛॱ൪ʹద༻͢Δ߹ؔGɾHΛੜ͢Δ͜ͱ
MFUGaYY MFUHaYTIPXY MFUHGaYHGY ؔHGҾYΛGʹద༻ͨ݁͠ՌΛHʹద༻ͯ͠ฦ͢ )BTLFMM
G Y \Y ^ H Y \YUP@T^ HG Y \H
G Y ^ ؔHGҾYΛGʹద༻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ೖͰ͖ Δ ม ʹ ೖͰ͖ Δ
Φ ϒδΣ Ϋ τ ؔ ؔ
ͷҾ ʹ ͤ Δ ؔ ͷҾ ʹ ͤ Δ
Φ ϒδΣ Ϋ τ ؔ ঢ় ଶ
Λ࣋ ͭ ϝϯό ʔ ม ঢ় ଶ Λ࣋ ͭ Ϋϩʔ δ ϟ
Φ ϒδΣ Ϋ τ ؔ ؔ
Ͱੜ ͯ͠ Γ ʹ Ͱ͖Δ ؔ Ͱੜ ͯ͠ Γ ʹ Ͱ͖Δ
Φ ϒδΣ Ϋ τ ؔ Έ
߹Θ ͤΔ͜ ͱ ͕Ͱ͖ Δ EF M FH BU F D PN Q PTJ UJP O Έ ߹Θ ͤΔ͜ ͱ ͕Ͱ͖ Δ ؔ ߹
ؔ͜Θ͘ͳ͍ ͜Θ͘ͳ͍
͔͜͜Β ͕࣌ؒ༨ͬͨΒ
ؔ߹ͷ ॱং
I H G Y YΛGʹͨ݁͠ՌΛɺHʹͯ͠ಘͨ݁ՌΛɺIʹ͢
I H G Y ӈ͔Βࠨॲཧ͕ྲྀΕ͍ͯ͘
IɾHɾG Y ߹ؔIɾHɾGӈ͔Βద༻͞Ε͍ͯ͘
GH Y H G Y ߹ͷॱংΛٯʹͯ͠߹͢Δ Λߟ͑Δ GɾH Y
G H Y
Ͱ߹͢Δͱɺॲཧ͕ࠨ͔ΒӈʹྲྀΕΔ I H G Y GHI Y
JNQPSU$POUSPM$BUFHPSZ $BUFHPSZDBUDBUBCDBUCDDBUBD )BTLFMMͰ$POUSPM$BUFHPSZʹ ͕͋Δ )BTLFMM
DMBTT1SPD EFG H Y \H TFMG Y ^
FOE FOE 3VCZͰ1SPDͷԋࢉࢠ Λॻ͖͑Δ 3VCZ
'VODUJPOQSPUPUZQFBOE5IFO GVODUJPO G \ SFUVSO Y \SFUVSOG UIJT Y ^
^ 'VODUJPOʹBOE5IFOͳͲ࡞ΕͲ͏ʹ͔ +BWB4DSJQU
ؔ߹ͷॱংΛม͑Δͱ ࠨ͔ΒӈॲཧͷྲྀΕΛ දݱ͢Δ͜ͱ͕Ͱ͖Δ ຊਓͳͷͰࠨ͔ΒಡΈ͍ͨ
ؔ͜Θ͘ͳ͍ ͜Θ͘ͳ͍
ؔద༻͢Δ ؔ
ؔద༻ࠨ͔Βӈʹྲྀ͍ͨ͠ GHI Y
] ؔద༻͢Δʮؔʯ Y]GG Y
Y͕ࠨ͔ΒӈʹG H IΛ௨ͬͯྲྀΕ͍ͯ͘ Y] GHI
] B BC C B]GGB தஔԋࢉࢠ ] ӈลͷؔʹࠨลͷΛ͢ )BTLFMM
DMBTT0CKFDU EFGʛʼ G G TFMG FOE FOE 3VCZͰશ֯
ʛʼ ͰͲ͏ʹ͔ʜ 3VCZ
0CKFDUQSPUPUZQFSFWBQQMZ GVODUJPO G \SFUVSOG UIJT ^ 0CKFDUQSPUPUZQFԚછ +BWB4DSJQU
ؔద༻͢ΔؔͰ Ҿ͕ࠨ͔ΒӈྲྀΕΔ༷Λ දݱ͢Δ͜ͱ͕Ͱ͖Δ ຊਓͳͷͰࠨ͔ΒಡΈ͍ͨ
6OJYͷQJQF &MJYJSͷ]ͳͲ Ͱ͋Μ·Γ͜͏͍͏ॻ͖ํ͠ͳ͍͚Ͳʜ
ؔ͜Θ͘ͳ͍ ͜Θ͘ͳ͍
ؔ߹ͷ จ຺
EFGDPNQPTF G Y \TFMG G Y ^ FOE
ؔ߹ͷ࣮Ͱʜ 3VCZ
EFG G Y \TFMG G Y
^ FOE G Y ͷ݁ՌΛഒʹͯ͠ΈΔ 3VCZ
G Y \Y ^ H Y \Y ^ I Y
\YUP@T^ IHG ʠʡ ߹͞ΕͨؔͷؒͰҾ͕ഒʹ 3VCZ
߹͞ΕͨؔͷؒͰҾ͕ഒʹ Y GJOUJOU Y HJOUJOU YUP@T IJOUTUSJOH
ʠʡ
EFG G Y \ SFTG Y SFTOJM
OJMTFMG SFT ^ FOE G Y ͕OJMͳΒɺ߹͞ΕͨؔΛݺͣʹऴྃ͢Δ 3VCZ
G Y \<OJM Y >TBNQMF^ H Y \<OJM Y >TBNQMF^
I Y \YUP@T^ IHG OJMPSʠʡ G HͷͲͪΒ͔͕OJMΛฦ͢ͱશମͷ݁Ռ͕OJMʹͳΔ 3VCZ
߹͞ΕͨؔͷؒͰOJMνΣοΫ <OJM Y >TBNQMF GJOUJOU <OJM Y >TBNQMF HJOUJOU YUP@T
IJOUTUSJOH OJM OJM ʠʡ ऴྃ ऴྃ
ʮ݁Ռ͕ഒʹͳΔʯจ຺ ʮOJMͩͱதࢭ͢Δʯจ຺ ؔ߹ʹ༷ʑͳʮจ຺ʯΛ༩͑Δ͜ͱ͕Ͱ͖Δ
ʮঢ়ଶ͕มԽ͢Δʯจ຺ ʮೖग़ྗ͕ൃੜ͢Δʯจ຺ ʮඇಉظͰܭࢉ͢Δʯจ຺ ଞʹ͍Ζ͍Ζͳʮจ຺ʯ͕͋Δ
ؔ߹ΛநԽ͢Δͱ ੜ͞ΕΔؔʹ༷ʑͳ ੑ࣭Λ༩͑Δ͜ͱ͕Ͱ͖Δ ͔ͯ͠͠Ϟφʜʜ ҧ͍·͢
ؔ͜Θ͘ͳ͍ ͜Θ͘ͳ͍
ྫ ؔ߹Ͱ 'J[[#V[[
DMBTT1SPD EFGPS G Y \ SFTTFMG Y
SFTOJM G Y SFT ^ FOE FOE ࣗʹYΛద༻ͨ݁͠Ռ͕OJMͳΒɺ߹͞ΕͨؔΛݺͿ 3VCZ
GJ[[ Y \Y GJ[[OJM^ CV[[ Y \Y CV[[OJM^ GJ[[CV[[ Y
\ YY GJ[[CV[[OJM^ JE Y \YUP@T^ GJ[[ CV[[ GJ[[CV[[ͱࣈΛग़ྗ͢ΔؔΛ༻ҙ 3VCZ
NBQ GJ[[CV[[PSGJ[[PSCV[[PSJE ֤ؔΛPSͰ߹ͯ͠NBQ͢ΕGJ[[CV[[Ͱ͖Δ 3VCZ
ͦͷଞͷ τϐοΫ
wŋࢀরಁա wŋΧϦʔԽ wŋ෦ద༻ wŋ࠶ؼ wŋΈࠐΈؔ wŋσʔλߏ ϞϊΠυͱ͔ ͜ͷ͋ͨΓͷػձ͕͋ͬͨΒ
ؔ͜Θ͘ͳ͍ ͜Θ͘ͳ͍