• C:\Windows\Media\onestop.mid 这个文件为什么会在系统文件里,但是从来没听到过?
  • 个人开发者或小企业不申请经营性ICP备案,怎样开发APP盈利?
  • 为什么是9月3日阅兵而不是10月1日国庆阅兵?
  • 宁波东方理工大学学费每人每学年 9.6 万,为什么会这么贵?
  • 有哪些事,是社会底层人认识不到的?

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

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

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

发布时间:2025-06-22 00:10: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要标新立异用中括号?

上一篇 : 人常说女人味,到底是个什么味?

下一篇 : CPU 是怎么认识代码的?