On Tue, 2006-02-21 at 23:23 +0100, Laurent GUERBY wrote: > On Tue, 2006-02-21 at 15:02 -0700, Jeffrey A Law wrote: > > Given an expression, we have to do computations in some other type than > > the type of the expression? Now that's just silly. If the expression > > has some type X, then we should be doing our computations in type X. > > That would obviously lead to very inefficient implementation if you > put that in a language with user range types and bound checking since it > would force a dynamic bound check after each operation. I'm saying nothing about where/when bounds checking occurs -- Ada is free to insert bounds checking wherever it is necessary to impelment Ada semantics.
In our trees, if I have PLUS_EXPR <TYPE, X, Y> That says very simply to add X & Y in type TYPE -- anything else is wrong. If our Ada front-end assumes something different, then that is braindamage in our Ada front-end. Note carefully I'm saying absolutely nothing about ignoring user range types, I'm saying nothing about where you insert bounds checking. I'm saying that within an arithmetic expression the type of the expression specifies the type in which the arithmetic will occur. Jeff