On Apr 4, 8:16 am, Graham <graham.st...@[EMAIL PROTECTED]
> wrote:
> On Apr 1, 11:00 pm, "Phaedrus" <phaedrus...@[EMAIL PROTECTED]
> wrote:
>
> > Certainly it is an im****tant part of Ada, but I wasn't suggesting that
it be
> > deleted entirely. However, it might be handy to have a less-strongly
typed
> > version of Ada, for instance to create prototypes faster and easier.
Then,
> > aspects of the prototype could be migrated into a "fully typed" arena
once
> > the "quick and dirty" prototype was completed.
>
> > Just thinking a little bit outside the ol' box, here...
>
> > Brian
>
> I haven't been using Ada for all that long, but I have been thinking
> that a kinder, gentler version would be nice in some cir***stances.
> Not necessarily *no* type-checking, but the ability to mix, say,
> integers, fixed-point types and floats in an equation without
> cluttering up the code with conversions.
The danger, of course, is that if the language allowed this, it
wouldn't catch some errors that a programmer could make, e.g. adding a
number of days to an amount of money (since you work on financial
applications). But if there are certain operations that make sense on
certain specific types, you can define them yourself in a package, and
then another package could USE the package with the operations to be
able to use the operations that make sense, without type conversions.
That might even be better than using type conversions. If you have
too many type conversions, a programmer could get into the habit of
just converting everything and may accidentally convert "money" to
"days" without thinking about it. But explicitly defining the
operators that make sense will force you to think about which
operators make sense and which don't.
Ada programmers dealing with physical units have been doing this sort
of thing for a long time, with functions like:
function "*" (X : Feet; Y : Pounds) returns Foot_Pounds;
-- Adam


|