Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
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
130
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
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
93
A developer's guide to wealth
adnan321
0
300
What the Hook ?
adnan321
0
120
Scoping Your Storage
adnan321
2
200
What The Context ?
adnan321
2
240
Putting Work Manager To Work
adnan321
0
130
OOP To FP
adnan321
1
230
Putting Work Manager To Work
adnan321
1
220
A slice of Android Slices - droidcon London 2018
adnan321
0
140
Other Decks in Programming
See All in Programming
npm との違いを手がかりにGo の依存管理を理解したい
optim
0
1.1k
SalesForceを内製化!? ~ HR事業を支える顧客管理基盤のインフラを大公開 ~
oku053
0
200
Groovy as a human and AI friendly programming language
paulk
0
110
Atomic Design, Enforced: Scaling Mobile Design Systems (next.app devCon / droidCon Berlin 2026)
steliosf
PRO
0
180
Railsバージョンを4倍にした話
optim
0
590
APNsからLive Activityを開始する話
yumnumm
0
170
Compiling a real-world CLI tool to native with Static Hermes
tmikov2023
0
130
Simple Storage Service(S3) is not simple
iwatsukayura
0
320
contenteditable と日本語入力に向き合う
colorful12
0
210
조합이폭발하는디자인시스템이걸눈으로도테스트하라고요
giljongyu
0
410
最近”作らせてる” ローカルAIアプリの話
akit37
0
490
[JA] Domain Modeling with Vanilla Rails: 「操作」から再考するRailsの設計論
yasaichi
4
880
Featured
See All Featured
Measuring & Analyzing Core Web Vitals
bluesmoon
9
1k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
232
55k
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
0
290
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
950
DevOps and Value Stream Thinking: Enabling flow, efficiency and business value
helenjbeal
2
410
Become a Pro
speakerdeck
PRO
31
6.3k
Un-Boring Meetings
codingconduct
0
460
Prompt Engineering for Job Search
mfonobong
0
530
Music & Morning Musume
bryan
48
7.4k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
10k
From π to Pie charts
rasagy
1
410
Efficient Content Optimization with Google Search Console & Apps Script
katarinadahlin
PRO
1
940
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