🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c++
Article #1431

Re: pointer comparisons

#1431
From: John MAX Skaller
Date: Fri, 08 Jan 1993 18:11
57 lines
2788 bytes
In article <1993Jan8.150113.1643@lpi.liant.com> pkt@lpi.liant.com (Scott Turner) writes:
>In article <9300812.4038@mulga.cs.mu.OZ.AU>, fjh@munta.cs.mu.OZ.AU (Fergus James HENDERSON) writes:
>> maxtal>	One consequence: abstract objects can exist.
>> maxtal>
>> maxtal>	Corollary: such objects have states not accessible via
>> maxtal>	the contiguous storage allocated for them.
>> maxtal>	(via virtual function calls)
>> 
>Since John MAX Skaller was drawing inferences from my belief that base
>class subobjects are objects, I want to go on record.  I agree that
>"abstract objects" can exist, but the corollary does not follow.  
>
>In the corollary, John MAX Skaller is referring to a different scenario
>in which the object of abstract class is a base class subobject of a
>fully-constructed enclosing object.  He concludes that the state of the 
>enclosing object is part of the state of the base class subobject.  The
>reasoning has something to do with the additional state being accessible via
>virtual function calls, but there's a big hole in it.  Virtual functions 
>(and non-virtual functions) can access any number of other objects,
>independent of the object for which they are called.

	Um: globally defined objects yes.
	What else?

	Well, you can have a pointer to another object in an object,
and access the other object via the pointer, right?

	But this doesn't count :-) The pointer is part
of the state of the object, and thus so is the object pointed
to (and so on recursively)

	In any case, I will fill in the hole:

	class X {
	public:
		virtual int f()=0;
	};

	class Y : public X {
		int i;
	public:
		int f() {return i;}
		void setint(int j) {i=j;}
	};
 
In this single example, the abstract subobject X in Y has
public states  of measure 'int'. (There are 'int' values).
Yet X has private storage of measure zero.

Where is the hole in this argument? Answer: X has a vtble
pointer!  So I'm wrong. I concede.

-- 
;----------------------------------------------------------------------
        JOHN (MAX) SKALLER,         maxtal@extro.ucc.su.oz.au
	Maxtal Pty Ltd, 6 MacKay St ASHFIELD, NSW 2131, AUSTRALIA
;--------------- SCIENTIFIC AND ENGINEERING SOFTWARE ------------------
Technical Details
Message-ID: <1993Jan8.181100.10727@ucc.su.OZ.AU>
Path: arc1-ca.pugleaf.net!sparky!uunet!munnari.oz.au!metro!extro.ucc.su.OZ.AU!maxtal
References: <1993Jan4.200625.5680@lucid.com> <9300812.4038@mulga.cs.mu.OZ.AU> <1993Jan8.150113.1643@lpi.liant.com>

Show Full Headers
Complete Article Headers
Newsgroups: comp.std.c++
Path: arc1-ca.pugleaf.net!sparky!uunet!munnari.oz.au!metro!extro.ucc.su.OZ.AU!maxtal
From: maxtal@extro.ucc.su.OZ.AU (John MAX Skaller)
Subject: Re: pointer comparisons
Message-ID: <1993Jan8.181100.10727@ucc.su.OZ.AU>
Sender: news@ucc.su.OZ.AU
Nntp-Posting-Host: extro.ucc.su.oz.au
Organization: MAXTAL P/L C/- University Computing Centre, Sydney
References: <1993Jan4.200625.5680@lucid.com> <9300812.4038@mulga.cs.mu.OZ.AU> <1993Jan8.150113.1643@lpi.liant.com>
Date: Fri, 8 Jan 1993 18:11:00 GMT
Lines: 57