- time
- streams
- try-with-resources
- Function expansion, to the types, classes or interfaces new method
- null safe
- It does not require new, type declaration suffixes
- There getters and setters automatically converted comprehensive property types, such as automatically replace getDay () for the day, looks like a field, but in fact the concept of integration of property-getter and setter
- Function expression lambdas, it: a single parameter name implicit
- Higher-order function, the function when the function returns a function or parameter of formula
- Extended function expression = function expressions Spread Function + + higher order functions
fun SQLiteDatabase.inTransaction(func: (SQLiteDatabase) -> Unit) {
beginTransaction()
try {
func(this)
setTransactionSuccessful()
} finally {
endTransaction()
}
}
db.inTransaction {
it.db.delete("users", "first_name = ?", arrayOf("Jake"))
}
- in-line function
- Anko Definitions UI