3 ms·
I agree, "blatant absurdity" is quite a strong wording. I should've wrote "quite dubious" or the like. In my defense, I didn't even think of having a language
by berdario 13y ago
I agree, "blatant absurdity" is quite a strong wording. I should've wrote "quite dubious" or the like.
In my defense, I didn't even think of having a language with type coercion and 0 operator overloading (even on builtin types). I never saw such a language, and I'm skeptical that it could work. But it's an interesting take on the problem.
I cannot say why I think that the no-coercion+overloading is the better solution... maybe that's because operators are dyadic, and thus type coercion can be executed on both sides of the operator, and multiple times.
While function application is (can be?) sort of monadic (in the APL sense) since coercion/overloading for an argument doesn't depend on the type of the other arguments supplied to the function
(But while writing this, I'm not so sure anymore... at the very least, it could depend on the order in which arguments are evaluated...)
- Dylan16807 13y agoWhat I think of here is Lua, where builtin types have no overloading and there is a single type of coercion, between numbers and strings. This coercion is only triggered by arithmetic operators and concatenation. Unambiguous and pretty harmless. (Technically objects can overload binary operators (with no coercion) but it's not very common)