jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • groovy
  • GROOVY-301

consider adding neater syntax for getters/setters maybe using closure-like syntax

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Wish Wish
  • Status: Closed Closed
  • Priority: Major 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

Task - A task that needs to be done. GROOVY-762 implement syntax improvements

  • Major - Major loss of function.
  • Closed - The issue is considered finished, the resolution is correct. Issues which are not closed can be reopened.

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
Bart van der Werf added a comment - 13/May/04 10:16 AM

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.

Show
Bart van der Werf added a comment - 13/May/04 10:16 AM 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.
Hide
Permalink
Paul King added a comment - 03/Mar/07 4:16 AM

Seems to be superseded by current property syntax and features.

Show
Paul King added a comment - 03/Mar/07 4:16 AM Seems to be superseded by current property syntax and features.

People

  • Assignee:
    Unassigned
    Reporter:
    james strachan
Vote (2)
Watch (0)

Dates

  • Created:
    19/Mar/04 7:52 AM
    Updated:
    03/Mar/07 4:16 AM
    Resolved:
    03/Mar/07 4:16 AM
  • Atlassian JIRA (v5.0.4#731-sha1:3aa7374)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.