Details
-
Type:
Wish
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: 1.1-beta-1
-
Component/s: None
-
Labels:None
Description
Consider something like
Foo foo {
get { return x }
set { x = it }
}
Issue Links
- is depended upon by
-
GROOVY-762
implement syntax improvements
-
I wrote something similar for the Pluk language.
Syntax is basicly.
<modifiers> <type> <name>
get (<statement>|<expression>)
set (<statement>|<expression>)
get can return via its expression, or if its a statement via return
set has a readonly variable value which holds the value it was passed
set might be defined before get
one of the two should be specified, if no get/set is specified its read/write-only.