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-142

make parentheses optional in if, for and while statements

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Wish Wish
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Won't Fix
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: parser
  • Labels:
    None
  • Environment:
    all

Description

Parentheses are optional in method calls.
It would be nice if they were also optional in other places such as if, for and while statements ... perhaps even in method declarations.

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

  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
james strachan added a comment - 22/Jan/04 3:02 AM

I don't think we can make them optional. Or at least there will be times when we can't.

e.g.

if x > foo {

that could be a call to a closure method foo() passing in the closure as a parameter. Or it could be an if statement.

I guess we could say that the if/while/for syntax takes precedence over the closure calling syntax sugar.

So if you want to do an if then

if x > foo { ... }

to use closure calling syntax

if (x > foo { whatever }) { ... }

Show
james strachan added a comment - 22/Jan/04 3:02 AM I don't think we can make them optional. Or at least there will be times when we can't. e.g. if x > foo { that could be a call to a closure method foo() passing in the closure as a parameter. Or it could be an if statement. I guess we could say that the if/while/for syntax takes precedence over the closure calling syntax sugar. So if you want to do an if then if x > foo { ... } to use closure calling syntax if (x > foo { whatever }) { ... }

People

  • Assignee:
    Hein Meling
    Reporter:
    R. Mark Volkmann
Vote (0)
Watch (0)

Dates

  • Created:
    21/Jan/04 3:33 PM
    Updated:
    02/Nov/07 5:06 AM
    Resolved:
    02/Nov/07 5:06 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.