• 为什么中国足协成了“过街老鼠”了?
  • 你们都什么时候对男女之事开窍的?
  • 有什么好用的安卓本地音乐播放器推荐?
  • 为什么家里要用 NAS?家用 NAS 有哪些实际的、接地气的用途?
  • 男子因眼睛小被小米汽车系统频繁误判疲劳驾驶,一路提醒20多次,这是智能汽车通病吗?怎么解决该 bug?

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

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

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

发布时间:2025-06-21 19:30:20

分享到:

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

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

上一篇 : 微信头像会影响第一印象吗?

下一篇 : 如何看待伊朗发布10座美军基地地图?