TEL::0898-88889999

网站公告:

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

主营项目

  • 鱼缸哪里买比较便宜呢?
  • 中国人为什么会对俄罗斯有种特殊的好感?
  • 你在健身房发生过什么有趣的事情?
  • 国产手机AI「好用」的背后,是技术差距还是文化差异?
  • 以色列为什么要打伊朗?
  • 做引体向上可能会诱发腰肌劳损吗?

新闻动态

当前位置: 首页 > 新闻动态

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

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

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要标新立异用中括号?
上一篇:Golang与Rust哪个语言会是今后的主流?
下一篇:巴西为何成不了强国?