Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!samsung!sdd.hp.com!uakari.primate.wisc.edu!aplcen!uunet!mcsun!unido!tub!tubopal!coma.uucp!axel From: axel@coma.uucp (Axel Mahler) Newsgroups: comp.object Subject: Inheriting from generic classes Message-ID: <1994@opal.tubopal.UUCP> Date: 4 Oct 90 17:20:39 GMT Sender: news@tubopal.UUCP Reply-To: axel@coma.uucp (Axel Mahler) Organization: Technical University of Berlin, Germany Lines: 49 Nntp-Posting-Host: coma.cs.tu-berlin.de Originator: axel@coma.cs.tu-berlin.de I am wondering about the semantics of inheritance from generic classes. More precisely, it's the semantics of constrained genericity. Consider the following situation: class C [P : T1] This notation is not intended to resemble any existing programming language. I think some new version of Eiffel will (has already ?) introduce this notation for constrained genericity. The meaning is: declare a class C with a formal generic parameter P that is constrained to class T1, i.e. any actual parameter that will substitute P must be "kind-of" T1. Now let: class D [Q : T2] inherit C and finally: classdef E D[T3] The latter construct shall denote a generic instantiation of generic class D with T3 as actual parameter (yielding a "real" class E). Do you think, this scenario makes any sense ? How shall both constraints be interpreted ? I came up with the opinion that the described setup does make sense if one adds both constraints, i.e.: T3 is-subclass-of T1 AND T3 is-subclass-of T2 I had an argument with a couple of collegues the other day, who insisted that T2 should be a subclass of T1. One collegue proposed that the generic paramter lists of C and D should be semantically concatenated, so that in the case of the generic instantiation two actual paramter classes shall be provided: classdef E D[T1a, T2a] and T1a, and T2a satisfying the individual constraints of C and D respectively. Unfortunately, there are only few discussions of genericity and inheritance. What do you think ?? cheers, Axel Mahler -- =============================================================================== Axel Mahler, Tech.Univ. Berlin E-Mail: axel@coma.cs.tu-berlin.de (axel@db0tui62.bitnet)