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=-0.4 required=5.0 tests=AC_FROM_MANY_DOTS,BAYES_00 autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,1ce805592e46d231 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-09-04 08:05:38 PST Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!newsfeeds.belnet.be!news.belnet.be!psinet-eu-nl!psiuk-p4!uknet!psiuk-n!news.pace.co.uk!nh.pace.co.uk!not-for-mail From: "Marin David Condic" Newsgroups: comp.lang.ada Subject: Re: (elementary question) Test on type ? Date: Tue, 4 Sep 2001 10:48:41 -0400 Organization: Posted on a server owned by Pace Micro Technology plc Message-ID: <9n2pka$e44$1@nh.pace.co.uk> References: <9n24g4$17q$1@snipp.uninett.no> <9n279a$1ua$1@snipp.uninett.no> <3B94B4B4.CE1955D6@nbi.dk> <9n2ctk$36v$1@snipp.uninett.no> <9n2l16$bqv$1@nh.pace.co.uk> NNTP-Posting-Host: dhcp-200-133.miami.pace.co.uk X-Trace: nh.pace.co.uk 999614922 14468 136.170.200.133 (4 Sep 2001 14:48:42 GMT) X-Complaints-To: newsmaster@news.cam.pace.co.uk NNTP-Posting-Date: 4 Sep 2001 14:48:42 GMT X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Xref: archiver1.google.com comp.lang.ada:12701 Date: 2001-09-04T14:48:42+00:00 List-Id: O.K. O.K. O.K. - You got me there. But that's sort of a deeper technical area than what I think the original question was aimed at. (Sounded more like a newbie with a more basic question than might be answered by tagged records) I'd agree that if Ada were more of a "purely OO language" it probably would have started deriving all of its types from some base type & generic parameters might have had more adaptable characteristics. Its been frustrating for me to deal with certain math-oriented packages where I've essentially had to create more-or-less identical code for integer types, fixed types, floating types and decimal types. Lots of math can be done sticking only to the operations common to all of the above and if they were all derived from some class called "Scalar" (or had a suitable generic formal) you could get there a lot easier. MDC -- Marin David Condic Senior Software Engineer Pace Micro Technology Americas www.pacemicro.com Enabling the digital revolution e-Mail: marin.condic@pacemicro.com Web: http://www.mcondic.com/ "Ted Dennison" wrote in message news:le5l7.3173$4z.4905@www.newsranger.com... > > Actually it is doable, if the type in question is a tagged type. In that case > you can easily do something like: > > if Object_A in Parent_Type_X'class then .... > > The reason this won't work for Integer is that Integer isn't tagged. Thus: > > 1) You can't use 'Class on it (or a subtype of it). > 2) You can't pass it into a routine that can also take other types for the same > parameter. > > I suppose you would be able to do that with Integer if Ada had a type system > where every type was derived from some common root type. I think there are some > languages out there that work that way. Ada just isn't one of them. >