Idea: Simpler method-syntax private helpers

In the interests of prior art, there is (was?) a very similar proposal for C++ that went by the name "unified call syntax": https://isocpp.org/blog/2016/02/a-bit-of-background-for-the-unified-call-proposal As far as I know, this hasn't gone anywhere, but I can't find solid evidence of that or what the reasoning was for not pursuing it.


The first time I read your post I completely missed the self and almost started writing a "no marker at all would be too magical" response. So I think this specific syntax is a little too subtle.

But between special call syntax (or "method cascading" as this thread called it) and implicit fallback to free functions, I'm not sure I have a preference. I suspect both have massive ambiguity landmines associated with them. But more importantly, I need convincing that they would significantly improve enough code that it's worth the added language complexity, even if there were no landmines, so I think we're blocked on some kind of data gathering exercise like this guy did.

Incidentally, can this be done with a macro today? It sure seems like it should be possible.

1 Like