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

name parameter arguments in method calls and ctors

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Improvement Improvement
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Won't Fix
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: class generator
  • Labels:
    None

Description

support named parameter arguments such as

foo(a:1234, b:542)

Uses NamedArgumentListExpression which is-a MapExpression.

Right now we implement the above to match a method

foo(Map map)
foo(Object object)

though we should also allow it to invoke any Java method (or at least any groovy method). Though we need metadata of the names of the parameters to be able to do this.

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
bob mcwhirter added a comment - 08/Oct/03 12:46 PM

Punting the rest of this bug to the backend. Still may have to change front-end to use a Tuple of MapEntryExpressions and Expressions, instead of a MapExpression/NamedArgumentListExpression.

Show
bob mcwhirter added a comment - 08/Oct/03 12:46 PM Punting the rest of this bug to the backend. Still may have to change front-end to use a Tuple of MapEntryExpressions and Expressions, instead of a MapExpression/NamedArgumentListExpression.
Hide
Permalink
james strachan added a comment - 31/Jan/04 6:38 AM

We support this for

  • calling a method which takes a Map of parameters
  • creating a bean and setting properties

We don't yet support arbitrary invocation of any method using this mechanism

Show
james strachan added a comment - 31/Jan/04 6:38 AM We support this for
  • calling a method which takes a Map of parameters
  • creating a bean and setting properties
We don't yet support arbitrary invocation of any method using this mechanism
Hide
Permalink
Guillaume Laforge added a comment - 02/Nov/07 4:33 AM

Named arguments are supported in method calls, constructor calls.
However, we can really use positional parameters for non map-based methods since there's nothing in the JVM/JDK to let us do that.

Show
Guillaume Laforge added a comment - 02/Nov/07 4:33 AM Named arguments are supported in method calls, constructor calls. However, we can really use positional parameters for non map-based methods since there's nothing in the JVM/JDK to let us do that.

People

  • Assignee:
    Unassigned
    Reporter:
    bob mcwhirter
Vote (2)
Watch (0)

Dates

  • Created:
    25/Sep/03 5:45 PM
    Updated:
    02/Nov/07 4:33 AM
    Resolved:
    02/Nov/07 4:33 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.