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
Having fun with Kotlin fun()
Search
Adnan A M
September 21, 2018
Programming
100
0
Share
Having fun with Kotlin fun()
Slides from my talk at droidcon Vienna 2018.
Adnan A M
September 21, 2018
More Decks by Adnan A M
See All by Adnan A M
Abridge Coding Guidelines
adnan321
0
68
A developer's guide to wealth
adnan321
0
280
What the Hook ?
adnan321
0
95
Scoping Your Storage
adnan321
2
180
What The Context ?
adnan321
2
230
Putting Work Manager To Work
adnan321
0
110
OOP To FP
adnan321
1
220
Putting Work Manager To Work
adnan321
1
180
A slice of Android Slices - droidcon London 2018
adnan321
0
120
Other Decks in Programming
See All in Programming
PHPでバイナリをパースして理解するASN.1
muno92
PRO
0
360
第3木曜LT会 #28
tinykitten
PRO
0
120
Symfony AI in Action - SymfonyLive Berlin 2026
chr_hertel
1
110
リセットCSSを1行消したらアクセシビリティが向上した話
pvcresin
4
410
個人的に嬉しかったpnpmの新機能・3選
matsuo_atsushi
0
120
AIベース静的検査器の偽陽性率を抑える工夫3選
orgachem
PRO
4
380
なぜあなたのコードには「コシ」がないのか?〜AI時代に問う、最後まで美味しい設計と戦略〜 #phpconkagawa / phpconkagawa2026
shogogg
0
100
PHPer、Cloudflare に引っ越す
suguruooki
1
130
ソフトウェア設計の結合バランス #phperkaigi
kajitack
0
170
2026年のソフトウェア開発を考える(2026/05版) / Software Engineering Scrum Fest Niigata 2026 Edition
twada
PRO
19
9.2k
[RubyKaigi 2026] Require Hooks
palkan
1
280
実用!Hono RPC2026
yodaka
2
290
Featured
See All Featured
Evolving SEO for Evolving Search Engines
ryanjones
0
180
The Pragmatic Product Professional
lauravandoore
37
7.2k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.6k
Joys of Absence: A Defence of Solitary Play
codingconduct
1
360
Claude Code のすすめ
schroneko
67
220k
How GitHub (no longer) Works
holman
316
150k
The Cult of Friendly URLs
andyhume
79
6.9k
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
1
200
KATA
mclloyd
PRO
35
15k
The State of eCommerce SEO: How to Win in Today's Products SERPs - #SEOweek
aleyda
2
10k
The Straight Up "How To Draw Better" Workshop
denniskardys
239
140k
Deep Space Network (abreviated)
tonyrice
0
130
Transcript
Having fun with Kotlin fun()
What is a function ?
“ Quote a long definition from Wikipedia here….. OR fun
myFunction() { // pretty awesome function right here }
Kotlin, give us a function !
Kotlin, give us a function !
Local Functions Functions within functions
None
Can’t unit test inner function Caveats/Gotchas Kotlin function doesn’t see
local declarations in advance
Single Expression Functions
None
Top Level Functions Extend functionality
Extension Functions Extend functionality
Extension function
Resolved Statically Under the hood Receiver Object The static function
is passed in the receiver object as a parameter
Companion objects/Static classes Caveats/Gotchas Member Functions Win
Named Arguments Thou shall name parameters
None
None
None
None
Default Parameters
None
Java interop isn’t great, must specify all parameters when calling
Caveats/Gotchas
Lambda Expressions
None
Anonymous functions
None
Higher Order Functions
None
None
None
None
None
None
None
inline functions
None
None
Let’s inline all Higher Order Functions ! Caveats/Gotchas No access
to private variables/members
None
Non local returns
None
None
None
None
None
Standard Functions
“ let, also, apply, run & with
None
None
“ Scoping functions
let
Usage of let
None
apply
Usage of apply
None
also
Usage of also
None
run
Usage of run
None
“ Transformation vs Mutating functions
“ also, apply - Mutating Functions
“ run, let - Transformation Functions
Danke Any questions? You can find me at: ◇ @AdnanM0123
Slide Theme ◇ Presentation template by SlidesCarnival ◇ Photographs by
Unsplash