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.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,5b7ee26df9f9c357 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!postnews.google.com!b35g2000yqi.googlegroups.com!not-for-mail From: Shark8 Newsgroups: comp.lang.ada Subject: Re: OpenGL in Ada Date: Mon, 12 Jul 2010 07:17:02 -0700 (PDT) Organization: http://groups.google.com Message-ID: References: NNTP-Posting-Host: 174.28.205.195 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1278944223 16163 127.0.0.1 (12 Jul 2010 14:17:03 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Mon, 12 Jul 2010 14:17:03 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: b35g2000yqi.googlegroups.com; posting-host=174.28.205.195; posting-account=lJ3JNwoAAAAQfH3VV9vttJLkThaxtTfC User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.1.10) Gecko/20100504 Firefox/3.5.10 ( .NET CLR 3.5.30729; .NET CLR 4.0.20506),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:12340 Date: 2010-07-12T07:17:02-07:00 List-Id: On Jul 11, 2:46=A0pm, a...@att.net wrote: > In , tmo...@acm.org writes: > >> >>> =A0Procedure Color =A0 =A0( red, green, blue : in double ); > >> >>> =A0Procedure Color =A0 =A0( red, green, blue : in float ); > > >> One problem you'll have is if a user wants to make a call with all > >> literals, i.e. Color(1, 2, 3) or Color(1.0, 2.0, 3.0), the compiler > >> won't know which version to use. =A0The best solution I've found (besi= des > >> making users specify a type) > > >And what's wrong with requiring the user to be unambiguous by specifying > >a type? =A0It's unlikely there will be a lot of calls with all literals > >(unless generated by some program) so it shouldn't be onerous. =A0And > >"Float'(1.0)" is clearer to the person reading the code five years > >from now than "Color_F". > > What your are forgetting is the openGL is a specification from the openGL > group ( opengl.org ), it is just like the Ada RM in that respect. =A0For = a > program or package, to be classified as openGL it must comply with "openG= L > group" openGL specification. =A0Changing any API part nullify the use of > openGL in any part of your system. > > So, adding or altering any definitions about the given API must comply wi= th > the openGL specification. Names of the API functions and procedures with > the API defined types are set by this openGL group. That seems, on its face, to contradict BrianG's claim: > What you have is a way to do it, but that's not what the OP posted. He h= ad > all procedures named Color, so the user doesn't need to worry about > implementation. (If I use Color for Double and want to change my program= to > use Float, I have to change the names of all calls, even if I use calls w= here > the compiler could determine what I want - and not just calls to Color, m= any > routines would have the same issue.) This is also what the OpenGL > documentation implies should be done in a language like Ada. But, if he's correct in this earlier post: > (I've tried starting a similar effort, but never got very far. I was usi= ng > the OpenGL "red book" as a basis; I find it interesting that the OpenGL > definition recognizes that "some languages like Ada and C++" could implem= ent > names this way, but every Ada library I've seen follows the C naming sche= me.) Then my renaming (to get rid of the gl- prefix and parameter-type- postfix) and overloading them all is a valid OpenGL API. > > visitwww.opengl.org > for more information on openGL and the "openGL group" > > Also, you may find the API specifications predefined with examples in C t= hat > you can alter to Ada there as well.