Paul King created GROOVY-10728:
----------------------------------

             Summary: Slight enhancement to groovy-dateutil extensions
                 Key: GROOVY-10728
                 URL: https://issues.apache.org/jira/browse/GROOVY-10728
             Project: Groovy
          Issue Type: New Feature
            Reporter: Paul King
            Assignee: Paul King


For Calendar and Date, we allow getAt access using the Calendar static 
constants like YEAR, MONTH, etc.

This gives us multi-assignment for free, e.g.:
{code}
(_E, Y, M, _WY, _WM, D) = Calendar.instance
{code}
Here we might be interested in just the YEAR, MONTH and DATE/DAY_OF_MONTH. We 
can use some dummy variables to capture those as above.

But it might also be nice to support (like we do for lists for instance) 
collections of indices:
{code}
(Y, M, D) = Calendar.instance[YEAR, MONTH, DATE]
{code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to