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
3分でわかるatama plusのQA/about atama plus QA
atamaplus
0
130
夢の無限スパゲッティ製造機 -実装篇- #phpstudy
o0h
PRO
0
200
安いハードウェアでVulkan
fadis
1
950
Linux Kernelの1文字のミスで 権限昇格ができた話
rqda
0
2.3k
ハンズオンで学ぶクラウドネイティブ
tatsukiminami
0
120
実践CRDT
tamadeveloper
0
440
それはエンジニアリングの糧である:AI開発のためにAIのOSSを開発する現場より / It serves as fuel for engineering: insights from the field of developing open-source AI for AI development.
nrslib
1
840
アーキテクチャモダナイゼーションとは何か
nwiizo
17
4.8k
Symfonyの特性(設計思想)を手軽に活かす特性(trait)
ickx
0
130
まかせられるPM・まかせられないPM / DevTech GUILD Meetup
yusukemukoyama
0
120
GNU Makeの使い方 / How to use GNU Make
kaityo256
PRO
16
5.6k
レガシーPHP転生 〜父がドメインエキスパートだったのでDDD+Claude Codeでチート開発します〜
panda_program
0
670
Featured
See All Featured
How STYLIGHT went responsive
nonsquared
100
6k
How to Align SEO within the Product Triangle To Get Buy-In & Support - #RIMC
aleyda
1
1.5k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
10k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
199
73k
Everyday Curiosity
cassininazir
0
190
The SEO Collaboration Effect
kristinabergwall1
0
420
The untapped power of vector embeddings
frankvandijk
2
1.7k
Design in an AI World
tapps
0
190
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.4k
Designing Powerful Visuals for Engaging Learning
tmiket
1
330
Winning Ecommerce Organic Search in an AI Era - #searchnstuff2025
aleyda
1
2k
A Soul's Torment
seathinner
6
2.6k
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