Trailing comma in variable declaration

Ky-Anh Huynh saigon at example.net
Tue Jul 31 06:52:23 UTC 2018


On Sunday, 29 July 2018 at 14:47:59 UTC, PaperBoy wrote:
>> As trailing comma is possible (and it's great) for arrays, 
>> enum,... I wonder why we don't have this fancy thing for 
>> variables declaration.
>>
>> Thanks for your reading.
>
> This is the syntax sometimes seen with language that don't have 
> trailling comma at all.
>
> bool
>        verbose = false
>      , download_only = false
>      , no_confirm = false
>      , show_help = false
>      , show_version = false
>      , list_ops = false
>      ;

This is smart:) It's not very natural I think; in English, comma 
and punctuation would be closed to the last character (e.g., the 
dot in this sentence.)


More information about the Digitalmars-d mailing list