!standard 3.9.3(6/2) 07-03-27 AI05-0042-1/00 !standard 12.3(18) !class binding interpretation 07-03-27 !status work item 07-03-27 !status received 07-01-22 !priority Medium !difficulty Medium !qualifier Omission !subject Overriding versus implemented-by !summary ** TBD. !question As part of the introduction of synchronized interfaces, we added the notion of an operation being "implemented by" an entry or a protected operation. This is a concept which is related to overriding, but has subtle differences. Unfortunately, there appears to be quite a few places where the RM says "overridden" and where it should probably have said "overridden or implemented by". Here is an example: package Pkg1 is type Ifc is protected interface; procedure P1 (X : in out Ifc; Y : Integer) is abstract; procedure P2 (X : in out Ifc; Y : Integer) is abstract; end Pkg1; package Pkg2 is protected type Prot is new Pkg1.Ifc with procedure P1 (Y : Integer); entry P2 (Y : Integer); end Prot; end Pkg2; Presumably this code should be legal, but there is no doubt that it violates 3.9.3(6/2), since the operations P1 and P2 inherited by Prot are not overridden. Similarly, 12.3(18) describes how overriding happens in an instance, with interesting differences between the visible part and the private part. Presumably there should be similar words for "implemented by", but there are not. !recommendation (See Summary.) !wording ** TBD. !discussion ** TBD. --!corrigendum 10.1.2(20/2) !ACATS test !appendix From: Pascal Leroy Date: Monday, January 22, 2007 10:30 PM As part of the introduction of synchronized interfaces, we added the notion of an operation being "implemented by" an entry or a protected operation. This is a concept which is related to overriding, but has subtle differences. Unfortunately, there appears to be quite a few places where the RM says "overridden" and where it should probably have said "overridden or implemented by". Here is an example: package Pkg1 is type Ifc is protected interface; procedure P1 (X : in out Ifc; Y : Integer) is abstract; procedure P2 (X : in out Ifc; Y : Integer) is abstract; end Pkg1; package Pkg2 is protected type Prot is new Pkg1.Ifc with procedure P1 (Y : Integer); entry P2 (Y : Integer); end Prot; end Pkg2; Presumably this code should be legal, but there is no doubt that it violates 3.9.3(6/2), since the operations P1 and P2 inherited by Prot are not overridden. Similarly, 12.3(18) describes how overriding happens in an instance, with interesting differences between the visible part and the private part. Presumably there should be similar words for "implemented by", but these words are missing. **************************************************************** From: Tucker Taft Date: Monday, January 22, 2007 10:37 PM I would prefer to solve this by saying that "under such-and-such circumstances, the inherited operation is overridden by an implicit operation that invokes the corresponding entry or protected operation." This way we can continue to say overridden and not get into trouble. Having to spread the "implemented by" wording all over the place seems undesirable. ****************************************************************