comp.lang.ada
 help / color / mirror / Atom feed
From: dik@cwi.nl (Dik T. Winter)
Subject: Re: Adding Multiple Inheritance (was: Modernizing Ada)
Date: 15 Oct 89 01:16:06 GMT	[thread overview]
Message-ID: <8469@boring.cwi.nl> (raw)
In-Reply-To: 1989Oct14.121338.1316@paris.ics.uci.edu

In article <1989Oct14.121338.1316@paris.ics.uci.edu> Ron Guilmette <rfg@ics.uci.edu> writes:

I must be extremely dense, but what is wrong if we modify it as follows
(and get proper Ada on the fly)?

(Lines marked + are added; lines marked - are deleted.)

 - 	package type PT_1 is
 +	generic package PT_1 is
 		procedure FOO;
 	end PT_1;
 - 	package type PT_2 is
 +	generic package PT_2 is
 		type PT_2_TYPE is private;
 	private
 		type PT_2_TYPE is ...;
 	end PT_2;
 	with PT_1, PT_2;
 - 	package type PT_3 is
 +	generic package PT_3 is
 - 		inherit PT_1 as PART_1;
 +		PART_1 is new PT_1;
 - 		inherit PT_1 as PART_2;
 +		PART_2 is new PT_1;
 - 		inherit PT_2 as PART_3;
 +		PART_3 is new PT_2;
 		VAR : INTEGER;
 		procedure MEMBER_PROC (I : INTEGER);
 	end PT_3;
 +	with PT3;
 	procedure USE_THEM is
 	begin
 - 		THREE_VAR	: PT_3;
 +		THREE_VAR is new PT_3;
 - 		WEIRD		: PT_3.PART_3.PT_2_TYPE;	-- private type
 +		WEIRD		: THREE_VAR.PART_3.PT_2_TYPE;
 		...
 		THREE_VAR.VAR := 99;
 		THREE_VAR.MEMBER_PROC (99);
 		THREE_VAR.PART_2.FOO := 99;
 	end USE_THEM;

The only distinction is that THREE_VAR is not a variable, but a package.
It is long ago that I did something with Simula-67, and also I do not
follow closely the buzz-word discussion.  In any case what this proposer
attempted to get into Ada 9X is already possible in Ada 83, unless I am
very obtuse indeed.
-- 
dik t. winter, cwi, amsterdam, nederland
INTERNET   : dik@cwi.nl
BITNET/EARN: dik@mcvax

  parent reply	other threads:[~1989-10-15  1:16 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1989-10-13 20:28 Modernizing Ada Erland Sommarskog
1989-10-14 19:13 ` Adding Multiple Inheritance (was: Modernizing Ada) Ron Guilmette
1989-10-14 20:38   ` Edward Berard
1989-10-15 20:57     ` Scott Simpson
1989-10-15  1:16   ` Dik T. Winter [this message]
1989-10-14 20:50 ` Modernizing Ada William Thomas Wolfe, 2847 
1989-10-15  9:54   ` Richard O'Keefe
1989-10-15 17:44     ` COBOL (Was: Modernizing Ada; now moving to comp.lang.misc) William Thomas Wolfe, 2847 
1989-10-16  3:50       ` Richard O'Keefe
1989-10-17  0:46         ` Modernization William Thomas Wolfe, 2847 
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox