3 ms·
I don't want to write nt(a=1, b=2). That's ugly. I want to write (a=1, b=2). Being able to implement it without changing the syntax is irrelevant to the users
by alphaalpha101 9y ago
I don't want to write nt(a=1, b=2). That's ugly. I want to write (a=1, b=2).
Being able to implement it without changing the syntax is irrelevant to the users of the language, mostly. It's an implementation concern. I've always felt that being a little harder to implement isn't a point against a feature, if it's good for users, because even a small improvement for users is usually much less effort in total than even a large implementation effort.
- joejev 9y agoMore syntax makes a language harder to read. The point isn't that making this special syntax would be harder, because it's not that hard. The point is that you don't need new syntax. In this case, the new syntax saves a few characters at best. I'm also don't think this syntax is any easier to read than a function call; I actually think it looks so similar that it would be easy to confuse with a function call making the language harder to read.
- alphaalpha101 9y agoBetter get rid of [1, 2, 3] then, because you can just use list(1, 2, 3). And they should get rid of {'a': 1, 'b': 2} as well, because you can use dict(list(tuple(str(65), 1), tuple(str(66), 2))) right? I think it's a bit of a stretch to say it's easy to confuse with a function call, given that tuples already exist. I don't see how (a=0, b=2) would be confusable with a function call anyway, no more than (0, 2) is.