• 程序员都在用什么显示器写代码?
  • 老公想要买2万左右的相机,我该同意吗?
  • 360 集团周鸿袆努力拼了 4  年,最后反而跌了近 4000 亿,其原因是什么?
  • 卸载迅雷后,***文件变成xunlei.bittorrent.6,怎么还原回去啊,心态炸了!?
  • 美国真会下场对伊朗开战吗?

诚信为本,市场在变,诚信永远不变...        

0896-98589990
新闻资讯
您的当前位置: 首页 > 新闻资讯

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

发布时间:2025-06-25 14:30:13

分享到:

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

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要标新立异用中括号?

上一篇 : 武磊在西班牙巴塞罗那进行了二次手术,是因为华山医院运动医学科技术不行吗?

下一篇 : Unity收费***后,为何大家选择了Godot而不是Cocos?