Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Having fun with Kotlin fun()
Search
Adnan A M
September 21, 2018
Programming
130
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Having fun with Kotlin fun()
Slides from my talk at droidcon Vienna 2018.
Adnan A M
September 21, 2018
Transcript
68 slides
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
More Decks by Adnan A M
See All by Adnan A M
Abridge Coding Guidelines
adnan321
0
100
A developer's guide to wealth
adnan321
0
300
What the Hook ?
adnan321
0
120
Scoping Your Storage
adnan321
2
200
What The Context ?
adnan321
2
250
Putting Work Manager To Work
adnan321
0
140
OOP To FP
adnan321
1
230
Putting Work Manager To Work
adnan321
1
230
A slice of Android Slices - droidcon London 2018
adnan321
0
140
Other Decks in Programming
See All in Programming
React Native에 현대적인 빌드 도구 더하기: Rollipop 구현기
leegeunhyeok
0
180
ビジネスロジックを堅牢に~Scala 3のドメインプリミティブ~
j5ik2o
0
190
クラウドエージェントは、 何がそんなに便利なのか / what makes cloud agents so useful
rkaga
5
890
クラウドゲーミングのパフォーマンス最適化に挑む / Cloud Gaming Performance Tuning
vivion
0
350
ローカルLLMの基本と近況 2611 / Local LLM basics and recent situation 2611
kishida
2
490
SODA - FACT BOOK(JP)
sodainc
1
40k
protojson における文字化けの扱い
kazuki1023
0
430
Engineering Biometric UX Across Android Versions | DroidKnights 2026
ryunen344
1
210
Seven New Principles of Software Engineering
yegor256
0
500
Beyond Chatbots: Agentic UI with Open Standards @W-JAX 2026, München
manfredsteyer
PRO
0
110
Crash Auto Pipelines
veronikapj
1
420
AI Augmentation Techniques with Liberty
ivargrimstad
1
500
Featured
See All Featured
Building Flexible Design Systems
yeseniaperezcruz
330
41k
Bootstrapping a Software Product
garrettdimon
PRO
306
120k
Chasing Engaging Ingredients in Design
codingconduct
0
400
Building Adaptive Systems
keathley
44
3.3k
Building a Modern Day E-commerce SEO Strategy
aleyda
45
9.3k
Navigating Team Friction
lara
192
16k
技術選定の審美眼(2025年版) / Understanding the Spiral of Technologies 2025 edition
twada
PRO
121
130k
WENDY [Excerpt]
tessaabrams
15
41k
The Invisible Side of Design
smashingmag
301
52k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
Marketing to machines
jonoalderson
1
6k
Build The Right Thing And Hit Your Dates
maggiecrowley
39
3.5k