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

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

    [ https://issues.apache.org/jira/browse/GROOVY-11964?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18077615#comment-18077615 ] 

ASF GitHub Bot commented on GROOVY-11964:
-----------------------------------------

paulk-asert merged PR #2489:
URL: https://github.com/apache/groovy/pull/2489




> Additional multi-assignment forms
> ---------------------------------
>
>                 Key: GROOVY-11964
>                 URL: https://issues.apache.org/jira/browse/GROOVY-11964
>             Project: Groovy
>          Issue Type: Improvement
>            Reporter: 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)