网站地图官方微信:
网站首页 梅桥镇 泉口镇 东阿镇 竹林镇 堡子镇 墩上乡

当前位置: 首页 >

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

  • | 为什么央视不再报道洛杉矶***了? |

    央视以为的洛杉矶***,是: 警民相互biubiubiu,死...

    查看详情>>
  • | 如何评价女明星梅根福克斯的身材? |

  • | 中国女篮张子宇身高 2 米 26 制霸赛场,身高因素在篮球比赛中能占多大优势?她会是下一个「姚明」吗? |

  • | 工业克苏鲁什么意思? |

  • | 使用 Go 语言开发大型 MMORPG 游戏服务器怎么样? |

  • | 有没有用过GOOVIS的? |

  • | 为什么好多人不承认大众审美就是喜欢白皮? |

  • | 老公加班过多,是逃避家庭责任吗? |

  • | 如何评价字节跳动开源的 Netpoll? |

  • | 如何评价特厨-魏味探店? |

  • | 为什么一般人不建议住别墅? |

  • 有次穿着运动bra在健身房练,没多想,因为很多女的都这么穿。...

    2025-06-18
  • vposy有99.99999%的可能是Adobe中国的员工或...

    2025-06-18
  • 一句话:可能还挺好的……Update Hosts in Ru...

    2025-06-18
  • 就我楼上,一个单亲妈妈,带两个孩子。 也就电梯里打过几次招呼...

    2025-06-18

关注我们

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