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,ef17a77490cf84e0 X-Google-Attributes: gid103376,public From: Matthew Heaney Subject: Re: Dinamic type checking Date: 1998/08/27 Message-ID: #1/1 X-Deja-AN: 385198293 Sender: matt@mheaney.ni.net References: <35E16F1D.2E41DD75@tech.swh.lv> NNTP-Posting-Date: Thu, 27 Aug 1998 00:47:18 PDT Newsgroups: comp.lang.ada Date: 1998-08-27T00:00:00+00:00 List-Id: Maxim Senin writes: > in Java: in Ada: > class A {} type A is tagged private; > class B extends A {} type B is new A with private; > ... ... > B b; objectOfTypeB : B; > ... ... > if (b instanceof A) { if (objectOfTypeB'Tag = A'Tag) then > ... -- this will not work 'cos "=" produces exact match > } end if; Use a membership test: if objectOfTypeB in A'Class then ...;