> that quite hard to read especially at lines 7-12 '__') It might just be me, but I don't feel anything special... Go does not have any other syntax (e.g., macros) that let you use parentheses in type definition unless followed immediately by a `func`, and those parentheses can not be nested.
> also for lines 18 and 22 if the type is not primitive type (another identifier), feels like a function that returns a function I actually like this kind of feeling. It actually is almost what happening - you can consider it as a function returning a function most of the time (the only time I can think of that you care about the difference is you want to optimize out the function call), but when you really care about the difference, you can quickly find out that by noticing float is actually a type. Consider this snippet of code, from the example code in standard library `sort` (SortKeys): By(name).Sort(planets) fmt.Println("By name:", planets) By(mass).Sort(planets) fmt.Println("By mass:", planets) By(distance).Sort(planets) fmt.Println("By distance:", planets) Here, `By` is actually a type of function - and the seemingly function call `By(...)` is actually a type conversion, not a function returning something with a `Sort` method. But I won't say this cause much confusion. I think the use of the proposed generic function works in the same way. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/6666831b-f554-42ec-ae6b-4e22a1213d29o%40googlegroups.com.