8.2.6 单表达式函数 8.2.6 单表达式函数 当函数返回单个表达式时,可以省略花括号并且在 = 符号之后指定代码体即可 fun double ( x : Int ): Int = x * 2 当返回值类型可由编译器推断时,显式声明返回类型是可选的: fun double ( x : Int ) = ...
测试多平台应用——教程 Test a simple multiplatform project Create your project Write code Add tests Explore the kotlin.test API Run tests Work with more complex projects Write tests fo...
Learn to Type Learn to Type Learn to touch-type. This is an intermediate skill because writing code is so hard that the speed at which you can type is irrelevant and can’t put ...
to_unsafe to_unsafe If a type defines a to_unsafe method, when passing it to C the value returned by this method will be passed. For example: lib C fun exit ( status : ...
Fibonacci Fibonacci No standard library would be complete without an obligatory definition of the Fibonacci function. Using all of the above things we’ve defined we can write ...
to_unsafe to_unsafe If a type defines a to_unsafe method, when passing it to C the value returned by this method will be passed. For example: lib C fun exit ( status : ...
6.9 Response Content-Type 6.9 Response Content-Type A Micronaut’s controller action produces application/json by default. Nonetheless you can change the Content-Type of the r...