网站地图官方微信:
网站首页 土城镇 新海镇 白甸镇 长乐镇 唐县镇 浪珠乡

当前位置: 首页 >

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

  • | 跨平台GUI框架到底应该自绘还是原生控件绑定? |

    谢邀。 自绘更正确。 之前看到有人问,Apple 新的玻...

    查看详情>>
  • | 央企的信创,是否有必要把 spring 替换成国产的 solon ? |

  • | Rust开发Web后端效率如何? |

  • | 为什么中国很少有人使用linux? |

  • | PHP现在真的已经过时了吗? |

  • | 以色列摩萨德这么厉害,中国网民为何不害怕? |

  • | 如何看待jemalloc停止维护? |

  • | 海贼王为什么现在被全网黑? |

  • | 炫富真的很爽吗? |

  • | 埃塞俄比亚真的盛产美女吗? |

  • | 人为什么需要睡觉?人睡觉的时候身体都在做什么? |

  • Alist已死,咱们来用Openlist吧Alist已经确认...

    2025-06-20
  • 23年夏天在苏州一家潮汕牛肉火锅店 隔壁桌的一个女生,热裤加...

    2025-06-20
  • 上大学的时候有个同学,一米九八,是当了两年兵后回来接着上大学...

    2025-06-20
  • 以前我是神烦这种cookie弹窗的。 自己做海外网站设计的时...

    2025-06-20

关注我们

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