大部分语言都用尖括号<>表示泛型,为什么golang要标新立异用中括号?

2025-06-18 16:10:13

最新的设计文档里面对这一块做了一个解释。

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要标新立异用中括号?
广告位810*200
相关阅读
你的内衣丢过吗?

你的内衣丢过吗?

零几年的时候,暑***到南方打暑***工,图新鲜找个事干干。...

2025-06-25
自研项目,PHP用什么框架最好?

自研项目,PHP用什么框架最好?

我一直在用codeigniter3,主要有以下几个优点 1、...

2025-06-25
国外的女生为什么屁股都大?

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

大与翘是两种概念。 东亚女性是屁股大,又大又扁,俗称扁平臀...

2025-06-25
为什么一部分 Go 布道师的博客不更新了?

为什么一部分 Go 布道师的博客不更新了?

在我看来,Go 有几个很重要的优化: defer 的性能提升...

2025-06-25
有没有宝塔平替的服务器管理面板,现在宝塔越来越贵了,也太臃肿了?

有没有宝塔平替的服务器管理面板,现在宝塔越来越贵了,也太臃肿了?

[Hestia]开源网络服务器控制面板,快速、可靠、开源便捷...

2025-06-25