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
0
90
Having fun with Kotlin fun()
Slides from my talk at droidcon Vienna 2018.
Adnan A M
September 21, 2018
Tweet
Share
More Decks by Adnan A M
See All by Adnan A M
Abridge Coding Guidelines
adnan321
0
42
A developer's guide to wealth
adnan321
0
250
What the Hook ?
adnan321
0
79
Scoping Your Storage
adnan321
2
150
What The Context ?
adnan321
2
210
Putting Work Manager To Work
adnan321
0
95
OOP To FP
adnan321
1
190
Putting Work Manager To Work
adnan321
1
150
A slice of Android Slices - droidcon London 2018
adnan321
0
100
Other Decks in Programming
See All in Programming
新しいPHP拡張モジュールインストール方法「PHP Installer for Extensions (PIE)」を使ってみよう!
cocoeyes02
0
340
Devinのメモリ活用の学びを自社サービスにどう組み込むか?
itarutomy
0
2.1k
AI Agents with JavaScript
slobodan
0
220
S3静的ホスティング+Next.js静的エクスポート で格安webアプリ構築
iharuoru
0
220
ミリしらMCP勉強会
watany
4
740
SEAL - Dive into the sea of search engines - Symfony Live Berlin 2025
alexanderschranz
1
130
タイムゾーンの奥地は思ったよりも闇深いかもしれない
suguruooki
1
570
パスキーのすべて / 20250324 iddance Lesson.5
kuralab
0
150
Deoptimization: How YJIT Speeds Up Ruby by Slowing Down / RubyKaigi 2025
k0kubun
0
490
API for docs
soutaro
1
590
PHPで書いたAPIをGoに書き換えてみた 〜パフォーマンス改善の可能性を探る実験レポート〜
koguuum
0
130
Ruby's Line Breaks
yui_knk
2
470
Featured
See All Featured
It's Worth the Effort
3n
184
28k
Build The Right Thing And Hit Your Dates
maggiecrowley
35
2.6k
Typedesign – Prime Four
hannesfritz
41
2.6k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
119
51k
KATA
mclloyd
29
14k
Building Flexible Design Systems
yeseniaperezcruz
329
38k
Why Our Code Smells
bkeepers
PRO
336
57k
4 Signs Your Business is Dying
shpigford
183
22k
Designing Experiences People Love
moore
141
24k
What’s in a name? Adding method to the madness
productmarketing
PRO
22
3.4k
Docker and Python
trallard
44
3.3k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
29
9.4k
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