网站地图官方微信:
网站首页 板桥镇 福顺镇 蛟洋镇 渣津镇 梨木镇 下老乡

当前位置: 首页 >

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

  • | 为什么美军“好像”不怕泄密? |

    过于先进,随便展示,切莫较真,只图一乐,涉不涉密对不同国家标...

    查看详情>>
  • | 为什么中国现在全球军事实力第一,但包括中国人在内很多人不认可? |

  • | 为什么说中国是基建狂魔? |

  • | 有什么是你去河南才明白的事? |

  • | 你曾入住过最差的宾馆有多差? |

  • | 为什么他们可以闻出来我身上的穷酸味? |

  • | 为什么Dreamwe***er,FrontPage会被淘汰? |

  • | 为什么 Windows 没有比较成熟的第三方桌面环境(explorer.exe)? |

  • | 公司准备换系统有什么好用的ERP系统推荐嘛? |

  • | 在生活中,你对净水器有什么痛点?你期待的净水产品是什么样子? |

  • | 如何评价字节跳动开源的 HTTP 框架 Hertz ? |

  • 研发人员常常会陷入为不同协议切换调试工具的泥沼,事实上,Ap...

    2025-06-20
  • 可行,且大概率已经堵不住,不得不实施了。 因为有些城市已经...

    2025-06-20
  • 我说一个最商业化的开源项目吧,OneAPI (包括二开的 N...

    2025-06-20
  • 飞牛系统(J3455、16G内存) 容器管理:1Panel或...

    2025-06-20

关注我们

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