J. David Bryan wrote:
On Tuesday, August 3, 2010 at 3:42, Frank Heckenbach wrote:
But while reading the above links, I also noticed that Ada is very strict about types etc.
Ada allows conversion between otherwise incompatible types with the generic function "Unchecked_Conversion", which is effectively a type cast. See:
The section is a bit brief. Can it also be used, say, to convert any data type to an "array of char" (in C/Pascal notation) and back, to do "untyped memory block" operations?
(The name "Unchecked_Conversion" is verbose -- intentionally so -- as it's intended to call the reader's attention to the circumvention of strict type- checking.)
For the same reason C++ has the longish "reinterpretation_cast" (though, of course, for backward-compatibility it also has to support the more dangerous C form).
Adriaan van Os wrote:
But there is no such thing like Objective-Ada, is there ? That would be a clear disadvantage of Ada as an intermediate language.
As he mentioned before, Ada's "tagged records" seem to correspond to objects (though I haven't compared in detail).
Frank