• 为什么Mac连个正儿八经的CAD都装不了还敢打着生产力的旗号?
  • 程序员明明是技术积累岗位,为什么年龄越大反而可替代性变高了?
  • 如何评价吴京马上要上映的新电影《镖人》?
  • 为什么中国开发不出流行的编程语言?
  • 苹果搭载 M5 芯片的 MacBook Pro 或将于 2025 年秋推出,该产品应用了哪些新技术?

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

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

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

发布时间:2025-06-24 05:30:10

分享到:

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

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

上一篇 : 我是新手想养鱼,预算不超过200。有什么好的建议或者禁忌吗。?

下一篇 : 为什么大量人类会喜欢猫?