comp.lang.ada
 help / color / mirror / Atom feed
From: Samuel Tardieu <sam@ada.eu.org>
To: maxim_senin@bigfoot.com
Subject: Re: Dinamic type checking
Date: 1998/08/24
Date: 1998-08-24T00:00:00+00:00	[thread overview]
Message-ID: <m3n28u746z.fsf@zaphod.enst.fr> (raw)
In-Reply-To: 35E16F1D.2E41DD75@tech.swh.lv

>>>>> "Maxim" == Maxim Senin <maks@tech.swh.lv> 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




       reply	other threads:[~1998-08-24  0:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <35E16F1D.2E41DD75@tech.swh.lv>
1998-08-24  0:00 ` Samuel Tardieu [this message]
1998-08-25  0:00 ` Dinamic type checking Gene Ouye
1998-08-27  0:00 ` Matthew Heaney
replies disabled

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