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


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

更新时间:2025-06-21 17:15:17

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

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
  • 为何中文互联网相对英文互联网的内容质量较低?

    查看案例

  • 电影《赤道》为何没有第二季呢?

    查看案例

  • 你见过身边身材最好的女生是什么样子的?

    查看案例

  • switch模拟器是不是历史上唯一在主机当红时就几乎完美模拟器?

    查看案例

  • 为什么拼音26键没有ü?

    查看案例

  • 如果肯德基的员工忍不住偷吃了一个鸡翅怎么办?

    查看案例

  • 为什么 CRT 画质这么好也被淘汰,液晶反而发展的很好?

    查看案例

  • 为什么说穷人不要买车?

    查看案例