Details
-
Type:
New Feature
-
Status:
Closed
-
Priority:
Minor
-
Resolution: Won't Fix
-
Affects Version/s: None
-
Fix Version/s: 1.1-beta-2
-
Component/s: lexer
-
Labels:None
-
Number of attachments :
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"]
Issue Links
- is depended upon by
-
GROOVY-762
implement syntax improvements
-
Hmm, I'm not so sure about this now.