网站地图官方微信:
网站首页 包装用纸 包装相关设备 包装机械 荧光笔 隐型眼镜 眼镜片

当前位置: 首页 >

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

  • | 国际空间站的氧气是怎么来的?为什么一直都用不完? |

    一个成年人单日呼吸次数2~2.5万次,单日消耗氧气量约550...

    查看详情>>
  • | flutter为什么不用Go语言,而用Dart? |

  • | 什么样的女主才能叫做「人间尤物」? |

  • | 为什么中国农村房子那么丑? |

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

  • | 为什么用 electron 开发的桌面应用那么多? |

  • | 鸿蒙折叠屏笔记本为什么敢卖26999? |

  • | 如何以苏幽璃遇见凤钏子开头写一故事? |

  • | 有没有好用的本地***去水印免费软件? |

  • | 长期使用的大佬来说说,MacOS 真的比 Windows 稳定吗? |

  • | 猫那么爱干净,却为什么不喜欢洗澡? |

  • Datafusion 和 Bevy 。 Datafusion...

    2025-06-22
  • 就我待过的几家公司,显示器没一个算得上好的,60hz也就算了...

    2025-06-22
  • 有的人不会思考是否原谅这种问题,因为他们就不会后悔。 昨天...

    2025-06-22
  • 1984年盖的山东老房子,不到20万修葺了一下。 ...

    2025-06-22

关注我们

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