DEV Community

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

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

There are value-lists and tuples, which are treated very similarly:

value_list = (a, b, c)
tuple = [a, b, c]

Typically you see value-lists in function calls:

pine(a,b,c)

If tuples go comma-less, then this will apply to value-lists as well. But I'm only suggesting this for multi-line lists now, not inline.

pine(
   a
   b
   c
)

That would be equivalent to pine(a,b,c)

There is a possibility to support comma-less inline notation, such as [a b c] or pine( a b c ). I'm reluctant to do this now as it may artificially restrict the syntax too early in the design, and it creates a lot of ambiguities which may not be worth it.