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,bc656fd0afa65ff3 X-Google-Attributes: gid103376,public From: jsa@alexandria (Jon S Anthony) Subject: Re: Alright, now for an Ada '95 question. Date: 1996/08/16 Message-ID: #1/1 X-Deja-AN: 174655134 sender: news@organon.com (news) references: <32134421.31CF@wpllabs.com> organization: Organon Motives, Inc. newsgroups: comp.lang.ada Date: 1996-08-16T00:00:00+00:00 List-Id: In article <32134421.31CF@wpllabs.com> Tom Di Sessa writes: > In Java, I am able to do this comparison: > (target is of Class(Type) Component, and Class Button is is derived from > Component) > > if (target instanceof Button) {...} > > Now, is there a way to do this comparison in Ada '95, if target was of > type Component'Class and Button was a derived type from Component? if Target in Button then...end if; if you wanted to know if Target is "classified" as a button (a direct instance of _some_ type derived directly or indirectly from Button or Button itself) you write if Target in Button'Class then ... end if; /Jon -- Jon Anthony Organon Motives, Inc. 1 Williston Road, Suite 4 Belmont, MA 02178 617.484.3383 jsa@organon.com