top | item 43014588

(no title)

Willamin | 1 year ago

Genuinely, I'd love to see this approach be taken: allow for a set of characters to be used as list delimiters. I personally like the set to be comma, semicolon, and newline, but of course this set would need to be varied depending on other syntax (e.g. in SQL, we wouldn't want semicolon to be used for this).

Having newline be a valid list separator is particularly nice because it solves the "trailing comma" and "comma-first" style workarounds in a visually elegant way. The newline already provides a visual separator; we can already tell that we're at the end of most lists by way of having another keyword appear next without needing to rely on a lack of commas, for example:

    select
        id
        name
        email
    from users

discuss

order

No comments yet.