v0.12.0
Pre-release
Pre-release
·
1194 commits
to aa22da58f76277d6a84a8c038a9450a20e23d4c0
since this release
Updates from 0.11.0.
- Updated
- Supported a numbered parameter of a function argument.
- It is available from
_1to_9, and_1is the first argument. _is also available and it is assigned the variable according to the order of appearance.(&() => _ + _)is same as(&() => _1 + _2)
- It is available from
- Supported a callback block syntax when a callback function is the last argument parameter.
- For example,
f(2, 10) { &(a, b) return a + b; }meansf(2, 10, &(a, b) => { return a + b; }). - For another example, you can pass a block to
.maplike[4, 5, 6].map { => _1 * 2 }. - See this example to check the supported syntax.
- For example,
- Supported the syntax to skip a parameter to ignore assignment like
[a,,c] = [1,2,3]. - Supported the syntax of array assignement with a function argument.
- A function argument example is
function func([a, b]) { /* ... */ }.
- A function argument example is
- Supported the syntax to get the value of an object property like
var {xxx} = { xxx: 100 }.- In this case it assigns
100to the variable ofxxxwhich is same name as a property name. - This syntax can be used only as a declaration or a function argument.
- A function argument example is
function func({ xxx, yyy }) { /* ... */ }.
- In this case it assigns
- Improved
.eachfor Object. The callback will receive[key, value]pair as array.{ x: 100, y: 200, z: 300 }.each { &([key, value]) System.println([key, value]); }; - Some bug fixes and improvement.
- Supported a numbered parameter of a function argument.