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
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Adnan A M
September 21, 2018
Programming
110
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
71
A developer's guide to wealth
adnan321
0
290
What the Hook ?
adnan321
0
97
Scoping Your Storage
adnan321
2
180
What The Context ?
adnan321
2
240
Putting Work Manager To Work
adnan321
0
110
OOP To FP
adnan321
1
220
Putting Work Manager To Work
adnan321
1
190
A slice of Android Slices - droidcon London 2018
adnan321
0
130
Other Decks in Programming
See All in Programming
Migrations : C'est une question d'hygiène !
vinceamstoutz
0
2.2k
Modding RubyKaigi for Myself
yui_knk
0
470
TypeSpec で繋ぐ複数プロダクトの型安全
maroon8021
1
250
1人1案件のプロダクトエンジニア時代に、"プロセス監督"としてチャレンジしたこと
non0113
0
330
今さら聞けないCancellationToken
htkym
0
200
開発体験を左右するライブラリの API 設計 - GraphQL スキーマ構築ライブラリから考える #tskaigi
izumin5210
2
570
次世代リンターで探る、tsgo 時代における型認識カスタムルールの現実解
ytakahashii
1
1k
生成AI時代にこそ効くGo | Why Go Works in the Age of Generative AI
mom0tomo
7
2.4k
Agentic UI beyond Chats Architecture Patterns & Open Standards @ngMunich 05/2026
manfredsteyer
PRO
0
150
横断組織出身のQAEがインプロセスQAEでつまずいたこと・活かせたこと
ty89
0
330
Skillは並べた。動かなかった。契約で繋いだ。— 65個のSkillから、自走する開発サイクルへ
junholee
0
760
技術記事、AIに書かせるか、自分で書くか? 〜それでも私が自分の手で書く理由〜 / #QiitaConference
jnchito
2
1.1k
Featured
See All Featured
The State of eCommerce SEO: How to Win in Today's Products SERPs - #SEOweek
aleyda
2
11k
Odyssey Design
rkendrick25
PRO
2
630
The Curious Case for Waylosing
cassininazir
1
360
Build The Right Thing And Hit Your Dates
maggiecrowley
39
3.1k
Done Done
chrislema
186
16k
Designing Experiences People Love
moore
143
24k
Automating Front-end Workflow
addyosmani
1370
210k
職位にかかわらず全員がリーダーシップを発揮するチーム作り / Building a team where everyone can demonstrate leadership regardless of position
madoxten
62
54k
Documentation Writing (for coders)
carmenintech
77
5.3k
Kristin Tynski - Automating Marketing Tasks With AI
techseoconnect
PRO
0
250
What does AI have to do with Human Rights?
axbom
PRO
1
2.2k
Neural Spatial Audio Processing for Sound Field Analysis and Control
skoyamalab
0
310
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