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
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
94
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
Liberating Ruby's Parser from Lexer Hacks
ydah
2
2k
SkillがSkillを生む:QA観点出しを自動化した
sontixyou
6
3.5k
Going Multiplatform with Your Android App (Android Makers 2026)
zsmb
2
450
Spec Driven Development | AI Summit Vilnius
danielsogl
PRO
1
110
From Formal Specification to Property Based Test
ohbarye
0
200
PicoRuby for IoT: Connecting to the Cloud with MQTT
yuuu
2
640
iOS機能開発のAI環境と起きた変化
ryunakayama
0
190
ふりがな Deep Dive try! Swift Tokyo 2026
watura
0
230
How Swift's Type System Guides AI Agents
koher
0
300
Terraform言語の静的解析 / static analysis of Terraform language
wata727
1
110
Swift Concurrency Type System
inamiy
1
540
의존성 주입과 모듈화
fornewid
0
150
Featured
See All Featured
Navigating Weather and Climate Data
rabernat
0
170
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
1
200
Leo the Paperboy
mayatellez
7
1.7k
A better future with KSS
kneath
240
18k
The World Runs on Bad Software
bkeepers
PRO
72
12k
Conquering PDFs: document understanding beyond plain text
inesmontani
PRO
4
2.6k
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
1
170
Self-Hosted WebAssembly Runtime for Runtime-Neutral Checkpoint/Restore in Edge–Cloud Continuum
chikuwait
0
490
How to Build an AI Search Optimization Roadmap - Criteria and Steps to Take #SEOIRL
aleyda
1
2k
The Pragmatic Product Professional
lauravandoore
37
7.2k
Utilizing Notion as your number one productivity tool
mfonobong
4
290
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.4k
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