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 04:46:58 PST Path: archiver1.google.com!news2.google.com!newsfeed2.dallas1.level3.net!news.level3.com!crtntx1-snh1.gtei.net!news.gtei.net!newsfeed1.easynews.com!easynews.com!easynews!cyclone1.gnilink.net!peer01.cox.net!cox.net!bigfeed.bellsouth.net!bignumb.bellsouth.net!news.bellsouth.net!bignews3.bellsouth.net.POSTED!84c79386!not-for-mail From: "David C. Hoos" Newsgroups: comp.lang.ada References: Subject: Re: Overloading procedures with Float and Long_Float types MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 Message-ID: X-Trace: bhmkggakljkaanefdbdpiflmbcekedmfhojhikkbagflhcbohelckcjlpffohdieojobnkeflnjnkncfpbfmpgabbjhncebkneplbgdmllahjjmibocpaogbjfbaabpllncnjppckmelagimpkpgbggmkcdoddmf NNTP-Posting-Date: Mon, 08 Mar 2004 07:43:28 EST Date: Mon, 8 Mar 2004 06:46:45 -0600 Xref: archiver1.google.com comp.lang.ada:6137 Date: 2004-03-08T06:46:45-06:00 List-Id: Your procedure specifications raise an interesting question, viz.: What is the result of this procedure? There are no out or "in out" parameters. I would expect something like this to either be a function returning some kind of composite type, or to have one or more out parameters. Now if the "result of the procedure is some kind of action (e.g., on the display), then these could be legitimate procedure specifications, but in that case, it would be better if they were given a name that describes the action taken, As a matter of good practice, I would not use the type "Float", but would explicitly make the two subtypes Short_Float and Long_Float. Some years ago, one of the Ada 83 compilers decided on the occasion of a version upgrade to change Float from Long_Float to Short_Float or vice-versa, I don't remember. I just remember the massive chaos caused by the fact that many programmers (it was a large project) had not used the project-defined types (Short_Real and Long_Real), using Float instead. Thins which worked with the previous compiler version suddenly worked no more. "Luke A. Guest" wrote in message news:pan.2004.03.08.00.17.32.527941@n_o_p_o_r_k_a_n_d_h_a_m.abyss2.demon.co.uk... > Hi, > > Is there a safe way to do this? I'm playing with the adaopengl bindings > and have created the following: > > subtype GLfloat is Float; > subtype GLdouble is Standard.Long_Float; > > procedure Vertex(X, Y, Z : in GLdouble); > procedure Vertex(X, Y, Z : in GLfloat); > > But the compiler (GNAT - Gentoo's 5.02w version) throws up ambiguity > problems. > > Is there a nice way to have these two procedures co-exist without having to > rename them? I have currently renamed them, but this does defeat the whole > purpose of this experiment. > > Thanks, > Luke. > > _______________________________________________ > comp.lang.ada mailing list > comp.lang.ada@ada-france.org > http://www.ada-france.org/mailman/listinfo/comp.lang.ada > >