TEL::0898-88889999

网站公告:

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

主营项目

  • 在深圳找个男朋友难吗?
  • 中国的国土防空系统能有效防止B2/B21这类飞翼隐身战略轰炸机入侵吗?
  • 请问有人能估计一下 go 相比 php 在不同用户量下能省多少钱吗?
  • 极客湾评价小米芯片客观么?
  • 伊朗议会赞成关闭霍尔木兹海峡,会动真格吗?若霍尔木兹海峡关闭,将带来哪些影响?
  • 老板说我设计了一周的海报还是不行,我到底该怎么学啊?

新闻动态

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

大部分语言都用尖括号<>表示泛型,为什么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和J***a到底怎么选?
下一篇:用J***a写Android的时代是不是要结束了?