当前位置: 首页 >

正文

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

2025-06-23 01:00:15浏览:99次
电话:
客服QQ:
邮箱:
我随手拿了著名AI机器学习框架pytorch的一段代码 **
就像这种: 「恒 D 内部歌舞」链接: 夸克网盘分享 「全网
现在暂时可能还是,以后不一定 这要不是他出门炸了
身材还用说吗?真的是好啊! 就看过她演的变形金刚和忍者神龟。
查看所有文章