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.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,6828bb58accfa664,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-11-10 12:34:27 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!arclight.uoregon.edu!wn13feed!wn14feed!wn12feed!worldnet.att.net!204.127.198.204!attbi_feed4!attbi_feed3!attbi.com!sccrnsc03.POSTED!not-for-mail From: Caffeine Junky Subject: Conditional types? Newsgroups: comp.lang.ada User-Agent: Pan/0.11.3 (Unix) Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Comment-To: ALL Message-ID: NNTP-Posting-Host: 12.241.145.39 X-Complaints-To: abuse@attbi.com X-Trace: sccrnsc03 1036960466 12.241.145.39 (Sun, 10 Nov 2002 20:34:26 GMT) NNTP-Posting-Date: Sun, 10 Nov 2002 20:34:26 GMT Organization: AT&T Broadband Date: Sun, 10 Nov 2002 20:34:26 GMT Xref: archiver1.google.com comp.lang.ada:30691 Date: 2002-11-10T20:34:26+00:00 List-Id: I've been trying to figure out if theres a way in Ada(or any other language for that matter) to test if data is of a certain type without going into low level bit fiddling and Assembler instructions. i.e. Hypothetical situation... You're recieving data through a function call or a procedure of some sort, but the source for some reason does not indicate explicitly what type of data it is. However, since you do have some limited knowledge of the system you can safely assume it's passing either a float, an integer, or an unsigned 32 bit integer. Is there a way do this in Ada ... procedure get(bar : in undefined) -- Note that this does not return or -- output any data if datatype(bar) is unsigned_32 then declare foo : Unsigned_32 := bar; begin -- process data here end; else if datatype(bar) is Integer then declare foo : Integer := bar; begin -- process data here end; else if datatype(bar) is float then declare foo : float := bar; begin -- process data here end; end if; end get; Any tips? Caffiene Junky