comp.lang.ada
 help / color / mirror / Atom feed
From: jsa@alexandria (Jon S Anthony)
Subject: Re: Alright, now for an Ada '95 question.
Date: 1996/08/16
Date: 1996-08-16T00:00:00+00:00	[thread overview]
Message-ID: <JSA.96Aug16152154@alexandria> (raw)
In-Reply-To: 32134421.31CF@wpllabs.com


In article <32134421.31CF@wpllabs.com> Tom Di Sessa <tdisessa@wpllabs.com> 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





      parent reply	other threads:[~1996-08-16  0:00 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-08-15  0:00 Alright, now for an Ada '95 question Tom Di Sessa
1996-08-15  0:00 ` William W Pritchett
1996-08-15  0:00 ` Mike Bishop
1996-08-16  0:00   ` Mark A Biggar
1996-08-16  0:00   ` Jon S Anthony
1996-08-16  0:00 ` Tucker Taft
1996-08-16  0:00 ` Jon S Anthony [this message]
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox