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
98
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
64
A developer's guide to wealth
adnan321
0
270
What the Hook ?
adnan321
0
92
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
210
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
メタプログラミングで実現する「コードを仕様にする」仕組み/nikkei-tech-talk43
nikkei_engineer_recruiting
0
210
『Kubernetes ☸️ で実践する Platform Engineering 』を最高速度で読み抜いたる!!👊🏻
hiroki_hasegawa
0
100
Agentic AI: Evolution oder Revolution
mobilelarson
PRO
0
190
Takumiから考えるSecurity_Maturity_Model.pdf
gessy0129
1
150
Claude Codeセッション現状確認 2026福岡 / fukuoka-aicoding-00-beacon
monochromegane
4
450
go directiveを最新にしすぎないで欲しい話──あるいは、Go 1.26からgo mod initで作られるgo directiveの値が変わる話 / Go 1.26 リリースパーティ
arthur1
2
580
CSC307 Lecture 15
javiergs
PRO
0
260
エンジニアの「手元の自動化」を加速するn8n 2026.02.27
symy2co
0
180
What Spring Developers Should Know About Jakarta EE
ivargrimstad
0
750
What Spring Developers Should Know About Jakarta EE
ivargrimstad
0
550
「効かない!」依存性注入(DI)を活用したAPI Platformのエラーハンドリング奮闘記
mkmk884
0
160
Laravel Nightwatchの裏側 - Laravel公式Observabilityツールを支える設計と実装
avosalmon
1
140
Featured
See All Featured
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
300
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
8k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
2.8k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
10
1.1k
Typedesign – Prime Four
hannesfritz
42
3k
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.6k
Navigating Weather and Climate Data
rabernat
0
140
YesSQL, Process and Tooling at Scale
rocio
174
15k
Leadership Guide Workshop - DevTernity 2021
reverentgeek
1
240
Between Models and Reality
mayunak
2
240
Darren the Foodie - Storyboard
khoart
PRO
3
2.9k
Digital Ethics as a Driver of Design Innovation
axbom
PRO
1
230
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