开发者

First class functions to solve disambiguous call

开发者 https://www.devze.com 2023-04-12 19:17 出处:网络
Relating to this question: Why can't a class have same name for a function and a data member? I\'m curious if having first class functions would solve this?

Relating to this question:

Why can't a class have same name for a function and a data member?

I'm curious if having first class functions would solve this?

My guess is, like anything开发者_C百科 else in the Universe, simply "It depends because it is not that simple."


I believe it is solvable but then the question is to what end? What would you achieve out of this except some really hard to find bugs!!! The cost benefit is definitely there but it's not the only driving force to not implement this functionality. The language must have as few quirks as possible and for a language where data and behavior are clearly delineated this should not be allowed. So, there's my two cents.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号