You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Eric Milles (JIRA)" <ji...@apache.org> on 2017/11/14 21:43:00 UTC
[jira] [Created] (GROOVY-8381) Other Operators section of Groovy
docs missing get/set dot operator
Eric Milles created GROOVY-8381:
-----------------------------------
Summary: Other Operators section of Groovy docs missing get/set dot operator
Key: GROOVY-8381
URL: https://issues.apache.org/jira/browse/GROOVY-8381
Project: Groovy
Issue Type: Documentation
Components: Documentation
Reporter: Eric Milles
Priority: Minor
Section 1.2.8 (Other Operators: http://docs.groovy-lang.org/latest/html/documentation/#_other_operators) mentions the Call Operator (aka call method). But I do not see mention of the get(name) and set(name,value) methods that lead to a "dot" operator overload as it is mentioned in Groovy in Action.
Example (Call and Dot operator overloads):
{code}
class General {
def call(... args) {
println "Called with args: $args"
}
def get(String name) {
println "Getting property: $name"
}
void set(String name, Object value) {
println "Setting property: $name"
}
}
General g = new General()
g.unknown
g.unknown = ''
g("1", "2")
{code}
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)