You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Henri Biestro (Jira)" <ji...@apache.org> on 2024/01/23 10:53:00 UTC

[jira] (JEXL-398) Allow 'trailing commas' or ellipsis while defining array, map and set literals

    [ https://issues.apache.org/jira/browse/JEXL-398 ]


    Henri Biestro deleted comment on JEXL-398:
    ------------------------------------

was (Author: garydgregory):
The build is red.

> Allow 'trailing commas' or ellipsis while defining array, map and set literals
> ------------------------------------------------------------------------------
>
>                 Key: JEXL-398
>                 URL: https://issues.apache.org/jira/browse/JEXL-398
>             Project: Commons JEXL
>          Issue Type: New Feature
>    Affects Versions: 3.3
>            Reporter: Xu Pengcheng
>            Assignee: Henri Biestro
>            Priority: Minor
>             Fix For: 3.3.1
>
>
> Allowing trailing commas in structured literals (array, set, map) as a convenient syntactic leniency. :)
> {code:java}
> let m = { "foo": 1, "bar": 2, };
> let a = [ 1, 2, ];
> let s = (1, 2, );{code}
> Using a trailing ellipsis (...) to alter the concrete class materialized as a convenient semantic shortcut.
> {code:java}
> let m = { "foo": 1, "bar": 2, ... }; // LinkedHashMap
> let a = [ 1, 2, ...]; // ArrayList
> let s = (1, 2, ...); // LinkedHashSet{code}
>  



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