https://kotlinlang.org logo
Join the conversationJoin Slack
Channels
100daysofcode
100daysofkotlin
100daysofkotlin-2021
advent-of-code
aem
ai
alexa
algeria
algolialibraries
amsterdam
android
android-architecture
android-databinding
android-studio
androidgithubprojects
androidthings
androidx
androidx-xprocessing
anime
anko
announcements
apollo-kotlin
appintro
arabic
argentina
arkenv
arksemdevteam
armenia
arrow
arrow-contributors
arrow-meta
ass
atlanta
atm17
atrium
austin
australia
austria
awesome-kotlin
ballast
bangladesh
barcelona
bayarea
bazel
beepiz-libraries
belgium
berlin
big-data
books
boston
brazil
brikk
budapest
build
build-tools
bulgaria
bydgoszcz
cambodia
canada
carrat
carrat-dev
carrat-feed
chicago
chile
china
chucker
cincinnati-user-group
cli
clikt
cloudfoundry
cn
cobalt
code-coverage
codeforces
codemash-precompiler
codereview
codingame
codingconventions
coimbatore
collaborations
colombia
colorado
communities
competitive-programming
competitivecoding
compiler
compose
compose-android
compose-desktop
compose-hiring
compose-ios
compose-mp
compose-ui-showcase
compose-wear
compose-web
connect-audit-events
corda
cork
coroutines
couchbase
coursera
croatia
cryptography
cscenter-course-2016
cucumber-bdd
cyprus
czech
dagger
data2viz
databinding
datascience
dckotlin
debugging
decompose
decouple
denmark
deprecated
detekt
detekt-hint
dev-core
dfw
docs-revamped
dokka
domain-driven-design
doodle
dsl
dublin
dutch
eap
eclipse
ecuador
edinburgh
education
effective-kotlin
effectivekotlin
emacs
embedded-kotlin
estatik
event21-community-content
events
exposed
failgood
fb-internal-demo
feed
firebase
flow
fluid-libraries
forkhandles
forum
fosdem
fp-in-kotlin
framework-elide
freenode
french
fritz2
fuchsia
functional
funktionale
gamedev
ge-kotlin
general-advice
georgia
geospatial
german-lang
getting-started
github-workflows-kt
glance
godot-kotlin
google-io
gradle
graphic
graphkool
graphql
graphql-kotlin
graviton-browser
greece
grpc
gsoc
gui
hackathons
hacktoberfest
hamburg
hamkrest
helios
helsinki
hexagon
hibernate
hikari-cp
hire-me
hiring
hongkong
hoplite
http4k
hungary
hyderabad
image-processing
india
indonesia
inkremental
intellij
intellij-plugins
intellij-tricks
internships
introduce-yourself
io
ios
iran
israel
istanbulcoders
italian
jackson-kotlin
jadx
japanese
jasync-sql
java-to-kotlin-refactoring
javadevelopers
javafx
javalin
javascript
jdbi
jhipster-kotlin
jobsworldwide
jpa
jshdq
juul-libraries
jvm-ir-backend-feedback
jxadapter
k2-early-adopters
kaal
kafka
kakao
kalasim
kapt
karachi
karg
karlsruhe
kash_shell
kaskade
kbuild
kdbc
kgen-doc-tools
kgraphql
kinta
klaxon
klock
kloudformation
kmdc
kmm-español
kmongo
knbt
knote
koalaql
koans
kobalt
kobweb
kodein
kodex
kohesive
koin
koin-dev
komapper
kondor-json
kong
kontent
kontributors
korau
korean
korge
korim
korio
korlibs
korte
kotest
kotest-contributors
kotless
kotlick
kotlin-asia
kotlin-beam
kotlin-by-example
kotlin-csv
kotlin-data-storage
kotlin-foundation
kotlin-fuel
kotlin-in-action
kotlin-inject
kotlin-latam
kotlin-logging
kotlin-multiplatform-contest
kotlin-mumbai
kotlin-native
kotlin-pakistan
kotlin-plugin
kotlin-pune
kotlin-roadmap
kotlin-samples
kotlin-sap
kotlin-serbia
kotlin-spark
kotlin-szeged
kotlin-website
kotlinacademy
kotlinbot
kotlinconf
kotlindl
kotlinforbeginners
kotlingforbeginners
kotlinlondon
kotlinmad
kotlinprogrammers
kotlinsu
kotlintest
kotlintest-devs
kotlintlv
kotlinultimatechallenge
kotlinx-datetime
kotlinx-files
kotlinx-html
kotrix
kotson
kovenant
kprompt
kraph
krawler
kroto-plus
ksp
ktcc
ktfmt
ktlint
ktor
ktp
kubed
kug-leads
kug-torino
kvision
kweb
lambdaworld_cadiz
lanark
language-evolution
language-proposals
latvia
leakcanary
leedskotlinusergroup
lets-have-fun
libgdx
libkgd
library-development
linkeddata
lithuania
london
losangeles
lottie
love
lychee
macedonia
machinelearningbawas
madrid
malaysia
mathematics
meetkotlin
memes
meta
metro-detroit
mexico
miami
micronaut
minnesota
minutest
mirror
mockk
moko
moldova
monsterpuzzle
montreal
moonbean
morocco
motionlayout
mpapt
mu
multiplatform
mumbai
munich
mvikotlin
mvrx
myndocs-oauth2-server
naming
navigation-architecture-component
nepal
new-mexico
new-zealand
newname
nigeria
nodejs
norway
npm-publish
nyc
oceania
ohio-kotlin-users
oldenburg
oolong
opensource
orbit-mvi
osgi
otpisani
package-search
pakistan
panamá
pattern-matching
pbandk
pdx
peru
philippines
phoenix
pinoy
pocketgitclient
polish
popkorn
portugal
practical-functional-programming
proguard
prozis-android-backup
pyhsikal
python
python-contributors
quasar
random
re
react
reaktive
realm
realworldkotlin
reductor
reduks
redux
redux-kotlin
refactoring-to-kotlin
reflect
refreshversions
reports
result
rethink
revolver
rhein-main
rocksdb
romania
room
rpi-pico
rsocket
russian
russian_feed
russian-kotlinasfirst
rx
rxjava
san-diego
science
scotland
scrcast
scrimage
script
scripting
seattle
serialization
server
sg-user-group
singapore
skia-wasm-interop-temp
skrape-it
slovak
snake
sofl-user-group
southafrica
spacemacs
spain
spanish
speaking
spek
spin
splitties
spotify-mobius
spring
spring-security
squarelibraries
stackoverflow
stacks
stayhungrystayfoolish
stdlib
stlouis
strife-discord-lib
strikt
students
stuttgart
sudan
swagger-gradle-codegen
swarm
sweden
swing
swiss-user-group
switzerland
talking-kotlin
tallinn
tampa
teamcity
tegal
tempe
tensorflow
terminal
test
testing
testtestest
texas
tgbotapi
thailand
tornadofx
touchlab-tools
training
tricity-kotlin-user-group
trójmiasto
truth
tunisia
turkey
turkiye
twitter-feed
uae
udacityindia
uk
ukrainian
uniflow
unkonf
uruguay
utah
uuid
vancouver
vankotlin
vertx
videos
vienna
vietnam
vim
vkug
vuejs
web-mpp
webassembly
webrtc
wimix_sentry
wwdc
zircon
Powered by Linen
announcements
  • p

    Paul Woitaschek

    11/09/2017, 1:26 PM
    class.name
    ?
    c
    s
    s
    • 4
    • 8
  • p

    Paul Woitaschek

    11/09/2017, 3:17 PM
    Sometimes the java converter is driving me mad
    o
    • 2
    • 1
  • h

    hagabaka

    11/09/2017, 4:53 PM
    Is there a way to define a generic function only for T which defines …`T.minus(T) -> T`?
    k
    a
    • 3
    • 6
  • b

    brescia123

    11/09/2017, 5:16 PM
    Did someone ever experienced a situation where an
    object
    at runtime has multiple instances?
    o
    a
    +2
    • 5
    • 36
  • b

    brescia123

    11/09/2017, 5:24 PM
    @hagabaka I’m talking about objects defined with the keyword
    object
    h
    • 2
    • 2
  • p

    pastjean

    11/09/2017, 11:32 PM
    you sure can, but it must be declared at the top
    k
    • 2
    • 1
  • s

    Shahriyar Nasir

    11/10/2017, 4:29 AM
    Hi Everyone. I’m new to the Kotlin community and just finished my first little pet project to get acquainted with the stack. Would love to get some feedback on it from you Kotlin pros! https://github.com/snasirca/kdiff
    👍 1
    r
    • 2
    • 1
  • t

    Tomaz Kragelj

    11/10/2017, 10:00 AM
    Hey! New to Kotlin and this group and struggling to get an answer for how to use callback in the form of optional property. For example:
    var onDownloadCompleted: ((data: ByteArray) -> Unit)? = null
    Coming from Swift, I tried calling it using ? mark but it yields compiler error “(Error:(108, 26) Unexpected tokens (use ‘;’ to separate expressions on the same line)“:
    onDownloadCompleted?(bytes)
    So currently I’m using longer form which works:
    if (onDownloadCompleted != null) {
        onDownloadCompleted!!(bytes)
    }
    But it feels so un-DRY for such a simple task, is there a simpler way? Or am I thinking in wrong direction and should use different callback approach?
    e
    m
    +2
    • 5
    • 8
  • l

    Leandro Cavalheiro

    11/10/2017, 12:04 PM
    Good Morning people... Sorry by my very very bad English .. I'm Brazilian and new with kotlin... but go try ... I see many examples in the web and all of them uses 'VAL' for create properties ... Then I think: When update an registry ... how to make? If 'Val' is equivalent to 'Final' of the Java ...
    r
    t
    • 3
    • 3
  • l

    Leandro Cavalheiro

    11/10/2017, 12:11 PM
    Ok..but why always uses VAL in examples?
    k
    c
    • 3
    • 11
  • e

    elect

    11/10/2017, 12:12 PM
    why do I get here https://github.com/kotlin-graphics/assimp/blob/master/src/main/kotlin/assimp/format/collada/ColladaParser.kt#L554 the following error at `continue`:
    'break' or 'continue' jumps across a function or a class boundary
    ? Shouldn't be working because
    let
    is inlined?
    p
    • 2
    • 2
  • s

    Slackbot

    11/10/2017, 1:30 PM
    This message was deleted.
    a
    d
    +2
    • 5
    • 7
  • b

    bloodshura

    11/10/2017, 6:33 PM
    Any way to make IDEA collapse copyright headers in Kotlin files?
    p
    j
    • 3
    • 3
  • r

    redrield

    11/11/2017, 3:45 AM
    How could I get an expression to fire multiple branches of a
    when
    if the lhs matches
    a
    • 2
    • 1
  • s

    Slackbot

    11/11/2017, 4:36 PM
    This message was deleted.
    k
    c
    x
    • 4
    • 19
  • f

    Fré Dumazy

    11/12/2017, 12:11 AM
    Have any of you used AOP with kotlin? For instance AspectJ?
    👍 1
    d
    • 2
    • 3
  • k

    keturn

    11/12/2017, 7:13 AM
    just found out about
    @DslMarker
    . world turned upside down, not sure what to think. will sleep on it.
    a
    h
    k
    • 4
    • 4
  • c

    Cisco

    11/12/2017, 10:25 AM
    Hi guys! Do you guys know any good online courses to learn Kotlin? Planning to make an Android app with it
    a
    a
    • 3
    • 3
  • j

    joscha.alisch

    11/12/2017, 11:14 PM
    @Czar You might want to take a look at https://github.com/MicroUtils/kotlin-logging
    c
    • 2
    • 1
  • m

    mobigeek

    11/13/2017, 2:09 PM
    @louiscad it’s already there
    l
    • 2
    • 1
  • t

    trevjones

    11/13/2017, 5:13 PM
    ::class.java
    is a compile time constant
    s
    • 2
    • 3
  • t

    trevjones

    11/13/2017, 5:13 PM
    and you can only
    Foo.javaClass
    if it has a companion object
    l
    • 2
    • 2
  • n

    napperley

    11/13/2017, 10:04 PM
    Noticed that SDK Man fails to install Kotlin 1.1.60 with the following error message:
    End-of-central-directory signature not found.  Either this file is not
      a zipfile, or it constitutes one disk of a multi-part archive.  In the
      latter case the central directory and zipfile comment will be found on
      the last disk(s) of this archive.
    unzip:  cannot find zipfile directory in one of /home/napperley/.sdkman/archives/kotlin-1.1.60.zip or
            /home/napperley/.sdkman/archives/kotlin-1.1.60.zip.zip, and cannot find /home/napperley/.sdkman/archives/kotlin-1.1.60.zip.ZIP, period.
    i
    • 2
    • 4
  • k

    katz

    11/14/2017, 10:48 AM
    Will u [jb] add smth like #define from c++ - it whould be very useful feature (sometime typealias is just not enough)
    n
    o
    • 3
    • 2
  • m

    mauri

    11/14/2017, 12:02 PM
    Auto answering myself for being dumb, if you set androidExtensions.experimental = true doesnt enable kotlinx.android.parcel, but if you do androidExtensions { experimental = true } it does
    i
    y
    • 3
    • 3
  • e

    elect

    11/14/2017, 4:17 PM
    I am passing a reference to a primitive
    val i = 0
    as
    ::i
    (type
    KMutableProperty0<Int>
    ) and everything worked fine so far. Is it possible to pass the reference of the i-th element of a primitive array?
  • f

    Fré Dumazy

    11/14/2017, 4:19 PM
    okay, I overlooked something important, I'm using coroutines in the method. So
    synchronized
    worked as it should. But can I use it in
    async(UI) { }
    or make sure this block isn't executed in parallel
    k
    • 2
    • 2
  • c

    Codecriticon

    11/14/2017, 4:22 PM
    Is there any microservice framework, other than Spring? And for reactive programming?
    f
    c
    +3
    • 6
    • 6
  • k

    karelpeeters

    11/14/2017, 4:23 PM
    @elect
    val b
        get() = array[5]
        set(value) { array[5] = value }
    and then use
    ::b
    e
    • 2
    • 30
  • s

    silas.schwarz

    11/14/2017, 5:56 PM
    as mentioned i was trying to build a instance local property with a once evaluated and then cached value
    r
    • 2
    • 1
Powered by Linen
Title
s

silas.schwarz

11/14/2017, 5:56 PM
as mentioned i was trying to build a instance local property with a once evaluated and then cached value
r

Ruckus

11/14/2017, 6:06 PM
I'm not sure I understand the reasoning for this. Why not just store the value in a local property?
View count: 2