Kotlin language specification
Version 1.9-rfc+0.1Kotlin language specification Version 1.9-rfc+0.1 Marat Akhin Mikhail Belyaev ## Contents I Kotlin/Core 1 Introduction 3 Compatibility 4 Experimental features 4 Acknowledgments 4 Glossary 43 Introduction 44 2.1 Type kinds 45 2.1.1 Built-in types 46 kotlin.Any 46 kotlin.Nothing 46 kotlin.Function 46 Built-in integer types 46 Array types 46 2.1.2 Classifier types 77 3 Built-in types and their semantics ..... 79 3.1 kotlin.Any ..... 79 3.2 kotlin.Nothing ..... 80 3.3 kotlin.Unit ..... 80 3.4 kotlin.Boolean ..... 80 3.5 Built-in integer types ..... 800 码力 | 310 页 | 1.39 MB | 2 年前3
Kotlin language specification
Version 1.9-rfc+0.1Kotlin language specification Version 1.9-rfc+0.1 Marat Akhin Mikhail Belyaev # Chapter 1 # Syntax and grammar ### 1.1 Notation This section uses a BNF-based notation similar to EBNF with single-quotes and monospace font denote a terminal sequence; - Special terminal sequences that need specification are given in angle brackets: <...>; - Normal parentheses are used sparingly to specify ') {Letter | ' _ ' | UnicodeDigit} | ' ' QuotedSymbol {QuotedSymbol} ' ' Kotlin supports escaping identifiers by enclosing any sequence of characters into backtick (`) characters0 码力 | 38 页 | 358.59 KB | 2 年前3
Kotlin 1.4 language features### Kotlin 1.4 Language Features Svetlana Isakova ### Kotlin 1.4 Language Features • SAM conversions for Kotlin classes • Explicit API mode • Trailing comma • Break and continue inside when expressions arguments • New type inference • Unified exception type for null checks ## SAM conversions for Kotlin interfaces ## SAM = Single abstract method interface Action { fun run() } ## SAM conversion runAction(Action action) { action.run(); } Kotlin: runAction { println("I'm Kotlin 1.3") } ## SAM conversion for a Kotlin interface Java: Kotlin: interface Action { fun run() } fun0 码力 | 69 页 | 3.29 MB | 2 年前3
Kotlin 1.2 Language Documentationp1_1.jpg) Kotlin Language Documentation ## Table of Contents Overview ..... 5 Using Kotlin for Server-side Development ..... 5 Using Kotlin for Android Development ..... 7 Kotlin JavaScript Overview Overview ..... 8 Kotlin/Native for Native ..... 9 Coroutines for asynchronous programming and more ..... 11 Multiplatform Programming ..... 12 What's New in Kotlin 1.1 ..... 14 What's What's New in Kotlin 1.2 ..... 23 What's Coming in Kotlin 1.3 ..... 29 Standard library ..... 33 Tooling ..... 35 Getting Started ..... 36 Basic Syntax ..... 36 Idioms ..... 42 Coding Conventions0 码力 | 333 页 | 2.22 MB | 2 年前3
Kotlin Language Documentation 1.3Kotlin Language Documentation ## Table of Contents Overview ..... 7 .Using Kotlin for Server-side Development ..... 7 Using Kotlin for Android Development ..... 9 .Kotlin JavaScript Overview Overview ..... 11 .Kotlin/Native for Native ..... 13 Kotlin for Data Science ..... 15 .Coroutines for asynchronous programming and more ..... 20 Multiplatform Programming ..... 21 What's What's New in Kotlin 1.1 ..... 24 What's New in Kotlin 1.2 ..... 35 What's New in Kotlin 1.3 ..... 44 Standard library ..... 50 Tooling ..... 52 Getting Started ..... 530 码力 | 597 页 | 3.61 MB | 2 年前3
Kotlin Language Documentation 1.9.201a/p1_1.jpg) Kotlin Language Documentation 1.9.20 ## Table of Contents Kotlin Docs 61 Get started with Kotlin 61 Install Kotlin 61 Create your powerful application with Kotlin 61 Is anything anything missing? 63 Welcome to our tour of Kotlin! 63 Hello world 63 Variables 64 String templates 64 Practice 65 Next step 65 Basic types 65 Practice 66 Next step 67 Collections 67 List What's next? ..... 90 Kotlin Multiplatform ..... 90 Kotlin Multiplatform use cases ..... 91 Code sharing between platforms ..... 91 Get started ..... 92 Kotlin for server side ..... 920 码力 | 1299 页 | 32.44 MB | 2 年前3
Coroutines in Kotlin## Coroutines in Kotlin Andrey.Breslav@JetBrains.com This talk could have been named... • async/await/yield • fibers Suspendable Computations • [stackless] continuations ## Outline • Motivation/Examples Motivation/Examples • Solutions in other languages • Kotlin's Solution – Client code – Library code • Compiling Coroutines • Exception Handling • Appendix. Serializable Coroutines? ## “Legal” • All I’m Coroutines ||Stackless|Stackful| |---|---|---| |Language restrictions|Use in special contexts 😢|Use anywhere 😢| |Implemented in|C#, Scala, Kotlin, ...|Quasar, Javaflow, ...| |Code transformation|Local0 码力 | 39 页 | 1.01 MB | 2 年前3
A Security Guide for Kotlin Developers## A Security Guide for Kotlin Developers  Overview.....1 Kotlin's Security Profile.....2 Most Common Security Attacks ....3 Top Kotlin Security Risk.....5 OWASP Mobile TOP 10 Mobile Risks.....10 Protect Your Kotlin Programs with Kiuwan.....11 A pragmatic, modern, and statically typed coding language that's essentially essentially a Java alternative, Kotlin offers some key benefits for Java Virtual Machine (JVM) and Android app development while also being interoperable alongside Java. Kotlin language is general purpose and open0 码力 | 13 页 | 1.80 MB | 2 年前3
Kotlin 入门学习笔记整理修饰的静态变量的字符串,是个编译器常量(编译器编译的时候,已经确定并且不可改变的) private static final String LALALA = "lalala"; ## kotlin 中的表示方式 companion object { const val LALALA = "lalala" 3 } ## 定义变量 变量名后“:”跟着他的类型,类型可以省略掉 (lesson : Lesson in lessonList){ 3 } ## 创建对象(直接调用构造器) java: Java = Java() 返回值 java void kotlin Unit ## kotlin 的类型推断 1 // 数据类型 首字母大写 2 var age: Int = 18 3 // 因为类型推断,基本数据类型可以省略 4 var age = 18 ## 修饰符 也是用 class ## 静态内部类 java 中 用 static 修饰;静态内部类可以写静态函数 kotlin 静态内部类是没有关键字修饰; ## 嵌套内部类 不用 static 修饰的话默认的内部类就是嵌套内部类,嵌套内部类可以获取外部类的引用,不可以写静态函数;kotlin 嵌套内部类是有关键字修饰,用 inner 修饰 ## 实现接口 实现接口和继承都是没有关键字,实现接口0 码力 | 8 页 | 5.41 MB | 2 年前3
Hello 算法 1.1.0 Kotlin版FELLO FELLO FELLO FELLO FELLO FELLO >Hello算法 动画图解、一键运行的数据结构与算法教程 靳宇栋 (@krahets) ## Hello 算法 Kotlin 语言版 作者:靳宇栋 (@krahets) 代码审阅:陈东辉 (@curtishd)  // 从底至顶堆化 siftUp(size() - 1) } /* 从节点 i 开始,从底至顶堆化 */ fun siftUp(it: Int) { // Kotlin 的函数参数不可变,因此创建临时变量 var i = it while (true) { // 获取节点 i 的父节点 val p = parent(i) 1) // 从顶至底堆化 siftDown(0) // 返回堆顶元素 return_val /* 从节点 i 开始,从顶至底堆化 */ fun siftDown(it: Int) { // Kotlin 的函数参数不可变,因此创建临时变量 var i = it while (true) { // 判断节点 i, l, r 中值最大的节点,记为 ma0 码力 | 381 页 | 18.47 MB | 2 年前3
共 1000 条
- 1
- 2
- 3
- 4
- 5
- 6
- 100
相关搜索词
Kotlinmultiplatformtype systemsyntaxcompatibilityKotlin language specificationannotationslexicallymultiline stringidentifierSAM转换显式API模式尾随逗号break和continue类型推断Kotlin 1.2数学运算API序列操作集合操作反射改进Kotlin 1.3coroutinesmultiplatform projectsbehavioral-incompatiblesource-incompatibleKotlin/JVMKotlin/NativeKotlin/JSK2编译器兼容性指南async/awaitfiberssuspendable computationscontinuationsSecurity RisksStatic TypeException HandlingOWASP Mobile TOP 10构造函数静态函数数据类型单利模式算法数据结构复杂度分析数据结构分类算法类型













