Re: Modelling Disjoint Subtypes
Date: Mon, 26 Mar 2007 20:30:49 GMT
Message-ID: <Z3WNh.1907$E46.726_at_trndny09>
"Marshall" <marshall.spight_at_gmail.com> wrote in message
news:1174937535.353341.203170_at_p77g2000hsh.googlegroups.com...
> On Mar 26, 7:18 am, Bob Badour <bbad..._at_pei.sympatico.ca> wrote:
> >
> > But even if the type checking were deferred until runtime in the
> > conditional test, the type of x and y is statically known in the block
> > under consideration.
>
> THAT was the point I was trying to make.
>
> Regardless of how we got there, inside the block, the compiler
> knows statically that the x and y values are integers, even
> though their declared type in the code is rational. There can
> exist implementations of rationals such that when the rationals
> are integers, the generated code for a multiply is identical to
> the generated code for multiplying integers. So within the
> context of that block, looking at the generated code, you
> would not be able to distinguish those two cases. The
> types have been erased.
>
OK, now you've lost me. Why is it necessary to distinguish between the case where x and y are integers, and the case where x and y are rationals that are constrained to take on only integer values?
It seems like a distinction without a difference to me. Received on Mon Mar 26 2007 - 22:30:49 CEST
