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,8d5151b6052512f7 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2004-03-08 09:08:13 PST From: "Luke Guest" Newsgroups: comp.lang.ada References: <404c7dbf.0@entanet> Subject: Re: Overloading procedures with Float and Long_Float types Date: Mon, 8 Mar 2004 16:17:42 -0000 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 NNTP-Posting-Host: 195.74.122.227 Message-ID: <404c9cae.0@entanet> X-Trace: 8 Mar 2004 16:17:50 GMT, 195.74.122.227 Path: archiver1.google.com!news2.google.com!newsfeed2.dallas1.level3.net!news.level3.com!zeus.visi.com!priapus.visi.com!orange.octanews.net!news-out.visi.com!hermes.visi.com!news.octanews.net!feed2.news.rcn.net!rcn!feed.news.tiscali.de!tiscali!newsfeed1.ip.tiscali.net!stargate.gts.cz!news.freedom2surf.net!entanet!195.74.122.227 Xref: archiver1.google.com comp.lang.ada:6156 Date: 2004-03-08T16:17:42+00:00 List-Id: > > Translate calls an imported glTranslate[fd] procedure depending on the > > parameter types. > > > Ah, you're calling a function with no return type which modifies a > hidden matrix, in place -- not a very good software design, IMHO. Hang on. Do you know anything about OpenGL? The matrix is in hardware (or software if the implementation is software) so, it's actually good design as it abstracts out the matrix. > But, if you're binding to software with a poor design, I guess you > have no choice, See above. > > Would this allow the compiler to determine whichprocedure to call based > > purely on numbers? > > > No, it wouldn't -- it would just give a further measure of > compiler-independence -- a good thing. > > Incidentally, in your example, you're not calling "purely with numbers." > you're calling with character representations of numbers which have, in Ada > the type Universal_Real. You need to call with values of the type with > which you wish to select the overloaded procedure to be called. > > To do this, my choice would be to use a qualified expression (RM 4.7), > rather than use a type conversion as others have suggested. > > > Translate(1.0, 0.0, 0.0); -- Is this Short_Float or Long_Float? > > > Neitheer -- it's Universal_Real Ok. Luke.