Hacker News new | past | comments | ask | show | jobs | submit login

Not sure what this has to do with generics, Go requires types for function arguments. If your anonymous function gets clumsy and too big in place, just use a named function not an anonymous one:

    print("hello", myprinter)
https://play.golang.org/p/3sNOeVIhqi



point is typedefs aren't reusable at anonymous function declarations. imo that sucks. that's all i wanted to say.


You could always declare the method on the Printer type...

https://play.golang.org/p/4MG8kgGEGM


where's the anonymous function with reuse of typedef in there?




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: