• 中国与敌国发生战争,哪些国家会帮中国?
  • 真的有这种又苗条身材又爆炸的么?
  • 24-25 赛季 NBA 总决赛抢七,雷霆 103-91 步行者,夺得本赛季总冠军,如何评价这一结果?
  • 理论上flutter性能应该非常高才对,为什么好些flutter应用性能一般?
  • 如何证明散片 CPU 比盒装 CPU 差?

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

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

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

发布时间:2025-06-23 10:20:13

分享到:

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

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

上一篇 : 最近突发奇想,想做以NAS为主的家用媒体中心。下面是我做的一个草图,各位大神看看可行吗?

下一篇 : 为什么Go仅仅160MB的安装包就可以编译程序,而Rust却还需要几个GB的VC++才能编译?