网站地图官方微信:
网站首页 穆家镇 智新镇 永胜乡 长水乡 福德镇 吉根乡

当前位置: 首页 >

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

  • | 新买的移动硬盘该格式化为 NTFS 还是 exFAT? |

    绝对不要exFAT!!!!绝对不要exFAT!!!!绝对不要...

    查看详情>>
  • | 想深入学习网站后台技术,有哪些建议? |

  • | 如何评价 Vue.js 纪录片? |

  • | 草龟为啥那么容易死啊? |

  • | ElasticSearch在项目中具体怎么用? |

  • | 你身边身材最好的女生是什么样? |

  • | 如何看待rust编写的zed编辑器? |

  • | 毕设答辩,老师说node不可能写后台怎么办? |

  • | 微软edge浏览器为什么逐渐被其他的浏览器代替? |

  • | 国外的女生为什么屁股都大? |

  • | 为什么 php 可以做到 7 毫秒以内响应,而 .net 做不到? |

  • HTTP/3 实际上是 QUIC 协议 + HTTP2。 我...

    2025-06-22
  • 应该感谢伊朗袭击和俄乌战争揭露世界真相 譬如图中是伊朗火...

    2025-06-22
  • 漏洞简介 CVE-2024-53900 Mongoose 8...

    2025-06-22
  • 我又要点名一款软件:Chrome Chrome的诞生,某种意...

    2025-06-22

关注我们

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