3 ms·
BTW I don't think the compiler is "smart enough" - but the Http API has 2 (probably more) overloaded methods for each type you may want to pass to it. Go doesn'
by dvirsky 13y ago
BTW I don't think the compiler is "smart enough" - but the Http API has 2 (probably more) overloaded methods for each type you may want to pass to it. Go doesn't have method overloading by design. If that's something that is a must have for anyone, Go is simply not for them.
- twic 13y agoNo, it's exactly as tomp says - in Java 8, lambda expressions are handled by compiling them to little classes which implement interfaces. Kind of. The truth is that something absolutely barking mad goes on in the compiler, and then extra magic is injected at runtime: http://cr.openjdk.java.net/~briangoetz/lambda/lambda-translation.html http://cr.openjdk.java.net/~briangoetz/lambda/lambda-transla... But it behaves exactly as if there were little classes which implement interfaces. Just more efficient.
- dvirsky 13y agoOh, thanks for the info, didn't know that. Still I don't think that Go should have that feature.