You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Paul King (Jira)" <ji...@apache.org> on 2026/05/01 10:40:00 UTC

[jira] [Assigned] (GROOVY-11964) Additional multi-assignment forms

     [ https://issues.apache.org/jira/browse/GROOVY-11964?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Paul King reassigned GROOVY-11964:
----------------------------------

    Assignee: Paul King

> Additional multi-assignment forms
> ---------------------------------
>
>                 Key: GROOVY-11964
>                 URL: https://issues.apache.org/jira/browse/GROOVY-11964
>             Project: Groovy
>          Issue Type: Improvement
>            Reporter: Paul King
>            Assignee: Paul King
>            Priority: Major
>
> Three idioms are common in modern languages but unavailable in Groovy:
> * Tail rest binding: {{def (h, *t) = list}} - separate the head from the remainder. Common in functional code (recursive list traversal, pipeline-style processing of streams and iterators).
> * Map-style destructuring: {{def (name: n, age: a) = person}} - extract named properties or map keys directly, without intermediate variables.
> * Rest in non-tail positions: {{def (*f, last) = list, def (l, *m, r) = list}} - useful when the boundaries are at the ends rather than the middle.



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