Prof A Olowofoyeku (The African Chief) wrote:
That being said, I am not sure why one would want to overload routines using different subranges of integer. Just because the compiler allows something doesn't mean that one should do it, especially seeing that, in such cases, one single routine (taking a parameter of the largest size of integer) would do just fine.
As I wrote, this may be done for efficiency (since passing an Integer is slightly faster than passing a LongInt, e.g.), but I'm also doubtful if it's a good thing to do. A similar problem would appear with `Integer' and `Real', BTW, since integer values are allowable for `Real' (value) parameters. I'm not sure how important this is. Though it might be, especially for operators. If we want to define a new numeric type, say GMP's real type, and provide regular operators for it, so we could do `GMPRealValue + IntegerValue' and `GMPRealValue + RealValue', we have just this situation. Of course, defining an `GMPRealtype + Real' operator would accept an integer RHS operand as well, but it's less efficient than calling GMP's "GMP-Real + Integer" routine directly. So perhaps one should allow integer vs. real ambiguities, since they're less fragile than those between different integer subranges? Frank -- Frank Heckenbach, frank@g-n-u.de, http://fjf.gnu.de/, 7977168E GPC To-Do list, latest features, fixed bugs: http://www.gnu-pascal.de/todo.html NEW! GPC download signing key: ACB3 79B2 7EB2 B7A7 EFDE D101 CD02 4C9D 0FE0 E5E8