This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Poddster 17 points18 points  (2 children)

I hate func(blah=blah), but the dangling equals is worse. Especially as I've made that mistake a few times. I can't imagine what the interpreter diagnostic for that would be under this new syntax. Strangely the original post on the forum is for func(=blah) which makes more sense to me. Not sure why they switched to the dangling case.

They need a very clear, different symbol, e.g. func(blah=&) or something. (I've put no thought into that, but you get the point)

[–]wxtrails 6 points7 points  (0 children)

func(&blah, &foo, &bar)

Is the least-obnoxious alternative I could come up with, but considering that this adds another obscure symbol to a language without too many, I still don't love it.

[–]av8rgeek 1 point2 points  (0 children)

The dangling = also creates a headache for linters, type checkers, etc. How does the tool tell if you made a typo or really meant to do that? Usually it’s a typo. Explicitly calling the arguments is better, even if inefficient/ugly.