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
96
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
52
A developer's guide to wealth
adnan321
0
250
What the Hook ?
adnan321
0
88
Scoping Your Storage
adnan321
2
160
What The Context ?
adnan321
2
210
Putting Work Manager To Work
adnan321
0
99
OOP To FP
adnan321
1
200
Putting Work Manager To Work
adnan321
1
160
A slice of Android Slices - droidcon London 2018
adnan321
0
110
Other Decks in Programming
See All in Programming
もうちょっといいRubyプロファイラを作りたい (2025)
osyoyu
1
450
プロポーザル駆動学習 / Proposal-Driven Learning
mackey0225
2
1.3k
AIでLINEスタンプを作ってみた
eycjur
1
230
旅行プランAIエージェント開発の裏側
ippo012
2
920
基礎から学ぶ大画面対応(Learning Large-Screen Support from the Ground Up)
tomoya0x00
0
3.2k
Zendeskのチケットを Amazon Bedrockで 解析した
ryokosuge
3
310
アプリの "かわいい" を支えるアニメーションツールRiveについて
uetyo
0
270
go test -json そして testing.T.Attr / Kyoto.go #63
utgwkk
3
310
Design Foundational Data Engineering Observability
sucitw
3
200
AIを活用し、今後に備えるための技術知識 / Basic Knowledge to Utilize AI
kishida
22
5.8k
詳解!defer panic recover のしくみ / Understanding defer, panic, and recover
convto
0
250
Navigating Dependency Injection with Metro
zacsweers
3
2.5k
Featured
See All Featured
Embracing the Ebb and Flow
colly
87
4.8k
The Invisible Side of Design
smashingmag
301
51k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
358
30k
How to Ace a Technical Interview
jacobian
279
23k
A Tale of Four Properties
chriscoyier
160
23k
Designing for Performance
lara
610
69k
Designing for humans not robots
tammielis
253
25k
Imperfection Machines: The Place of Print at Facebook
scottboms
268
13k
The World Runs on Bad Software
bkeepers
PRO
70
11k
Done Done
chrislema
185
16k
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.4k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
656
61k
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