comp.lang.ada
 help / color / mirror / Atom feed
From: "(see below)" <yaldnif.w@blueyonder.co.uk>
Subject: Re: Easy question about Character manipulation
Date: Tue, 30 Jan 2007 02:09:22 +0000
Date: 2007-01-30T02:09:22+00:00	[thread overview]
Message-ID: <C1E45952.91CF6%yaldnif.w@blueyonder.co.uk> (raw)
In-Reply-To: 1170121405.6329.89.camel@localhost

On 30/1/07 01:43, in article 1170121405.6329.89.camel@localhost, "Georg
Bauhaus" <bauhaus@arcor.de> wrote:

>> On the contrary, this *exactly* like (ISO Standard) Pascal.
> 
> I don't think so, if a Pascal compiler is supposed
> to determine "the same type" (exact same type) by looking
> at the definition, not the name. Otherwise two compilers
> claiming to support ISO Pascal are broken:

Trust me, I was one of the team that wrote the standard. 8-)

> program p;
> 
> type 
>    T = 1 .. 3;
>    S = 1 .. 3;
> var
>    x : T;
>    y : S;
> begin
>    x := y;   { fine in Pascal }
> end.
> 
> This program seems to be Standard Pascal, and compiles.

This does not imply that S and T are considered to be the same type.
(See below.)

> The corresponding Ada program will not compile:
> 
> procedure p is
>    type T is range 1 .. 3;
>    type S is range 1 .. 3;
>    x : T;
>    y : S
> begin
>    x := y; -- not the same type, compilation error
> end;

This is not a matter of type equivalence,
it is a matter of automatic type conversion on assignment
(assignment compatibility), and that IS unlike Ada, of course.
 
It would work just as well in Pascal if S were 1..3 and T were 2..4,
and these are obviously not the same type.

(There are further classes of compatibility in other Pascal contexts.)

-- 
Bill Findlay
<surname><forename> chez blueyonder.co.uk





  reply	other threads:[~2007-01-30  2:09 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-29 20:01 Easy question about Character manipulation mark
2007-01-29 20:17 ` Dmitry A. Kazakov
2007-01-29 21:30   ` Georg Bauhaus
2007-01-30  0:51     ` (see below)
2007-01-30  1:43       ` Georg Bauhaus
2007-01-30  2:09         ` (see below) [this message]
2007-01-30 20:18           ` Robert A Duff
2007-01-30 21:07             ` (see below)
2007-01-30 22:05               ` Robert A Duff
2007-01-31  3:07                 ` (see below)
2007-01-31 18:11               ` Jeffrey R. Carter
2007-01-31 21:02                 ` (see below)
2007-01-31 23:01                   ` Robert A Duff
2007-01-31 23:23                     ` (see below)
2007-01-31 23:46                   ` Jeffrey R. Carter
2007-02-01  0:07                     ` (see below)
2007-01-30 21:08             ` Dmitry A. Kazakov
2007-01-31 16:54           ` Georg Bauhaus
2007-01-31 17:24             ` (see below)
2007-01-30 12:28 ` Martin Krischik
2007-01-30 17:50   ` Jeffrey R. Carter
2007-01-30 20:24     ` Robert A Duff
2007-01-30 21:12       ` Dmitry A. Kazakov
2007-01-30 21:39         ` Robert A Duff
2007-01-31 10:55           ` Dmitry A. Kazakov
2007-01-31 11:22           ` Martin Krischik
2007-01-31 18:14       ` Jeffrey R. Carter
replies disabled

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