• 写业务的话,go是不是垃圾?
  • 目前美军还有哪些领域是明显领先于解放军的?
  • Electron 和当下其他的桌面开发方法相比如何?
  • 异性同办公室久了会不会日久生情?
  • 如何评价中国电科研发的JY-10防空指挥控制系统成为伊朗防空指挥系统核心?

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

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

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

发布时间:2025-06-24 12:15:14

分享到:

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

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

上一篇 : 在中国有多少开发者使用Rust编程语言?

下一篇 : 国产手机APP为什么越来越臃肿?