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
98
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
64
A developer's guide to wealth
adnan321
0
270
What the Hook ?
adnan321
0
92
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
210
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
生成 AI 時代のスナップショットテストってやつを見せてあげますよ(α版)
ojun9
0
290
安いハードウェアでVulkan
fadis
0
730
AI時代のシステム設計:ドメインモデルで変更しやすさを守る設計戦略
masuda220
PRO
6
1.1k
AI時代の脳疲弊と向き合う ~言語学としてのPHP~
sakuraikotone
1
1.5k
Rethinking API Platform Filters
vinceamstoutz
0
140
CSC307 Lecture 14
javiergs
PRO
0
480
Claude Codeログ基盤の構築
giginet
PRO
7
3.5k
コーディングルールの鮮度を保ちたい / keep-fresh-go-internal-conventions
handlename
0
230
AIコードレビューの導入・運用と AI駆動開発における「AI4QA」の取り組みについて
hagevvashi
0
540
Java 21/25 Virtual Threads 소개
debop
0
230
「接続」—パフォーマンスチューニングの最後の一手 〜点と点を結ぶ、その一瞬のために〜
kentaroutakeda
3
1.7k
Vuetify 3 → 4 何が変わった?差分と移行ポイント10分まとめ
koukimiura
0
170
Featured
See All Featured
[SF Ruby Conf 2025] Rails X
palkan
2
840
Everyday Curiosity
cassininazir
0
170
16th Malabo Montpellier Forum Presentation
akademiya2063
PRO
0
76
The Cult of Friendly URLs
andyhume
79
6.8k
Applied NLP in the Age of Generative AI
inesmontani
PRO
4
2.2k
Heart Work Chapter 1 - Part 1
lfama
PRO
5
35k
Mobile First: as difficult as doing things right
swwweet
225
10k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
A better future with KSS
kneath
240
18k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
8k
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
92
Why You Should Never Use an ORM
jnunemaker
PRO
61
9.8k
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