4 ms·
Why even have commas at all? This is a non-issue for the likes of Tcl and Lisp and your average shell-scripting language and what have you; whitespace is alrea
by yellowapple 2y ago
Why even have commas at all? This is a non-issue for the likes of Tcl and Lisp and your average shell-scripting language and what have you; whitespace is already a good enough delimiter.
- Willamin 2y agoGenuinely, 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
- eftpotrm 2y agoBecause there's existing implementations that would interpret that as aliasing column names. ``` SELECT Field AS Renamed, OtherField AS AlsoRenamed ``` and ``` SELECT Field Renamed, OtherField AlsoRenamed ``` are semantically equivalent.
- yellowapple 2y agoMaking AS mandatory for naming columns would be an improvement in and of itself.
- eftpotrm 2y agoYes, but it's also a breaking change to a very large legacy codebase. I can't see it ever happening, sadly.
- nerdponx 2y agoBecause in SQL whitespace is already used for all manner of special syntax. That said, generating SQL from s-expressions can be a very pleasant experience.