网站地图官方微信:
网站首页 偏店乡 松岭区 七宝镇 高作镇 永春县 蔓耗镇

当前位置: 首页 >

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

  • | 上海迪斯尼为什么老是打架? |

    对很多人来说,迪士尼不是身心放松的乐园,而是无限增压的试炼场...

    查看详情>>
  • | 做个web服务器,gin框架和go-zero怎么选? |

  • | Flutter 为什么没有一款好用的UI框架? |

  • | 印度是真的烂还是咱们在信息茧房里面? |

  • | 为什么bilibili后端要用go来写? |

  • | 人间尤物是什么样的? |

  • | 目前最流行的 rust web 框架是什么? |

  • | 大家的NAS都是24小时不关机吗? |

  • | 感觉自己被吸走了精气是为什么? |

  • | 黄一鸣为什么敢承认孩子是王思聪的? |

  • | 为什么欧美影视喜欢露点? |

  • 你要是信不过简中的话,你可以去翻翻繁中对印度的报道, 油管上...

    2025-06-24
  • 说明腾讯实现了我曾经的几个预测 预测1,electron会普...

    2025-06-24
  • 如果知乎算海的话,那我,被捞着了。 事情是这样的:我以前有...

    2025-06-24
  • 更新一下,发现dart3的模式匹配,一定程度能缓解 最近因为...

    2025-06-24

关注我们

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