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: Samuel Tardieu Subject: Re: Dinamic type checking Date: 1998/08/24 Message-ID: #1/1 X-Deja-AN: 384225488 References: <35E16F1D.2E41DD75@tech.swh.lv> Mail-Copies-To: sam@ada.eu.org To: maxim_senin@bigfoot.com Content-Type: text/plain; charset=US-ASCII Organization: TELECOM Paris Mime-Version: 1.0 (generated by tm-edit 7.108) Newsgroups: comp.lang.ada Date: 1998-08-24T00:00:00+00:00 List-Id: >>>>> "Maxim" == Maxim Senin writes: Maxim> Can I do something like Java's "instanceof" operator does, Maxim> i.e. can I check the object to be of type (or descendent of Maxim> type)? If A is an object of a tagged type and B is a tagged type, you can do: if A in B'Class then -- Test that the type of A is of type B or -- of a type that inherits (directly or -- indirectly) from type B if A in B then -- Test that A is of type B The second one works even for non-tagged types. Sam -- Samuel Tardieu -- sam@ada.eu.org