Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Fixed
-
3.1
-
None
Description
While it is syntaxically possible to use range subexpression for accessing array properties
x = stringbuilder("qwerty"); x[0..2]
It is not allowed now to use range subexpression for setting array properties, for example the following code
x = stringbuilder("qwerty"); x[0..2] = "qq";
throws a parsing exception org.apache.commons.jexl3.JexlException$Assignment: "qq"@1:40 assignment error near '... qwerty"); x[0..2] = "qq"; x ...'
Nevertheless the following code parses and executes as expected
y = 0..2; x = stringbuilder("qwerty"); x[y] = "qq"; x
It would be more convenient to have inline range subexpressions allowed for accessing arrays for both getting and setting