网站地图官方微信:
网站首页 bzscx zb zst ygb yzyp xxwj

当前位置: 首页 >

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

  • | 工业克苏鲁什么意思? |

    22年初,大年初五给闺女买了两只小乌龟,中华草龟,送了个养龟...

    查看详情>>
  • | 鱼缸的硝酸盐含量为多少比较合适? |

  • | 如何评价剪映svip,599一年,有替代方案吗? |

  • | 全平台应用框架会是趋势吗?flutter、tauri、maui你更看好哪一个? |

  • | 如何用防火墙禁止软件联网? |

  • | 为什么有的人喜欢盲目抵制 goto 语法? |

  • | Mac 发展那么多年结果只能剪***吗? |

  • | 为什么明明35岁以上的员工更稳定,招聘时不要,被裁的也是他们? |

  • | 哪里有便宜的实时level2接口? |

  • | 用K8s的公司有多少人会部署K8s? |

  • | 2025年了 Rust前景如何? |

  • 1 见过发短***维权的,也见过发短***擦边的。 这是第...

    2025-06-26
  • 最新自研 tauri2.0+vue3.6+deepseek+...

    2025-06-26
  • 不会是湖南交通工程学院的吧,答辩现场老师当场反驳了一个学生j...

    2025-06-26
  • 前段时间出门旅行了一周,回来后我老婆反映刷抖音网络卡,问我怎...

    2025-06-26

关注我们

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