Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
grey-area
on June 30, 2017
|
parent
|
context
|
favorite
| on:
Go func: Reducing cognitive load
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
keymone
on June 30, 2017
[–]
point is typedefs aren't reusable at anonymous function declarations. imo that sucks. that's all i wanted to say.
davidarkemp2
on June 30, 2017
|
parent
[–]
You could always declare the method on the Printer type...
https://play.golang.org/p/4MG8kgGEGM
keymone
on June 30, 2017
|
root
|
parent
[–]
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: