• 山东寿光较大中毒事故致 7 死 4 伤,副市长等 26 人被问责,此事有哪些警示意义?
  • jwt与token+redis,哪种方案更好用?
  • 飞机这么多按钮都要一个个地打开,为什么不能一键启动?
  • 如何看待日本小学校园餐只有一小块鸡肉?
  • 为什么面对 Adobe 的版权要求下,vposy 大神还能从容不迫?

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

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

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

发布时间:2025-06-18 18:00:12

分享到:

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

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

上一篇 : 编剧于雷发文痛批杨坤篡改革命歌曲《游击队之歌》:“你们还是人吗?”,对此你怎么看?

下一篇 : 颠覆空调形态,美的无外机嵌入式厨房空调新品是黑科技还是噱头?