https://kotlinlang.org logo
Title
q

quiro

05/18/2017, 7:38 AM
I feel like if you need an else case for
let
then you don't need
let
at all, what you want is really the classic if-else
a

audhil

05/18/2017, 7:40 AM
quiro: I hate to write if else. 🙂
q

quiro

05/18/2017, 7:42 AM
@audhil can you write the snippet of code you'd want to replace with
let
? Maybe there's a better way
a

audhil

05/18/2017, 7:44 AM
var session: String? = null
        session?.let {
            //  do something
        }
        else{
            //  do something other
        }
q

quiro

05/18/2017, 7:48 AM
yes, probably you just need an if-else. Anything else would make it just more unreadable to me
a

audhil

05/18/2017, 7:49 AM
ok, thanks @quiro