Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83 (MC830713); site vu44.UUCP Path: utzoo!watmath!clyde!cbosgd!ihnp4!zehntel!hplabs!hao!seismo!mcvax!vu44!gijs From: gijs@vu44.UUCP (Gijs Mos) Newsgroups: net.lang,net.lang.pascal Subject: Re: Comparing pointers in Pascal Message-ID: <575@vu44.UUCP> Date: Wed, 16-Jan-85 20:33:42 EST Article-I.D.: vu44.575 Posted: Wed Jan 16 20:33:42 1985 Date-Received: Mon, 21-Jan-85 03:53:54 EST References: <3161@ucla-cs.ARPA> <746@loral.UUCP> <269@topaz.ARPA> <3181@utah-cs.UUCP> Organization: VU Informatica, Amsterdam Lines: 20 Xref: watmath net.lang:1278 net.lang.pascal:203 > [] 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. Since many pascal implementations tend to reclaim unused heap space it's useless to try to compare pointers anyway. You are never shure that an object A created with new after an object B is always higher/lower in memory then B. Consider the following example: new(x); new(b); dispose(x); new(a); Many implementations will re-use the space freed with the dispose of x for the object a points to. Gijs Mos {seismo,decvax,philabs}!mcvax!vu44!gijs