Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.1 6/24/83; site utah-cs.UUCP
Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!godot!harvard!seismo!utah-cs!b-davis
From: b-davis@utah-cs.UUCP (Brad Davis)
Newsgroups: net.lang,net.lang.pascal
Subject: Re: Comparing pointers in Pascal
Message-ID: <3181@utah-cs.UUCP>
Date: Tue, 15-Jan-85 12:28:23 EST
Article-I.D.: utah-cs.3181
Posted: Tue Jan 15 12:28:23 1985
Date-Received: Wed, 16-Jan-85 05:49:39 EST
References: <3161@ucla-cs.ARPA> <746@loral.UUCP> <269@topaz.ARPA>
Reply-To: b-davis@utah-cs.UUCP (Brad Davis)
Organization: Univ of Utah CS Dept
Lines: 23
Xref: watmath net.lang:1261 net.lang.pascal:192

[]
In response to using ORD() on a pointer:

There is no claim in Pascal that integers and pointers occupy the
same space.  If the pointer is larger than an integer then the 
comparison will be wrong.  Even if a pointer and an integer occupy
the same space the pointer may become a negative integer so that
the comparison ord(p1) < ord(p2) will not tell you if p1 is in
lower memory than p2. Since pointers may not be real addresses
anyway the comparison would have no relation to where the data was
stored.

In response to pointing at staticly declared objects:

As opposed to C, Pascal has no static memory space (an implementation
may store globals as such but the language not have such a concept), 
all declared variables are automatics i.e. they are allocated as part 
of the stack frame.  Pointing at stack spaces is one of the most common 
errors we find with programmers in their first large project in C.  This
capability (and danger) would be contrary to the philosophy behind Pascal.
(Try to find a philosophy for C.)

							Brad Davis