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,a92e43963a6b930f X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!postnews.google.com!z8g2000yqz.googlegroups.com!not-for-mail From: Shark8 Newsgroups: comp.lang.ada Subject: Re: N best things about Ada? Date: Mon, 12 Jul 2010 09:14:54 -0700 (PDT) Organization: http://groups.google.com Message-ID: References: <97691fd2-7411-4ccc-bc7b-290aca633cd5@z30g2000prg.googlegroups.com> 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 1278951295 8457 127.0.0.1 (12 Jul 2010 16:14:55 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Mon, 12 Jul 2010 16:14:55 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: z8g2000yqz.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:12344 Date: 2010-07-12T09:14:54-07:00 List-Id: On Jul 12, 9:13=A0am, Robert A Duff wrote: > Shark8 writes: > > People have mentioned packages, non-textual-substitution generics, and > > such. > > But one thing that could come in handy is the named parameters, and it > > is something I like; one of those "little things." > > Yes. =A0It's such a small feature, yet has a huge benefit. > People should use it more often. > > Another small feature: underscores in numeric literals. > One of my pet peeves is when I have to carefully > count the zeroes in 10000000, when it's so easy > to write 10_000_000. > > > "Circle( Radius =3D> 23, X =3D> 28, Y =3D> 14 );" will always be more > > readable than "Circle( 23, 28, 14 );" plus, there's the added benefit > > that 1) changes in parameter-ordering will not impact calls of this > > sort, & 2) the users of the functions/procedures can place the more > > pertinent parameters [to their task] more prominently [e.g. first]. > > Do you have any examples of that last part? =A0That is, examples > where using different parameter orders in different calls > makes the code more readable? > > I think that sort of inconsistency usually makes the code less readable. > I wouldn't mind a rule that says the parameter order has to match > the declaration. =A0(A Legality Rule, not a Name Resolution Rule!) > > - Bob Well, in image-manipulation there are a number of formats that store their information Y, then X. (That is they use column-major order instead of row-major order.) Given a call: "Get_Pixel(K,J);" Is that in familiar X-Y space, or in the image's native Y-X space? Get_Pixel( X=3D> K, Y=3D> J); and Get_Pixel( Y=3D> J, X=3D> K); are unambiguous, and given the situation/problem you may be thinking in one or the other. Let's say you were to want to extend/overload Get_Pixel for a Point- type: Type Point_Type is record Y, X : Integer; end record; You could write it as: Function Get_Pixel( Point : Point_Type ) return Pixel_Value is begin Return Get_Pixel( X=3D> Point.X, Y=3D> Point.Y); end;