Uploaded image for project: 'Commons JEXL'
  1. Commons JEXL
  2. JEXL-398

Allow 'trailing commas' or ellipsis while defining array, map and set literals

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 3.3
    • 3.4.0
    • None

    Description

      Allowing trailing commas in structured literals (array, set, map) as a convenient syntactic leniency.

      let m = { "foo": 1, "bar": 2, };
      let a = [ 1, 2, ];
      let s = (1, 2, );

      Using a trailing ellipsis (...) to alter the concrete class materialized as a convenient semantic shortcut.

      let m = { "foo": 1, "bar": 2, ... }; // LinkedHashMap
      let a = [ 1, 2, ...]; // ArrayList
      let s = (1, 2, ...); // LinkedHashSet

       

      Attachments

        Activity

          People

            henrib Henri Biestro
            xupengcheng Xu Pengcheng
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: