01
Language Basics
Kotlin's place on the JVM and its design goals, mutable and immutable declarations, basic types, string templates, control flow with the when expression and loops, functions with default and named parameters, lambdas and higher-order functions, and scope functions.
- 01 Kotlin's Place Introduces Kotlin's place on the JVM and its design goals; measures how the same `==` operator gives equality under four different criteria across eight values.
- 02 Variables Introduces declaration with `val` and `var`, type inference, and the `const val` constant; measures that the same string constant is a single object in two variables.
- 03 Basic Types Introduces the number types, the character, and the logical value; measures that the criterion of equality changes once a nullable `Int` is boxed.
- 04 String Templates Introduces string templates, raw strings, and the `trimIndent` function; measures that a string built with a template falls under the content criterion, while a single-variable template stays a singleton.
- 05 Control Flow Introduces the `if` and `when` expressions, the `is` check, and the `for` loop; measures that a `when` branch matches with `==` and does not hit for an ordinary class instance.
- 06 Functions Introduces parameters with default values, named arguments, and the `vararg` parameter; measures that a function reference gives a separate but equal object each time it is taken.
- 07 Lambdas and Higher-Order Functions Introduces lambda syntax, function types, and functions that take functions; measures that two lambda expressions are not equal, while a lambda that captures nothing is a single object.
- 08 Scope Functions Introduces the scope functions `let`, `run`, `with`, `apply`, and `also`; measures whether the receiver is `this` or `it` and what each returns, and shows that the result does not change the equality criterion.