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


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

更新时间:2025-06-23 12:45: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要标新立异用中括号?

案例推荐

case recommendation
  • 普通人有可能在羽毛球比赛中赢林丹1球吗?

    查看案例

  • 听说有一门技术叫windows批处理(bat),请问它有什么现实用途?

    查看案例

  • N***icat for mysql如何安装?

    查看案例

  • 为什么一直唱衰的php语言反而日渐活跃?

    查看案例

  • 大街上看到大白腿,忍不住瞄了两眼,算不算不尊重女性?

    查看案例

  • 人可以极简主义到什么程度?

    查看案例

  • 怎么下载安装pr,求安装包啊,?

    查看案例

  • 全班 43 人开家长会只来了 7 位爸爸,学校称未来准备策划爸爸家长会,如何看待这一现象?

    查看案例