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.7 required=5.0 tests=BAYES_00,MSGID_RANDY autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,577df5d4a0e88785 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2000-12-11 11:50:09 PST Path: supernews.google.com!sn-xit-02!supernews.com!bignews.mediaways.net!newsfeed.media.kyoto-u.ac.jp!newsfeed.mesh.ad.jp!newshub2.rdc1.sfba.home.com!news.home.com!news-peer.gip.net!news.gsl.net!gip.net!howland.erols.net!cpk-news-hub1.bbnplanet.com!news.gtei.net!nntp2.deja.com!nnrp1.deja.com!not-for-mail From: Robert Dewar Newsgroups: comp.lang.ada Subject: Re: constant string array Date: Mon, 11 Dec 2000 19:39:22 GMT Organization: Deja.com - Before you buy. Message-ID: <913ah9$pt6$1@nnrp1.deja.com> References: <910u3p$v9j$1@nnrp1.deja.com> <3A3445A8.8FC404D5@acm.org> <912ut9$fga$1@nnrp1.deja.com> <9132ng$j10$1@nnrp1.deja.com> NNTP-Posting-Host: 205.232.38.240 X-Article-Creation-Date: Mon Dec 11 19:39:22 2000 GMT X-Http-User-Agent: Mozilla/4.61 [en] (OS/2; I) X-Http-Proxy: 1.0 x54.deja.com:80 (Squid/1.1.22) for client 205.232.38.240 X-MyDeja-Info: XMYDJUIDrobert_dewar Xref: supernews.google.com comp.lang.ada:2955 Date: 2000-12-11T19:39:22+00:00 List-Id: In article <9132ng$j10$1@nnrp1.deja.com>, Bjoern.Hofmann@student.fh-nuernberg.de wrote: > for I in keywords'range loop > if ( keywords(I) = input ) then > return True; > end if; > end loop; That indeed is a very classical structure. A couple of comments. No need to put junk parentheses around conditionals. Yes, it looks more natural to C programmers, but there is absolutely no reason to import this style into Ada, it is just noise. My own taste on spaces (which incidentally is what -gnaty enforces :-) is no space after left paren space before left paren if it is a subscript or param list no space before right paren Also in GNAT we avoid the use of the variable I, because in some screen and printer fonts, it is to hard to distinguish from a lower case l or from the digit 1. By the way, this is a case where the warnings about missing return statements that come from GNAT are really quite useful. It is surprisingly easy to forget the "return False" here, and GNAT will remind you. Finally, please be more economonical in quoting stuff. You quoted my entire post quite unnecessarily, without even commenting on it. Quote only the minimum necessary. Sent via Deja.com http://www.deja.com/ Before you buy.