Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-371

support mixed named parameters and regular parameters

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.0
    • None
    • None

    Description

      Right now we only support regular method passing...

      method(expr, expr, expr)

      or 'named parameters'

      method(symbol:expr, symbol:expr)

      we should maybe support mixed...

      method(expr, symbol:expr, symbol:expr, expr, expr)

      then we could, say, have a method like this

      foo(String a, Integer y, Map namedArgs, Object[] vargs)

      { ... }

      and could call it via

      foo("hey", 123, a:123, b:456, c:"whatnot", 4, 5, 6, 7)

      where

      a == "hey"
      y == 123
      namedArgs == ['a':123, 'b':456, 'c':'whatnot']
      vargs == new Object[]

      { 4, 5, 6, 7 }

      Attachments

        Activity

          People

            guillaume Guillaume Sauthier
            jstrachan James Strachan
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: