pre-RFC: Leading commas

The leading commas thing is common in MS SQL. When it auto-generates SQL queries etc (in SSMS - SQL Server Management Studio etc), it, by default, uses the leading comma convention. So, there is at least some small amount of prior art. Also, as the OP mentioned, it is common in Haskell to use the leading comma convention, so, I’m not so sure the “No prior art” argument is as absolute as implied.

That being said, as I previously mentioned, I’m not particularly a fan of the leading comma convention and would be happier if it were not supported in Rust, but, I can think of no good reason (beyond personal preference) not to support it.

@repax I think your points are well argued and made :+1: . They are I think sufficient for me to say: “OK, let’s not do this” even tho I would prefer to use the syntax personally.

I would like to thank all of you for the time you spent discussing this with me. :heart:


Independent of the pros and cons of leading commas (which I do think make good pseudo-bullets), one of your examples in the pre-RFC (first post of this thread) is incorrect. You wrote

let (, a, b, c): (, usize, usize, usize) =
    , 42
    , 1337
    , 42
// equivalent to:
let (a, b, c): (usize, usize, usize) = (1, 2, 3);

I believe most readers would think it equivalent to

let (a, b, c): (usize, usize, usize) = (42, 1337, 42);

Oops :wink:

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.