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: <37b54801.55334934@news.total.net> (raw)
In-Reply-To: 37b0dddd.0@news.pacifier.com

On Tue, 10 Aug 1999 19:22:01 -0700, "Steve Doiel"
<nospam_steved@pacifier.com> wrote:

>Ray Blaak wrote in message ...
>
>>Actually, in Delphi, this is supposed to be the equivalent of the Ada:
>>
>>   type
>>     length = type double;
>>     weight = type double;
>>
>>On the other hand, I don't know if the compiler actually enforces it, but I
>>believe it is supposed to.
>>
>
>The following compiles with no errors on Delphi 3
>
>procedure TForm1.FormCreate(Sender: TObject);
>  type
>    length = type double;
>    weight = type double;
>  var
>   a : length;
>   b : weight;
>begin
>  a := b;
>end;
>
>But thanks, I had never seen that syntax before.
>
>SteveD

From Delphi 4's Help on _Type compatibility and identity_:

<<<
To understand which operations can be performed on 
which expressions, we need to distinguish several kinds of
compatibility among types and values. These include type 
identity, type compatibility, and assignment-compatibility.
>>>

Help on  _Type identity_:

<<<
Type identity is almost straightforward. When one type 
identifier is declared using another type identifier, without
qualification, they denote the same type. Thus, given the 
declarations

type
  T1 = Integer;
  T2 = T1;
  T3 = Integer;
  T4 = T2;

T1, T2, T3, T4, and Integer all denote the same type. To create
distinct types, repeat the word type in the declaration. For example,

type TMyInteger = type Integer;

creates a new type called TMyInteger which is not identical to
Integer.
>>>

Help on _Type compatibility_:

<<<
Every type is compatible with itself. Two distinct types are
compatible if they satisfy at least one of the following conditions.

  - They are both real types.
  - They are both integer types.
  - One type is a subrange of the other.
  - Both types are subranges of the same type.
  - Both are set types with compatible base types.
>>>
(plus other conditions, less relevant to this discussion).


Help on _Assignment  compatibility_:

<<<
Assignment-compatibility is not a symmetric relation. An 
expression of type T2 can be assigned to a variable of type 
T1 if the value of the expression falls in the range of T1 and
at least one of the following conditions is satisfied.

  - T1 and T2 are of the same type, and it is not a file type or 
     structured type that contains a file type at any level.
  - T1 and T2 are compatible ordinal types.
  - T1 and T2 are both real types.
  - T1 is a real type and T2 is an integer type.
>>>
(plus other conditions, less relevant here).

I hope this shed a bit of light on how various types are
managed in Object Pascal.

	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 [this message]
1999-08-09  0:00     ` Robert Dewar
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     ` Robert Dewar
1999-08-11  0:00       ` Andre Ratel
1999-08-11  0:00         ` Robert Dewar
1999-08-14  0:00           ` Andre Ratel
1999-08-17  0:00             ` Robert I. Eachus
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-09  0:00     ` Aidan Skinner
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           ` Vladimir Olensky
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-13  0:00             ` Gautier
1999-08-11  0:00         ` Robert Dewar
1999-08-11  0:00     ` Ada vs Delphi? Andre Ratel
1999-08-11  0:00       ` Ada vs Component Pascal (was: Ada vs Delphi?) Ted Dennison
1999-08-11  0:00       ` Ada vs Delphi? Robert Dewar
1999-08-14  0:00         ` Andre Ratel
1999-08-07  0:00 ` 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