New answers tagged

7

The big hint is in your question: "interface inheritance". Basically, an interface is nothing but a set of method signatures. In a traditional OOP language, the only thing a class needs to do to satisfy an interface is to have implementations of those method signatures, and declare that it implements the interface. Since it's not inheriting implementations, ...


5

When I write + I just know that it is the addition operation. And how do you know that? Because the semantics of the language say so! By the way, that isn't even universally true. For example, for Strings in Java, + is not addition, but concatenation! when I write int i;, I know that int is an integer and it is enough for me. And how do you know ...


15

Sublte semantic differences Consider this simple program: i = 1000'000'000 j = i * i This operation can behave very differently depending on the semantics of integers in your language: Some languages will seamlessly switch to big integers producing the correct result (1000'000'000'000'000'000), but degrading performance (e.g. python) Some languages ...


0

There are a couple of levels to your first question. As an aside, though, I recommend learning about unification if you are not already familiar with it as it is a key part of understanding type checking and type inference. To type check selfApply provisionally give f the type a which we will solve for. (At this point it is just a unification variable, ...



Top 50 recent answers are included