Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site wateng.UUCP Path: utzoo!watmath!wateng!pdbain From: pdbain@wateng.UUCP (Peter Bain) Newsgroups: net.lang.pascal Subject: Re: Comparing pointers in Pascal Message-ID: <1946@wateng.UUCP> Date: Thu, 31-Jan-85 16:22:32 EST Article-I.D.: wateng.1946 Posted: Thu Jan 31 16:22:32 1985 Date-Received: Fri, 1-Feb-85 23:43:21 EST References: <3161@ucla-cs.UUCP> <9300010@uiucdcsb.UUCP> Reply-To: pdbain@wateng.UUCP (Peter Bain) Organization: U of Waterloo, Ontario Lines: 35 Summary: In article <9300010@uiucdcsb.UUCP> mcnabb@uiucdcsb.UUCP writes: >It seems to me that the important point here is that Pascal objects to the >use of the value of a pointer in any attempt to ascertain information about >where the "pointee" lies in memory. Pascal does not object to the use of >an assumption that every unique pointer has a corresponding unique scalar >value, which may be sorted, compared, etc. just like any integer. Why not >use "ord (your_pointer)" for the problem above? Pascal permits the conversion ----------------------- (emphasis mine) >of (unique?)* pointers into (unique?)* integers, but tries to prevent direct >arithmetic on pointers because this is clearly implementation-dependent. >BTW, ord (pointer) is a freebie (i.e. NOP) in most Pascal compilers. I asked our local Pascal guru and he said: From watmath!water!watbun!atbowler Thu Jan 31 14:08:04 1985 From: watmath!water!watbun!atbowler Message-Id: <8501311844.AA09296@water> Date: Thu 31 Jan 1985 13:44 To: water!pdbain@wateng Sent: Thu 31 Jan 1985 13:44 Status: RO Re: ORD in Pascal ORD of a pointer is quite definitly not legal. Some Pascal supply a method of producing an integer from a pointer so that you have a printable value. In Pascal-8 this is the ADDR function. This is an extension not part of the language. -peter -- - peter bain ...!{allegra|decvax|clyde|ihnp4 }!watmath!wateng!pdbain hard mail: CCNG, CPH-2369A, University of Waterloo, Waterloo, Ont. Canada N2M 5G4 telephone: (519) 885-1211 x2810