a = 1, 2, 3
Currently a
is [1, 2, 3]
now. I propose to change it so that it becomes {1, 2, 3}
, that is instead of defining an implicit array, define an implicit tuple. I think that fits better into where we're going with Tuple
and Array
and the language in general. The proposal so far is about consistency, hence I didn't yet research motivating real-world usecases this would improve or break.
I thought about this too a couple of times, but we also have another option: give a syntax error in that case. I think writing
a = {1, 2, 3}
is much more explicit. Maybe in writing a = 1, 2
I forgot to mention the second variable and then I'll get an error because a tuple type will be created instead.
So, which one should we do? I vote for removing this "feature" and giving a syntax error.
I don't feel too strong about having it either, so either way is fine for me.
+1 for syntax error
I was about to fix this but it was already giving an error as discussed above.
It seems it was fixed in #4824 鉂わ笍
Most helpful comment
I thought about this too a couple of times, but we also have another option: give a syntax error in that case. I think writing
is much more explicit. Maybe in writing
a = 1, 2
I forgot to mention the second variable and then I'll get an error because a tuple type will be created instead.So, which one should we do? I vote for removing this "feature" and giving a syntax error.