From: Thomas C. Brooke, <ntbrooke@concentric.net>
Subject: Re: assignments using different types
Date: 1997/01/30
Date: 1997-01-30T00:00:00+00:00 [thread overview]
Message-ID: <5cp84h$a9o@chronicle.concentric.net> (raw)
--
On 29 Jan 1997 17:34:54 GMT, tmoran@bix.com wrote ...
> > Velocity := Velocity_Type(float(Distance) / float(Time));
> >Can anyone provide me with suggestions to improve the readability
> >of the above assignment? Of course, I'd like efficiency to be
>
> How about creating
>
> function "/"(Distance : in Distance_Type;
> Time : in Time_Type)
> return Velocity_Type is
> begin
> return Velocity_Type(float(Distance) / float(Time));
> end "/";
>
> and then you will be able to write
>
> Velocity := Distance / Time;
>
> (Actually, your current statement is quite readable - though tedious
> to write.)
--
next reply other threads:[~1997-01-30 0:00 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
1997-01-30 0:00 Thomas [this message]
-- strict thread matches above, loose matches on Subject: below --
1997-01-29 0:00 assignments using different types tmoran
1997-01-28 0:00 David Dessert
1997-01-28 0:00 ` Christopher Green
1997-01-29 0:00 ` Robert I. Eachus
1997-01-29 0:00 ` Robert Dewar
1997-01-29 0:00 ` Robert Dewar
1997-01-29 0:00 ` Paul Van Bellinghen
1997-02-10 0:00 ` Robert Dewar
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox