comp.lang.ada
 help / color / mirror / Atom feed
From: aratel@total.net (Andre Ratel)
Subject: Re: Ada vs Delphi?
Date: 1999/08/14
Date: 1999-08-14T00:00:00+00:00	[thread overview]
Message-ID: <37b54730.55126310@news.total.net> (raw)
In-Reply-To: 7os8t1$fbd$1@nnrp1.deja.com

On Wed, 11 Aug 1999 16:37:54 GMT, Robert Dewar
<robert_dewar@my-deja.com> wrote:

>You definitely do NOT understand, which is not surprising since,
>as I expected, Delphi is not strongly typed in this area.

The Delphi books I have say that it is strongly typed (but, of
course, they compare it to C :-).

>Your view of types above is strictly structural, you declare
>things to be signed or unsigned according to their value range
>and then worry about mixing these values.
>
>That has nothing at all to do with the kind of strong typing
>we are talking about, where you have:
>
>  type minutes is range 0 .. 59;
>  type seconds is range 0 .. 59;
>
>  mm : m;
>  ss : s;

I suppose, here, you meant
  mm: minutes;
  ss: seconds;

>Now mm and ss have IDENTICAL representation, but are of quite
>different types, so an assignment
>
>  mm := ss;
>
>which is almost *certainly* a bug, is statically illegal, just
>as illegal in fact as trying to assign a record to an integer.

OK. I'm putting all the pieces together now. And I suppose
that if mm and ss are related and you need to combine them
in a single expression, you would proceed through typecasting.
For example, 

  type minutes is range 0 .. 59;
  type seconds is range 0 .. 59;
  type count is range 0..3600;

  mm : minutes;
  ss : seconds;
  cc: count;

  cc:= 60*count(mm) + count(ss);

But how do you avoid complex expressions becoming cumbersome?


	Andre





  reply	other threads:[~1999-08-14  0:00 UTC|newest]

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-08-06  0:00 Ada vs Delphi? Andre Ratel
1999-08-06  0:00 ` William Starner
1999-08-06  0:00   ` William Starner
1999-08-07  0:00   ` tmoran
1999-08-07  0:00     ` Aidan Skinner
1999-08-07  0:00       ` Gautier
1999-08-06  0:00 ` Steve Doiel
1999-08-09  0:00   ` Paul Groves
1999-08-08  0:00     ` Steve Doiel
1999-08-10  0:00       ` Ray Blaak
1999-08-10  0:00         ` Steve Doiel
1999-08-14  0:00           ` Andre Ratel
1999-08-09  0:00     ` Gautier
1999-08-11  0:00       ` Andre Ratel
1999-08-12  0:00         ` Gautier
1999-08-14  0:00           ` Andre Ratel
1999-08-14  0:00             ` Gautier
1999-08-16  0:00               ` Gautier
1999-08-15  0:00             ` Steve Doiel
1999-08-17  0:00             ` Robert I. Eachus
1999-08-12  0:00         ` Gautier
1999-08-09  0:00     ` Aidan Skinner
1999-08-09  0:00     ` Robert Dewar
1999-08-09  0:00     ` Robert Dewar
1999-08-11  0:00       ` Andre Ratel
1999-08-11  0:00         ` Robert Dewar
1999-08-11  0:00           ` David Botton
1999-08-14  0:00           ` Andre Ratel
1999-08-11  0:00         ` Ted Dennison
1999-08-14  0:00           ` Andre Ratel
1999-08-16  0:00             ` Ted Dennison
1999-08-11  0:00         ` Robert Dewar
1999-08-14  0:00           ` Andre Ratel [this message]
1999-08-17  0:00             ` Robert I. Eachus
1999-08-10  0:00     ` Brian Rogoff
1999-08-11  0:00       ` Scientific calculations (was Re: Ada vs Delphi? ) Vladimir Olensky
1999-08-11  0:00         ` Robert Dewar
1999-08-11  0:00         ` Robert Dewar
1999-08-11  0:00           ` Vladimir Olensky
1999-08-13  0:00             ` Gautier
1999-08-13  0:00             ` Robert Dewar
1999-08-13  0:00               ` Brian Rogoff
1999-08-15  0:00               ` Vladimir Olensky
1999-08-15  0:00                 ` Vladimir Olensky
1999-08-11  0:00     ` Ada vs Delphi? Andre Ratel
1999-08-11  0:00       ` Robert Dewar
1999-08-14  0:00         ` Andre Ratel
1999-08-11  0:00       ` Ada vs Component Pascal (was: Ada vs Delphi?) Ted Dennison
1999-08-07  0:00 ` Ada vs Delphi? Gautier
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox