Mirsad Todorovac a écrit:
The only problem lies in (lack of) automatic promotions/conversions/interoperability with other types.
I have a smilar problem with complex type. Since gpc does not implement LongComplex types, I use the CEPHES library which contains (in C) all needed functions, and make interface with the attached import unit. The only drawback is that this LongComplex type has nothing to do with Complex, or Real and LongReal. So to avoid conflicts I need to give different names to functions like Re, Im and also sin (-> csin) which have meaning both in Real and Complex types etc. Otherwise it works perfectly when everything is done only in LongComplex.
In fact there is nothing in Pascal to say in a program that two types are somewhat related, by giving rules for automatic conversion. Any such concept is then implemented manually inside the compiler, e.g. by saying that you can assign an integer to a real, but cannot do the reverse. With C++ objects one can give such rules in constructors, by defining several constructors which differ by the types of their arguments. But this is valid only in objects, which are heavy structures. So we begin to imagine a new language.
Maurice