comp.lang.ada
 help / color / mirror / Atom feed
From: stt@henning.camb.inmet.com (Tucker Taft)
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: <Dw95vJ.Erw.0.-s@inmet.camb.inmet.com> (raw)
In-Reply-To: 32134421.31CF@wpllabs.com


Tom Di Sessa (tdisessa@wpllabs.com) wrote:

: First of all, I want to thank the people who responded to my first(and
: rather unpolite) post.  Thank you.

: 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'Class then 
      ...
   end if;

The above checks whether the tag of Target identifies the type
Button or anything derived from it.  

If we want to know whether the tag identifies Button itself, then:

   if target in Button then
      ...
   end if;

will perform that test.

: -tom :)

-Tuck ;-) ;-)

: | Thomas G. Di Sessa           ||                                  |
: |   WPL Laboratories, Inc.     || Email: tdisessa@wpllabs.com      |
: |   Whitehall Offices, Suite 6 || Voice: 610.658.2362 ext. 227     |
: |   410 Lancaster Avenue       ||   Fax: 610.658.2361              |
: |   Haverford, PA  19041       ||                                  |

-Tucker Taft   stt@inmet.com   http://www.inmet.com/~stt/
Intermetrics, Inc.  Cambridge, MA  USA




      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   ` Jon S Anthony
1996-08-16  0:00   ` Mark A Biggar
1996-08-16  0:00 ` Jon S Anthony
1996-08-16  0:00 ` Tucker Taft [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