简体   繁体   中英

groovy quoted function identifiers

Groovy allows a quoted function identifier such as

def "my cool method"()
{
    "foo"
}

but I can't find this in the specification. Is it a groovy feature or maybe some lib relies on quotes being used in identifiers? Or is it an omission in the official doc?

It is an integral part of Groovy to be able to do this. If it is missing in the documentation, then it is a documentation bug at most. Basically the same as written at http://groovy-lang.org/syntax.html#_quoted_identifiers is also valid for function names.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM