Details
-
New Feature
-
Status: Closed
-
Minor
-
Resolution: Won't Fix
-
None
-
None
Description
Rather than having a special RangeExpression 0..5 we could just make .. an operator.
Then the .. operator on numbers could create a range and we can use this operator to do a 'traverse' on other objects. E.g. we can use .. to be like // in XPath.
e.g.
node = builder.foo() {
bar()
}
node..x
would yield [ x("a"), x("b") ]
We could also use .. to invoke methods on collections of objects too.
node..x..name() would yield ["a", "b"]
Attachments
Issue Links
- is depended upon by
-
GROOVY-762 implement syntax improvements
- Closed