Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: utzoo!mnetor!uunet!seismo!gatech!bloom-beacon!husc6!ut-sally!ut-ngp!ayac071
From: ayac071@ut-ngp.UUCP (William T. Douglass)
Newsgroups: comp.lang.pascal
Subject: Re: Pointer problem ?
Message-ID: <5676@ut-ngp.UUCP>
Date: Thu, 23-Jul-87 10:41:32 EDT
Article-I.D.: ut-ngp.5676
Posted: Thu Jul 23 10:41:32 1987
Date-Received: Sat, 25-Jul-87 07:12:23 EDT
References: <254@askja.UUCP>
Reply-To: ayac071@ngp
Distribution: na
Organization: UTexas Computation Center, Austin, Texas
Lines: 33

In article <254@askja.UUCP> frisk@askja.UUCP (Fridrik Skulason) writes:
>Can anyone tell me if this program fragment is supposed to compile or not.
>Turbo Pascal refuses to compile it, but VAX/VMS Pascal does.
>
>program t;
>type 
>  p1 = ^p1;
>  p2 = ^p1;
>  p3 = ^p2;
>
>var p : p1;
>    r : p3;
>begin
>    p := r;
>end.
>-- 
>Fridrik Skulason  Univ. of Iceland, Computing Center
>       UUCP  ...mcvax!hafro!askja!frisk                BIX  frisk

Since p1 is of type "pointer to p1" while p3 is type "pointer to p2", I would
guess that the compiler is justified in rejecting the assignment.  Even though
they point to the same object, the language defines them as differing type,
and prevents the assignment.

I'm curious about you need for "seperate but equal" types here.  Is this purely
a theoritical discussion, or is the above construct necessary in some way.
Obviously, there are ways around this barrier in Turbo Pascal, if the problem
is a real-world one.

Hope I've not just been stating the obvious.

Bill Douglass
ayac071@ngp.UUCP (or whatever)