DEV Community

Discussion on: Help design a language: What about tuples without commas?

Collapse
 
17cupsofcoffee profile image
Joe Clay

Happy to see my post sparked some more discussion :)

I'm not particularly fussy about having commas or not, as long as it's not too ambiguous where the expression ends (which, going by your other comments, doesn't seem to be much of a problem in Leaf).

If you do have commas, though, allowing a trailing comma after the last item is a must for me. Otherwise, you end up having to change the last line whenever you want to add more items, which makes the diff messier than it needs to be. It's a small thing, but it bugs me when languages don't let you do it!

Collapse
 
mortoray profile image
edA‑qa mort‑ora‑y

Definitely, a trailing comma is allowed. Probably the first thing the parser did! :)

var items = [
  a,
  b,
  c,
]

It's much diff friendlier, keeping those git PRs from touching lines they don't actually modify.