comp.lang.ada
 help / color / mirror / Atom feed
From: Peter Chapin <PChapin@vtc.vsc.edu>
Subject: Re: Indentation
Date: Fri, 08 Aug 2014 13:50:04 -0400
Date: 2014-08-08T13:50:04-04:00	[thread overview]
Message-ID: <nvqdnZNNopVTkHjO4p2dnAA@giganews.com> (raw)
In-Reply-To: <6dCdndsS1IpUkXjO4p2dnAA@giganews.com>

On 2014-08-08 13:45, Peter Chapin wrote:

> I favor indenting the aspect. Consider the common case where there are
> multiple declarations at the same level...

I forgot to mention (sorry) that if the aspect's value is complex, such
as often the case for Pre, Post, and other assertions, it is normal for
the aspect itself to span multiple lines. Trying to put it on the same
line as the declaration is crazy in that case and not indenting it
doesn't work well either. Then, for consistency it seems natural to
treat all aspects the same way.

   -- Division returns quotient and remainder.
   procedure Divide (Dividend  : in  Very_Long;
                     Divisor   : in  Very_Long;
                     Quotient  : out Very_Long;
                     Remainder : out Very_Long)
      with
         Depends => (Quotient  => (Dividend, Divisor, Quotient),
                     Remainder => (Dividend, Divisor, Remainder)),
         Pre     => (not Is_Zero(Divisor)) and
                    (Divisor.Digit_Length  = Remainder.Digit_Length) and
                    (Dividend.Digit_Length = Quotient.Digit_Length ) and
                    (Dividend.Digit_Length = 2*Divisor.Digit_Length);

Peter



  reply	other threads:[~2014-08-08 17:50 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-08 16:12 Indentation Victor Porton
2014-08-08 16:32 ` Indentation Adam Beneschan
2014-08-08 17:16   ` Indentation Jeffrey Carter
2014-08-08 17:45     ` Indentation Peter Chapin
2014-08-08 17:50       ` Peter Chapin [this message]
2014-08-08 22:51     ` Indentation Randy Brukardt
2014-08-08 16:38 ` Indentation Pascal Obry
replies disabled

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