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

Hmm, I guess that's okay as long as they don't change the code to call any new functions?

The set of functions that some generic code calls could be considered similar to an interface or trait in other languages. If they expand the interface (by calling new functions) then you'd need to make sure the new functions they call have the appropriate implementations needed as well.

In Go, for example, the interface definition would be explicit. You'd add a method to the interface (or perhaps define a new interface) and update all the implementations you know about. If there is any outside code calling it with their own implementation, they'd get a compile error.

It does sound rather convenient if essentially every function call allows for new implementations, though.




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

Search: