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-Thread: 103376,1514d4f994aed7aa X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news1.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx01.iad01.newshosting.com!newshosting.com!newspeer.monmouth.com!newsswitch.lcs.mit.edu!nntp.TheWorld.com!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: generic function and overloading Date: Fri, 19 Oct 2007 09:59:43 -0400 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: <1192688972.967825.31130@t8g2000prg.googlegroups.com> NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: pcls6.std.com 1192802386 29256 192.74.137.71 (19 Oct 2007 13:59:46 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Fri, 19 Oct 2007 13:59:46 +0000 (UTC) User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.3 (irix) Cancel-Lock: sha1:jzMRVuieIC9MIO60TFUUiwVLmu8= Xref: g2news2.google.com comp.lang.ada:2501 Date: 2007-10-19T09:59:43-04:00 List-Id: Simon Wright writes: > Robert A Duff writes: >> Nitpick: I'd use a case statement rather than an if statement, here. > > Is this for symmetry or in case some later Ada standard allows a third > option? (I could buy the symmetry/clarity argument, good point). Symmetry/clarity. I like case statements, because they list out all the cases, and the compiler checks that you didn't forget any (so long as you don't say "others"), so the reader of the code sees exactly those cases. And it's order independent. With an if statement, you have to compute in your head when "else" means. No big deal in this case, of course -- it's a bigger deal when there's a chain of "elsif"s. - Bob