4 ms·
const is already a keyword - it denotes compile-time constants (basically primitive types). val is constant in runtime, but it can still be computed on the fly;
by V-2 4y ago
const is already a keyword - it denotes compile-time constants (basically primitive types). val is constant in runtime, but it can still be computed on the fly; just assigned only once.
mut is a nice proposition, I'd certainly consider it if I were to design Kotlin
- R0b0t1 4y agoInteresting. Why not simply overload the meaning of const based on rvalue?