• 养乌龟生态缸到底可行吗?
  • 联想 128GB 超大内存迷你 AMD 主机上架,此款主机有哪些亮点?
  • 如何看待 typst?
  • 洲际导弹能打到任何地方,为什么还需要轰炸机?
  • 高校里那些「非升即走」后「走」了的青年教师都怎么样了?

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

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

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

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

上一篇 : 老板说我设计了一周的海报还是不行,我到底该怎么学啊?

下一篇 : 如何解读穷则独善其身,达则兼济天下?