3 ms·
I feel the lack of additional type arguments on methods will be considered a mistake in the longer term. Although the way it's designed it can be added in addit
by stickupkid 6y ago
I feel the lack of additional type arguments on methods will be considered a mistake in the longer term. Although the way it's designed it can be added in additional revisions but considering it's taken rather a long time to get here, I don't hold much hope for it landing for some time.
Attempting to define a generic Map function turns out to be somewhat troublesome[1]. This would be really painless if you had type arguments, instead, we have to define an interface to allow peeping into the type and creating a type from a zero value.
Don't get me wrong, I do applaud the efforts for better type system, it's just a weakness in the proposal.
1. https://go2goplay.golang.org/p/P7CVwOW9wig https://go2goplay.golang.org/p/P7CVwOW9wig (note this panics currently)
- deleted 6y ago[deleted]