网站地图官方微信:
网站首页 东风镇 南胜镇 岳滩镇 三店镇 筻口镇 瓜州县

当前位置: 首页 >

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

  • | 为什么欧美影视喜欢露点? |

    这么喜欢看露点的 那推荐一部俄罗斯的片子《契卡》 从头到尾都...

    查看详情>>
  • | Rust 的设计缺陷是什么? |

  • | 如何评价Cursor? |

  • | 为什么楚国更多与湖北联系在一起? |

  • | 胸大的女孩会自卑 吗? |

  • | 为什么越来越多的 SSD 不带片外缓存了? |

  • | 据说go和c#的开发者都说自己比较节省内存,你们认为呢? |

  • | Python+rust会是一个强大的组合吗? |

  • | 伊朗为什么不买中国战机,却坚持四十年用老旧的苏联米格29、美国F14雄猫战斗机? |

  • | 如何评价首个女性友好的编程语言HerCode? |

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

  • Dlang没前途的,他犯了大忌,升级背刺用户搞不兼容,社区动...

    2025-06-21
  • 5月4日,娱乐媒体晒出超级***伊内斯·特洛奇亚身穿比基尼现...

    2025-06-21
  • 一、FWA技术: 从光纤补充到运营商业务拓展核心引擎固定无线...

    2025-06-21
  • 说明中国空军现在正在走到一条“超体系”的道路上。 意思就是...

    2025-06-21

关注我们

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