[go-nuts] Go predicts the end of the universe

2017-11-10 Thread Hal
Go predicts the end of the time, i.e. the end of the universe 😂 https://play.golang.org/p/THHvbdo_IS package main import ( "fmt" "math" "time" ) func main() { endOfTheTime := time.Unix(math.MaxInt64,81394542089).UTC() fmt.Println(endOfTheTime.Stri

[go-nuts] [generics] Why is constraint optional?

2020-06-17 Thread Hal
"If a constraint is specified for any type parameter, every type parameter must have a constraint. If some type parameters need a constraint and some do not, those that do not should have a constraint of interface{}." "interface{}" equals to "Any Type" in the context of generics. So it seems th

[go-nuts] Re: [generics] Why is constraint optional?

2020-06-18 Thread Hal
Yes, an alternative syntax I can come up with (underscore as a placeholder): func Foo(type T1 _, T2 Bar) On Thursday, 18 June 2020 03:28:39 UTC+1, Andrey Tcherepanov wrote: > > Wouldn't it be nice to have just > > func Foo(type T1, type T2 Bar) > > (type as keyword splitting it into 2 type decla