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 autolearn=ham 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 02:35:39 PST Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!news.tele.dk!small.news.tele.dk!128.39.3.168!uninett.no!not-for-mail From: Reinert Korsnes Newsgroups: comp.lang.ada Subject: Re: (elementary question) Test on type ? Date: Tue, 4 Sep 2001 11:29:12 +0200 Organization: UNINETT news service Message-ID: <9n279a$1ua$1@snipp.uninett.no> References: <9n24g4$17q$1@snipp.uninett.no> NNTP-Posting-Host: sthrkou.ffi.no Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit X-Trace: snipp.uninett.no 999596138 1994 193.156.99.159 (4 Sep 2001 09:35:38 GMT) X-Complaints-To: news-abuse@uninett.no User-Agent: KNode/0.4 Xref: archiver1.google.com comp.lang.ada:12676 Date: 2001-09-04T11:29:12+02:00 List-Id: David C. Hoos, Sr. wrote: > You would say instead: > > if X in Integer then I get error message "incompatible types"..... reinert > > See section 4.5.2 of the Ada Language Reference Manual. > > ----- Original Message ----- > From: "Reinert Korsnes" > Newsgroups: comp.lang.ada > To: > Sent: September 04, 2001 3:41 AM > Subject: (elementary question) Test on type ? > > > Hi, > > is it possible in Ada to test on type ? (did not manage to find out) > > > Assume: > > > -- specification : > generic > type T is (<>); > function F(X : T) return Float; > > --body : > > function F(X : T) return Float is > begin > > if Type(X) = Integer then ?????? > something... > > I := integer(X) ???? > > > end; > > --application prog: > > function F1 is new F(T => Integer); > > > reinert > -- http://home.chello.no/~rkorsnes