[go-nuts] [generics] Maybe possible to use <> instead of () as type parameter and

2020-06-16 Thread Xie Zhenye
In the draft, it says: "Why not use the syntax F like C++ and Java? 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. Resolving that requires effectively unbounded loo

[go-nuts] Re: [generics] Type lists should be usable in any interface

2020-06-16 Thread Xie Zhenye
I agree. constraint is different from normal interface. It's better to use type SomeConstraint constraint {} than type SomeConstraint interface {} On Wednesday, June 17, 2020 at 11:12:24 AM UTC+8 Brandon Dyck wrote: > I find it a little strange that an interface with a type list can only be >

[go-nuts] Re: Generics and parentheses

2020-07-19 Thread Xie Zhenye
Gramma of a programming language is not able to be changed after released. So language design is elegant or not is more important than difficulty of implementing. Adding type information in parse time and use angle brackets only affects compiler and 3rd part tools or IDEs in a short time. Prov

Re: [go-nuts] Re: Generics and parentheses

2020-07-20 Thread Xie Zhenye
#, TypeScript can solve this, it must be a way for Go. On Monday, July 20, 2020 at 2:43:53 PM UTC+8 axel.wa...@googlemail.com wrote: > On Mon, Jul 20, 2020 at 8:33 AM Xie Zhenye wrote: > >> Gramma of a programming language is not able to be changed after >> released. So language de

Re: [go-nuts] go build error in darwin: duplicate symbol

2023-01-09 Thread Xie Zhenye
It's caused by github.com/lufia/iostat. Maybe two different dependencies used 'iostat'. 'iostat; used cgo, and produced an object file from .c file for each dependency. Linker try to link both .o file that cause the problem. On Tuesday, March 23, 2021 at 12:25:17 AM UTC+8 Ian Lance Taylor wrote

Re: [go-nuts] go build error in darwin: duplicate symbol

2023-01-09 Thread Xie Zhenye
Maybe cgo should build a single .o file for the same .c file. On Tuesday, January 10, 2023 at 11:21:00 AM UTC+8 Xie Zhenye wrote: > It's caused by github.com/lufia/iostat. > > Maybe two different dependencies used 'iostat'. 'iostat; used cgo, and > produced an o