发布于 2015-10-01 23:28:02 | 88 次阅读 | 评论: 0 | 来源: 网友投递

这里有新鲜出炉的精品教程,程序狗速度看过来!

Kotlin 基于JVM的编程语言

Kotlin 是一个基于 JVM 的新的编程语言,由 JetBrains 开发。


Kotlin M14 发布,此版本主要改进如下:

  • 支持文件类注解

  • 标准库新增 Java API

  • 操作符新增 operator modifier

  • 可以通过合成 field 变量访问 Backing fields

语言改进

  • Backing fields

  • Operators

  • Compile-time constants

  • Annotate file classes

  • 其他语言改进

    • private on the top level is now private to file

    • internal is checked in the compiler (not only IDE)

    • private in interfaces is truly private now

    • equals in data classes compares arrays by calling their .equals() method (which works by identity)

    • lateinit val‘s are prohibited

    • many cases of inheritance and other degrees of freedom are prohibited for data classed (see this blog post)

    • protected and internal members are prohibited in interfaces

    • _, __, ___ are forbidden as in identifiers, i.e. we can use _foo, but not _ alone (reserved for future use)

    • identityEquals() function is deprecated in favor of ===

标准库改进

  • ArraysKt — operations on arrays, extensions for arrays, array factory methods

  • CharsKt — extensions for Char and Char.Companion, most of them should be hidden

  • CollectionsKt — operations on iterables, collections and lists, list factory methods

  • ComparisonsKt — operations on comparators, comparator factory methods, and functions for performing comparisons

IDE 改进

As usual, the IDE helps you migrate seamlessly from M13 via Code cleanup. Also there are several new handy features in M14:

  • As mentioned above, there in some cases we need private backing properties. You can easily introduce them via intention action:

  • Also you can move property initialization from constructor body or initializer block to property declaration:

  • One of the long-expected features is completion for overriding functions and properties:

  • Since M13 the IDE optimizes imports on the fly. Add unambiguous imports on the fly feature is also supported now. Give it a try:

安装

IntelliJ IDEA 15 Public Preview 包含 Kotlin M14 绑定。

更多内容请看发行说明

Kotlin 是一个基于 JVM 的新的编程语言,由 JetBrains 开发。

其主要设计目标:

  • 创建一种兼容Java的语言

  • 让它比Java更安全,能够静态检测常见的陷阱。如:引用空指针

  • 让 它比Java更简洁,通过支持variable type inference,higher-order functions (closures),extension functions,mixins and first-class delegation等实现。

  • 让它比最成熟的竞争对手Scala语言更加简单。



历史版本 :
Kotlin 1.2.21 发布,Bug 修复版本
Kotlin 1.2.20 发布:添加对 Gradle 构建缓存的支持
Kotlin/Native 0.5 支持在Swift, C和LLVM 5中使用 Kotlin
Kotlin 1.2 发布,实现平台间共享代码
Kotlin 1.1.60 发布,开始支持增量编译
Kotlin 1.2 Beta2 发布:显著提升编译器性能
Kotlin 1.2 Beta 版发布,基于 JVM 的编程语言
Kotlin 1.1.50 发布,基于 JVM 的编程语言
Kotlin 1.1.4 发布,改进对 Java 9 的支持
Kotlin 1.2 M2 发布,1.2 系列的早期访问版
Kotlin 1.2-M1 发布,1.2 系列的早期访问版
Kotlin 1.1.3 发布,初始支持 JDK 9
最新网友评论  共有(0)条评论 发布评论 返回顶部

Copyright © 2007-2017 PHPERZ.COM All Rights Reserved   冀ICP备14009818号  版权声明  广告服务