| ▲ | skybrian 2 hours ago | |
For an example of a language feature that looks kind of like standard object-oriented inheritance, but isn’t, check out “struct embedding” in Go. Struct embedding gives you the syntax of inheritance and you can even override methods, but for internal self-calls, methods don’t get overridden. (If you wanted to allow that, you’d need to add function pointers or an interface to the struct.) | ||