基于 JVM 的编程语言,Kotlin 1.0 Beta 3 发布
Kotlin 是一个基于 JVM 的新的编程语言,由 JetBrains 开发。
其主要设计目标:
-
创建一种兼容Java的语言
-
让它比Java更安全,能够静态检测常见的陷阱。如:引用空指针
-
让 它比Java更简洁,通过支持variable type inference,higher-order functions (closures),extension functions,mixins and first-class delegation等实现。
-
让它比最成熟的竞争对手Scala语言更加简单。
改进列表:
-
Library
-
incrementdeprecated in Progressions in favor ofstepproperty to Progressions,for-loops updated to refer tostep -
contains()and other similar extensions now accept supertypes of the element of the collection -
Delegates.mapValandmapVar,MapVal,MapVar,FixedMapVal,FixedMapVarare deprecated -
String.toCharArray()introduced instead ofString.getChars();String.toCharList()deprecated -
MutableCollection.removeAll(predicate: (T) -> Boolean)and similar forretainAlladded -
sequence(initialValueFunction, nextValueFunction)doesn't evaluate first value until it's requested by sequence iterator -
sequenceOf(Progression)deprecated -
flattenoperation forSequence<Iterable<...>>added -
Langauge
-
No references to
PropertyMetadataare generated in the byte code -
Suffixes to numeric literals, such as
1bazare prohibited -
Comma-separated conditions in
whenwithout an argument are prohibited (KT-5143) -
Annotation classes can't be instantiated (KT-4391)
-
Arrays of annotations supported as annotation arguments (KT-10136)
-
Generic types in catch clauses (including reified T) are prohibited (KT-9816)
-
protectedmembers are allowed in companion objects -
Calls to non-
@JvmStaticprotectedmembers of companion objects from subclasses are marked as errors (unsupported) -
"
…" is reserved as a token (KT-9708) -
Enum entry can not be used as a type (KT-5401)
-
Enum.valuesis deprecated in favor ofEnum.values() -
privatesetters are now deprecated foropenproperties -
Local
sealedclasses are deprecated -
Use of uninitialized variables in lambdas / object literals / local functions is forbidden
-
Overriding setter cannot weaken visibility
-
Inner classes are no longer allowed inside enum entries
-
Implicit receiver smart casts are supported
-
Older deprecations have become errors
下载:
kotlin-compiler-1.0.0-beta-3595.zip
来自:http://www.oschina.net/news/68768/kotlin-1-0-beta-3