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
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
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
67
A developer's guide to wealth
adnan321
0
280
What the Hook ?
adnan321
0
93
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
「速くなった気がする」をデータで疑う
senleaf24
0
160
Make GenAI Production-Ready with Kubernetes Patterns
bibryam
0
110
煩雑なSkills管理をSoC(関心の分離)により解決する――関心を分離し、プロンプトを部品として育てるためのOSSを作った話 / Solving Complex Skills Management Through SoC (Separation of Concerns)
nrslib
4
860
PHP で mp3 プレイヤーを実装しよう
m3m0r7
PRO
0
240
瑠璃の宝石に学ぶ技術の声の聴き方 / 【劇場版】アニメから得た学びを発表会2026 #エンジニアニメ
mazrean
0
230
PHPで TLSのプロトコルを実装してみるをもう一度しゃべりたい
higaki_program
0
190
事業会社でのセキュリティ長期インターンについて
masachikaura
0
240
AWS re:Invent 2025の少し振り返り + DevOps AgentとBacklogを連携させてみた
satoshi256kbyte
3
160
夢の無限スパゲッティ製造機 -実装篇- #phpstudy
o0h
PRO
0
200
How Swift's Type System Guides AI Agents
koher
0
210
へんな働き方
yusukebe
6
2.9k
Go_College_最終発表資料__外部公開用_.pdf
xe_pc23
0
180
Featured
See All Featured
The Curse of the Amulet
leimatthew05
1
11k
A Guide to Academic Writing Using Generative AI - A Workshop
ks91
PRO
1
260
The Impact of AI in SEO - AI Overviews June 2024 Edition
aleyda
5
790
Building a Modern Day E-commerce SEO Strategy
aleyda
45
9k
AI: The stuff that nobody shows you
jnunemaker
PRO
5
540
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
128
55k
Fireside Chat
paigeccino
42
3.9k
Ruling the World: When Life Gets Gamed
codingconduct
0
190
How to make the Groovebox
asonas
2
2.1k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
34
2.7k
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
130
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
180
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