Re: Easy question about Character manipulation
- From: "(see below)" <yaldnif.w@xxxxxxxxxxxxxxxx>
- Date: Tue, 30 Jan 2007 02:09:22 +0000
On 30/1/07 01:43, in article 1170121405.6329.89.camel@localhost, "Georg
Bauhaus" <bauhaus@xxxxxxxx> 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
.
- Follow-Ups:
- Re: Easy question about Character manipulation
- From: Georg Bauhaus
- Re: Easy question about Character manipulation
- From: Robert A Duff
- Re: Easy question about Character manipulation
- References:
- Easy question about Character manipulation
- From: mark
- Re: Easy question about Character manipulation
- From: Dmitry A. Kazakov
- Re: Easy question about Character manipulation
- From: Georg Bauhaus
- Re: Easy question about Character manipulation
- From: (see below)
- Re: Easy question about Character manipulation
- From: Georg Bauhaus
- Easy question about Character manipulation
- Prev by Date: Re: Easy question about Character manipulation
- Next by Date: Re: Structured exception information
- Previous by thread: Re: Easy question about Character manipulation
- Next by thread: Re: Easy question about Character manipulation
- Index(es):
Relevant Pages
|