comp.lang.ada
 help / color / mirror / Atom feed
From: dewar@merv.cs.nyu.edu (Robert Dewar)
Subject: Re: Ada95 Pretty-Printers/Coding styles
Date: 1997/06/26
Date: 1997-06-26T00:00:00+00:00	[thread overview]
Message-ID: <dewar.867339778@merv> (raw)
In-Reply-To: 5orld5$5r8@client2.news.psi.net


Jeff Burns said

<<>These rules [style.ads and style.adb] are by no means trivial,
>they include things like
>
>a) specs required for all procedures
>b) capitalization in a use of an identifier must match the declaration

This is interesting because the second example you give IS trivial, at least
for Ada-ASSURED, and not to just monitor this style but to actually automate
compliance.
>>

Rereading this, I am almost certain that you misread b) to be talking about
a consistent capitalization style. Which is indeed trivial.

This is much more subtle, since it handles visibility and overloading in
GNAT:

     1. procedure q is
     2.    procedure Printf (X : String);
     3.    procedure Printf (X : String) is
     4.    begin
     5.       null;
     6.    end Printf;
     7.
     8.    procedure printf (X : Integer);
     9.    procedure printf (X : Integer) is
    10.    begin
    11.       null;
    12.    end printf;
    13.
    14.    S : String (1 .. 3);
    15.    I : Integer;
    16.
    17. begin
    18.    Printf (S);
    19.    printf (S);
           |
        >>> (style) bad identifier casing, should be "Printf"

    20.    Printf (I);
           |
        >>> (style) bad identifier casing, should be "printf"

    21.    printf (I);
    22. end q;

I chose printf as the name here, because the convention in GNAT when
importing functions from C is to use the C capitalization (we do NOT
have any consistent 100% enforced rule for capitalization -- we have
strict rules, but they are a bit subtle, and beyond the easy reach
of a tool).

Are you really sure that Ada Assured regards the above as "trivial"

And if so, surely enforcing the presence of specs (something that we
really *do* want enforced mechanically) is even more trivial no?





  reply	other threads:[~1997-06-26  0:00 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-06-16  0:00 Ada95 Pretty-Printers/Coding styles Chris Sparks (Mr. Ada)
1997-06-16  0:00 ` Robert Dewar
1997-06-17  0:00   ` Mats.Weber
1997-06-17  0:00     ` Robert Dewar
1997-06-18  0:00       ` Jeff Burns
1997-06-20  0:00         ` Robert Dewar
1997-06-20  0:00         ` nma123
1997-06-20  0:00           ` Jeff Burns
1997-07-03  0:00             ` Shmuel (Seymour J.) Metz
1997-07-09  0:00               ` Robert Dewar
1997-07-11  0:00               ` jeff
1997-07-16  0:00                 ` Robert Dewar
1997-06-17  0:00   ` nickerson
1997-06-21  0:00     ` Robert Dewar
1997-06-25  0:00       ` Jeff Burns
1997-06-26  0:00         ` Robert Dewar [this message]
1997-06-26  0:00           ` Wes Groleau
1997-06-26  0:00         ` Robert Dewar
1997-07-03  0:00       ` Shmuel (Seymour J.) Metz
1997-06-18  0:00   ` Stephen Garriga
  -- strict thread matches above, loose matches on Subject: below --
1997-06-17  0:00 Chris Sparks (Mr. Ada)
1997-06-20  0:00 ` Geert Bosch
1997-06-23  0:00 Chris Sparks (Mr. Ada)
replies disabled

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