From: ncohen@watson.ibm.com (Norman H. Cohen)
Subject: Re: Q: Dynamically testing type of any variable
Date: 1996/06/05
Date: 1996-06-05T00:00:00+00:00 [thread overview]
Message-ID: <4p4c3p$tc5@watnews1.watson.ibm.com> (raw)
In-Reply-To: 4ov0miINN99m@snoopy.cis.ohio-state.edu
In article <4ov0miINN99m@snoopy.cis.ohio-state.edu>,
dgibson@snoopy.cis.ohio-state.edu (david scott gibson) writes:
|> Hi. Is there any way to determine the type of an arbitrary Ada95
|> variable at runtime? Inside a generic unit, I'd like to test if a
|> generic formal has been instantiated with a scalar type, and then if
|> so, initialize it to some valid representation. It doesn't appear
|> that the 'Class or 'Valid attributes help much since neither is
|> defined for all types. Also, I'd prefer not using any exception
|> trickery to deal with this. Any ideas?
This is a peculiar requirement. Can you give us a better idea of what
you are trying to accomplish?
If your template is doing things with objects of your generic formal type
that are improper for uninitialized scalars, and if a particular
invocation of a particular instance actually does these things to
uninitialized scalars, why do you want to mask the error behind an
arbitrary "valid" value?
--
Norman H. Cohen ncohen@watson.ibm.com
prev parent reply other threads:[~1996-06-05 0:00 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
1996-06-03 0:00 Q: Dynamically testing type of any variable david scott gibson
1996-06-05 0:00 ` Norman H. Cohen [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