🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

2 total messages Started by Sam Kendall Fri, 12 Sep 1986 21:17
`inherited' keyword
#304
Author: Sam Kendall
Date: Fri, 12 Sep 1986 21:17
36 lines
1992 bytes
I just read a draft of the C+- specification from Apple.  It mentions a
keyword `inherited' as "a proposed addition to C++ that has not yet been
adopted by AT&T," used (in C+-) as follows:

	inherited::virtual_function

This gets you the virtual function belonging to the nearest superclass.
What is not mentioned in the C+- document, and what I would like to
know, is

(1) Does `inherited' work for members other than virtual functions?  It
    certainly should.  If static virtual data items are allowed in C++
    (are they?  I couldn't find anything in the ref man that prohibits
    them) then inherited should work for them, too.

(2) What is the current status of this construct?  Something like it is
    certainly needed to make it easier to do a Smalltalk-like
    send super.

John Rose, a co-worker of mine, came up with a syntax for send super
<same message>.  It is just `continue()' called as a function; used
inside a member function `f', it calls the same thing as
`inherited::f()', and works for non-virtual as well as virtual
functions.

A general point: the `continue' keyword is available and could be used
in place of `inherited'.  It is no less clear than `inherited' --
`inherited' is really the wrong word here, since you use `inherited'
for precisely those things which were NOT inherited.  I suppose
`inherited' is supposed to stand for "would have been inherited".
`continue' can be thought of as meaning "continue up the inheritance
tree".

---
Sam Kendall			sam@Think.COM
Thinking Machines Corp.		ihnp4!think!sam
Re: `inherited' keyword
#306
Author: keith gorlen
Date: Sat, 13 Sep 1986 14:42
13 lines
766 bytes
What is "C+-", and how can I get a copy of the specification?
Thanks!

-- 
---
	Keith Gorlen
	Building 12A, Room 2017
	Computer Systems Laboratory
	Division of Computer Research and Technology
	National Institutes of Health
	Bethesda, MD 20892
	phone:	(301) 496-5363
	uucp:	{decvax!}seismo!elsie!cecil!keith
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads