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

> It would make me assume that if I were to write a function that looks like this, it would at least accept the same type of arguments:

    func AnotherFunction(a, b ordered) {
        ...
    }
Not really. If we consider `ordered` an interface, then `func(a, b ordered)` does not enforce typeof(a) == typeof(b), only that both types implement `ordered`.



Exactly, which is why I said: "it would at least accept"




Consider applying for YC's Spring batch! Applications are open till Feb 11.

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

Search: