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
90
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
46
A developer's guide to wealth
adnan321
0
250
What the Hook ?
adnan321
0
79
Scoping Your Storage
adnan321
2
150
What The Context ?
adnan321
2
210
Putting Work Manager To Work
adnan321
0
95
OOP To FP
adnan321
1
200
Putting Work Manager To Work
adnan321
1
150
A slice of Android Slices - droidcon London 2018
adnan321
0
100
Other Decks in Programming
See All in Programming
複数アプリケーションを育てていくための共通化戦略
irof
10
3.8k
コード書くの好きな人向けAIコーディング活用tips #orestudy
77web
3
300
DroidKnights 2025 - 다양한 스크롤 뷰에서의 영상 재생
gaeun5744
1
100
FastMCPでMCPサーバー/クライアントを構築してみる
ttnyt8701
2
130
プロダクト開発でも使おう 関数のオーバーロード
yoiwamoto
0
140
try-catchを使わないエラーハンドリング!? PHPでResult型の考え方を取り入れてみよう
kajitack
3
500
Bytecode Manipulation 으로 생산성 높이기
bigstark
1
270
データベースコネクションプール(DBCP)の変遷と理解
fujikawa8
1
240
Enterprise Web App. Development (2): Version Control Tool Training Ver. 5.1
knakagawa
1
110
漸進。
ssssota
0
1.8k
FormFlow - Build Stunning Multistep Forms
yceruto
1
150
GoのGenericsによるslice操作との付き合い方
syumai
2
440
Featured
See All Featured
The Language of Interfaces
destraynor
158
25k
Imperfection Machines: The Place of Print at Facebook
scottboms
267
13k
The Art of Programming - Codeland 2020
erikaheidi
54
13k
How STYLIGHT went responsive
nonsquared
100
5.6k
Fantastic passwords and where to find them - at NoRuKo
philnash
51
3.3k
4 Signs Your Business is Dying
shpigford
184
22k
Navigating Team Friction
lara
186
15k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
357
30k
Fireside Chat
paigeccino
37
3.5k
The Illustrated Children's Guide to Kubernetes
chrisshort
48
50k
Mobile First: as difficult as doing things right
swwweet
223
9.6k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
130
19k
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