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
94
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
49
A developer's guide to wealth
adnan321
0
250
What the Hook ?
adnan321
0
85
Scoping Your Storage
adnan321
2
150
What The Context ?
adnan321
2
210
Putting Work Manager To Work
adnan321
0
98
OOP To FP
adnan321
1
200
Putting Work Manager To Work
adnan321
1
160
A slice of Android Slices - droidcon London 2018
adnan321
0
110
Other Decks in Programming
See All in Programming
React は次の10年を生き残れるか:3つのトレンドから考える
oukayuka
41
16k
リッチエディターを安全に開発・運用するために
unachang113
1
350
テスターからテストエンジニアへ ~新米テストエンジニアが歩んだ9ヶ月振り返り~
non0113
2
250
バイブスあるコーディングで ~PHP~ 便利ツールをつくるプラクティス
uzulla
1
320
[DevinMeetupTokyo2025] コード書かせないDevinの使い方
takumiyoshikawa
2
260
LLMは麻雀を知らなすぎるから俺が教育してやる
po3rin
3
2k
CEDEC 2025 『ゲームにおけるリアルタイム通信への QUIC導入事例の紹介』
segadevtech
2
750
Jakarta EE Meets AI
ivargrimstad
0
580
ZeroETLで始めるDynamoDBとS3の連携
afooooil
0
150
中級グラフィックス入門~効率的なメッシュレット描画~
projectasura
4
2.4k
Vibe coding コードレビュー
kinopeee
0
410
Amazon Q CLI開発で学んだAIコーディングツールの使い方
licux
3
170
Featured
See All Featured
Gamification - CAS2011
davidbonilla
81
5.4k
Six Lessons from altMBA
skipperchong
28
3.9k
Into the Great Unknown - MozCon
thekraken
40
2k
Faster Mobile Websites
deanohume
308
31k
The Cost Of JavaScript in 2023
addyosmani
51
8.7k
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
4 Signs Your Business is Dying
shpigford
184
22k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
229
22k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
3.9k
Why You Should Never Use an ORM
jnunemaker
PRO
58
9.5k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
161
15k
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