Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.0-JSR-3
-
None
Description
Currently (as of jsr-03), we can call method with quoted identifiers:
obj."baz:foo-bar"()
This is particularly handy for builders to output / create any node we want without having to comply to Java's identifier naming rules.
However, we can't (yet) call
"baz:foo-bar"()
without prefixing the method by this (if we're inside the class), or with the object prefix (when outside).
Moreover, we should also be able to use GStrings for those quoted method names, so that:
def methodName = "someMethod"
assert "$methodName"(1, 2, 3) == someMethod(1, 2, 3)