llkaelegant.blogg.se

Any in kotlin
Any in kotlin












any in kotlin

kt file comprises the following, in order: Good: use escapes for non-printable characters, and comment if necessary.Ī. Poor: the reader has no idea what this is. Poor: there’s no reason to use an escape with a printable character. Exampleīest: perfectly clear even without a comment. Unicode escapes are discouraged for printable characters at any location andĪre strongly discouraged outside of string literals and comments. The choice depends only on which makes the code (e.g., ∞) or the equivalent Unicode escape (e.g., \u221e) is used. Non-ASCII charactersįor the remaining non-ASCII characters, either the actual Unicode character That sequence is used rather than the corresponding Unicode

any in kotlin

Tab characters are not used for indentation.įor any character that has a special escape sequence.All other whitespace characters in string and character literals are escaped.Is the only whitespace character that appears anywhere in a source file. That describes the contents of the file, apply PascalCase, and appendįun Set.map(func: (T) -> O): List = // …įun List.map(func: (T) -> O): List = // …Īside from the line terminator sequence, the If a source file contains multiple top-level declarations, choose a name Should reflect the case-sensitive name plus the. If a source file contains only a single top-level class, the file name However, this document focuses primarily on the hard-and-fast rules that we follow universally, and avoids giving advice that isn’t clearly enforceable (whether by human or tool).Īll source files must be encoded as UTF-8. Like other programming style guides, the issues covered span not only aesthetic issues of formatting, but other types of conventions or coding standards as well. A Kotlin source file is described as being in Google Android Style if and only if it adheres to the rules herein. This document serves as the complete definition of Google’s Android coding standards for source code in the Kotlin Programming Language.














Any in kotlin