Hi - FYI, I went ahead and did the parser changes to support this improvement:
https://github.com/chapel-lang/chapel/pull/4521 This is now on master and also should be in our upcoming release. Cheers, -michael On 9/6/16, 1:55 PM, "Russel Winder" <[email protected]> wrote: >I raised this point elsewhere and it was suggested I bring it here with >a view to there being a change in the Chapel parser. > >Some language treat a trailing comma in a list or tuple literal as not >a problem. Many language, including currently Chapel, treat this as an >error. For many this is a trivial non-issue. For some, people who >construct tables of data for things like tests or application >configuration, it becomes a real irritant. > >As with other language that have tuple literals Chapel requires a >trailing comma in a tuple literal of one element: > >(1,) > >completely understandable, indeed required. However Chapel as many >other language does not allow a trailing literal in any other >situation: so > >(1, 2,) > >would be an error. This is a trivial point in many ways, but leads to >huge irritations. If only this were allowed many hors of pain and >anguish would be averted. Witness Python and other languages that allow >the redundant trailing comma: > >[] >[1], [1,] >[1, 2], [1, 2,] > >() >(1,) >(1, 2), (1, 2,) > >are all legal in language allowing trailing redundant comma. In >languages that do not allow this, literal data manipulation become a >right royal pain in the proverbials. > >Personally I see no reason at all for not allowing this element of >redundancy. I believe the Chapel grammar should be amended to allow >this. > >-- >Russel. >========================================================================== >=== >Dr Russel Winder t: +44 20 7585 2200 voip: >sip:[email protected] >41 Buckmaster Road m: +44 7770 465 077 xmpp: [email protected] >London SW11 1EN, UK w: www.russel.org.uk skype: russel_winder ------------------------------------------------------------------------------ _______________________________________________ Chapel-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/chapel-users
