Hacker News new | ask | show | jobs
by smichel17 2014 days ago
Kotlin:

    function parseFile(file: File?) {
        val file = file ?: throw Exception("File must exist")
    }
(Not the only way to do it, but in general I really like the language's economics).
1 comments

I'm pretty sure a function declaration in Kotlin is fun, not function.
Yes, you're right. I copy-pasted from the previous example on my phone and missed that change.
Happens to everyone.

You have a nice day.