• MacOS真的比Windows流畅吗?
  • 功夫游戏《师父》火了之后,为什么没能掀起做功夫题材的游戏的浪潮?
  • 「香港四大才子」之一蔡澜去世,你对他有哪些了解?如何评价他的成就?
  • 你知道自修改代码(Self-Modified Code, SMC)在哪些场景有应用?
  • 女朋友跟别的男人出去旅游了怎么办?

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

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

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

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

上一篇 : Typescript真的有用吗?

下一篇 : 为啥苹果不给 MacBook Pro 加上这些特性?