From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,e5eb8ca5dcea2827 X-Google-Attributes: gid103376,public From: Matthew Heaney Subject: Re: Ada OO Mechanism Date: 1999/06/03 Message-ID: #1/1 X-Deja-AN: 485291433 References: <7i05aq$rgl$1@news.orbitworld.net> <7i17gj$1u1k@news2.newsguy.com> <7icgkg$k4q$1@nnrp1.deja.com> <3749E9EC.2842436A@aasaa.ofe.org> <7id2eo$fag@drn.newsguy.com> <3749FF7D.F17CE16A@aasaa.ofe.org> <374AC676.F7AE0772@lmco.com> NNTP-Posting-Date: Thu, 03 Jun 1999 08:19:22 PDT Newsgroups: comp.lang.ada Date: 1999-06-03T00:00:00+00:00 List-Id: Hyman Rosen writes: > So you mean in Ada, I can write a dot(a,b) which will dispatch on > either a or b? Yes, if A and B have the same specific type. A1, A2 : AT; B1, B2 : BT; AC1, AC2 : T'Class := ; BC1, BC2 : T'Class := ; begin .. := Dot (A, B); -- illegal, detected at compile-time Dot (A1, A2); -- legal Dot (B1, B2); -- legal Dot (AC1, AC2); -- legal, tags compared at run-time Dot (BC1, BC2); -- legal, tags compared at run-time Dot (AC1, BC1); -- legal, but run-time tag check fails, -- and Constraint_Error is raised end;