你现在的位置是:当前位置: 首页 >


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

更新时间:2025-06-20 19:00:16

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

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

案例推荐

case recommendation
  • 浙江真的可以三千名上浙大吗?

    查看案例

  • 入门级3D打印机怎么选,创想三维这个牌子如何?

    查看案例

  • 为什么欧美影视喜欢露点?

    查看案例

  • 夸克网盘有可能超越百度网盘吗?

    查看案例

  • 为什么各大 *** 出奇一致地设置了『摇一摇开屏广告』?如何关闭常用 *** 的这些广告?

    查看案例

  • 如何评价高圆圆的身材算是美女类型的吗?

    查看案例

  • 鱼缸有哪些寿命比较长的草推荐呢?

    查看案例

  • 为什么抖音上的姑娘都那么好看,现实中我怎么一个也见不着?

    查看案例