comp.lang.ada
 help / color / mirror / Atom feed
From: Robert Dewar <robert_dewar@my-deja.com>
Subject: Re: constant string array
Date: Mon, 11 Dec 2000 19:39:22 GMT
Date: 2000-12-11T19:39:22+00:00	[thread overview]
Message-ID: <913ah9$pt6$1@nnrp1.deja.com> (raw)
In-Reply-To: 9132ng$j10$1@nnrp1.deja.com

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.



  parent reply	other threads:[~2000-12-11 19:39 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <910u3p$v9j$1@nnrp1.deja.com>
     [not found] ` <slrn9383g6.coa.randhol+abuse@kiuk0156.chembio.ntnu.no>
     [not found]   ` <9138e5$o6a$1@nnrp1.deja.com>
2000-12-11 19:34     ` constant string array Robert Dewar
2000-12-11 21:41 ` Pascal Obry
2000-12-12  2:54   ` Robert Dewar
2000-12-12  2:56   ` Robert Dewar
     [not found] ` <3A3445A8.8FC404D5@acm.org>
     [not found]   ` <912ut9$fga$1@nnrp1.deja.com>
     [not found]     ` <9132ng$j10$1@nnrp1.deja.com>
2000-12-11 19:39       ` Robert Dewar [this message]
2000-12-12  2:31     ` Ken Garlington
2000-12-12  2:53       ` Robert Dewar
2000-12-12  4:39         ` Ken Garlington
2000-12-12  4:56     ` Jeff Carter
2000-12-12 20:57       ` Beard, Frank
2000-12-12 23:05         ` Jeff Carter
2000-12-13  0:37           ` Robert Dewar
2000-12-13  0:36         ` Robert Dewar
2000-12-13  0:39         ` Robert Dewar
2000-12-13  2:02           ` Beard, Frank
2000-12-13  2:33             ` Robert Dewar
2000-12-13  2:55               ` Beard, Frank
2000-12-13  4:00                 ` Ken Garlington
2000-12-13 13:38                   ` Bad coding standards Marc A. Criley
2000-12-13 13:54                     ` Ken Garlington
2000-12-13 20:55                     ` David Emery
2000-12-14 13:07                       ` Robert Dewar
2000-12-14 14:21                         ` Ken Garlington
2000-12-15  0:08                           ` Wayne Magor
2000-12-15  1:40                             ` Ken Garlington
2000-12-15  3:18                         ` DuckE
2000-12-15  4:45                           ` Ed Falis
2000-12-15 15:44                           ` Robert C. Leif, Ph.D.
2000-12-15 16:34                             ` Ted Dennison
2000-12-16  6:08                               ` Robert C. Leif, Ph.D.
2000-12-16  1:16                             ` Robert Dewar
2000-12-16  1:19                             ` Robert Dewar
2000-12-17  5:49                               ` Robert C. Leif, Ph.D.
2000-12-17  8:24                                 ` Robert Dewar
2000-12-15 15:56                       ` Charles H. Sampson
2000-12-15 20:43                         ` Wayne Lydecker
2000-12-16  4:31                           ` Ken Garlington
2000-12-16 11:36                           ` Robert Dewar
2000-12-15 21:36                         ` tmoran
2000-12-15 18:41 ` constant string array Freelancer
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox