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,43b6c5f649185450 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-01-04 04:40:02 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!news.algonet.se!algonet!news-stob.telia.net!telia.net!194.22.194.4.MISMATCH!masternews.telia.net.!newsb.telia.net.POSTED!not-for-mail From: David Holm Subject: Re: generic type identification Newsgroups: comp.lang.ada References: User-Agent: KNode/0.7.1 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit Message-ID: <_BAR9.4055$FF4.251139@newsb.telia.net> Date: Sat, 04 Jan 2003 12:39:22 GMT NNTP-Posting-Host: 217.208.105.23 X-Complaints-To: abuse@telia.com X-Trace: newsb.telia.net 1041683962 217.208.105.23 (Sat, 04 Jan 2003 13:39:22 CET) NNTP-Posting-Date: Sat, 04 Jan 2003 13:39:22 CET Organization: Telia Internet Xref: archiver1.google.com comp.lang.ada:32525 Date: 2003-01-04T12:39:22+00:00 List-Id: tmoran@acm.org wrote: >> The alternative, I guess, would be to not use a generic package and >> instead overload Some_Procedure with those types that I want to be able >> to use but this will clutter the specification file =(. > Not to mention that you will have to add to package Example every time > someone wants to use your Some_Procedure with a new type. > Why do you want Some_Procedure to know what type it was instantiated > with? How much does it need to know about that type - just whether it's > integer or float or modular, or does it need to know whether it's > My_Pleasant_Centigrade or not? It is a thick binding to OpenGL. In case you have never seen the OpenGL API it has one procedure for every type you can access it with. For instance, glVertex has 24 different declarations depending on whether you use (C) floats, doubles, integers, shorts etc and whether your send it an array of 2, 3 or 4 coordinates with any of these types. I was hoping to be able to create one interface for this in Ada (possibly by using generic instead of overloading every procedure). But then I would need to be able to identify which type is used in a call to say AdaGL.Primitives.Vertex(some array) so that I know which binding to the C library I should convert the parameters to and then call. Perhaps I could go with something like this? http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&selm=8903101703.AA04518%40ti.com //David Holm