咨询服务热线:
联系我们
服务热线
邮箱:12345678@qq.com
传真:
注册地址:陕西省榆林市榆阳区长乐路58号
办公地址:
当前位置:当前位置: 首页 >

大部分语言都用尖括号<>表示泛型,为什么golang要标新立异用中括号?
浏览: 发布日期:2025-06-20 19:00:16

最新的设计文档里面对这一块做了一个解释。

Why not use the syntax F like C++ and J***a? When parsing code within a function, such as v := F, at the point of seeing the < it's ambiguous whether we are seeing a type instantiation or an expression using the < operator. This is very difficult to resolve without type information. For example, consider a statement like a, b = w < x, y > (z) Withou…。

大部分语言都用尖括号<>表示泛型,为什么golang要标新立异用中括号?

版权@|备案:皖-ICP备81952495号-1|网站地图
联系电话:邮箱:12345678@qq.com 传真:
注册地址:陕西省榆林市榆阳区长乐路58号
地址:
备案号:
技术支持:百度
长安园林有限责任公司从事陕西别墅绿化、陕西景观设计、陕西屋顶绿化的业务,欢迎前来咨询!