网站地图官方微信:
网站首页 水堡镇 凌桥乡 戴南镇 深土镇 包鸾镇 协兴镇

当前位置: 首页 >

大部分语言都用尖括号<>表示泛型,为什么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要标新立异用中括号?

  • | 人常说女人味,到底是个什么味? |

    OPPO新机发布会上,产品经理莫妮卡这个动作,我觉得很有女人...

    查看详情>>
  • | 如何评价人民网评关于集中整治违规吃喝的发文? |

  • | 俗话说“女人三十如狼四十如虎”,到底是不是真的?? |

  • | 为什么有的女生喜欢穿紧身牛仔裤? |

  • | 你见过最无用的节俭行为是什么? |

  • | 俗话说“女人三十如狼四十如虎”,到底是不是真的?? |

  • | 客户端kotlin、swiftUI、flutter和web端vue、jsx的UI语法,哪种方式更优雅? |

  • | 如何看待三峡集团总部搬迁至武汉? |

  • | 胸大的女孩会自卑 吗? |

  • | 美国还有能力建造一艘核动力航母么? |

  • | 服务器能否拒绝非浏览器发起的HTTP请求? |

  • 8g树莓派560元不知道能干啥,玩linux太慢,玩单片机太...

    2025-06-21
  • 我以我正在制作的游戏为例来说明。 这款游戏的想法很清晰,就...

    2025-06-21
  • 22年初,大年初五给闺女买了两只小乌龟,中华草龟,送了个养龟...

    2025-06-21
  • 因为rust比c和c++好上手,至少不会因为cmake等东西...

    2025-06-21

关注我们

添加微信好友,关注最新动态