Details
-
Sub-task
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
Description
Usual command expressions (ie. one method and its arguments) cannot disambiguate something like:
println -1 // println( -1 ) ??? println [1] // println( [1] ) ???
As they could be interpreted also as:
variable - 1 // a substraction variable[1] // a subscript access
However, in the case of extended command expressions, we could find out:
counting 0..10 above -1 gives 11 counting -1..1 above 0 gives 1
Other examples with curly braces and square brackets:
given {} when {} then {}
pick { it % 2 == 0 } from [1, 2, 3, 4, 5, 6] into [] // put the even numbers from a list into another one