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


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

更新时间:2025-06-21 20:05: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
  • 怎么才能有尤雨溪一半强,该怎么学习?

    查看案例

  • SpaceX 星舰 36 号火箭静态点火测试爆炸,爆炸的原因是什么?会对星舰发展产生什么影响?

    查看案例

  • 为什么浙江落下的陨石,防空系统没有拦截,它和导弹有什么不同?

    查看案例

  • 如何评价网易国产动作冒险单机新作《归唐》首支预告片?

    查看案例

  • 怎么提高自己的系统设计和架构理论水平?

    查看案例

  • 为什么说 Node.js 有望超越J***a?

    查看案例

  • 伊朗的反击力度是否出乎以色列的意料之外?

    查看案例

  • Linux 内核的系统有没有类似macOS 那样漂亮流畅的桌面环境的发行版本?

    查看案例