comp.lang.ada
 help / color / mirror / Atom feed
From: Georg Bauhaus <rm.dash-bauhaus@futureapps.de>
Subject: Re: Real syntax problems in Ada
Date: Thu, 30 Aug 2012 11:12:32 +0200
Date: 2012-08-30T11:12:31+02:00	[thread overview]
Message-ID: <503f2e7f$0$6580$9b4e6d93@newsspool3.arcor-online.net> (raw)
In-Reply-To: <Pine.LNX.4.64.1208291944170.28964@medsec1.medien.uni-weimar.de>

On 29.08.12 19:51, stefan-lucks@see-the.signature wrote:
> On Wed, 29 Aug 2012, Georg Bauhaus wrote:
>
>> On 29.08.12 12:43, stefan-lucks@see-the.signature wrote:
>>>     generic
>>>        type Item is private;
>>>        type Many_Items is array(Positive range <>) of Item;
>>>        with function "<"(Left, Right: Item) return Boolean is <>;
>>>     function Minimum(List: Many_Items) return Item;
>>>
>>> Ask programmers without Ada experience what this is. Most would read this
>>> as a generic declaration of something -- but how many would read this as
>>> the generic declaration of a function called "Minimum"?
>>
>> It is good to see a reference to at least one of the touchstones
>> of readability.
>
> What do you mean by "touchstones of readability"?

I mean programmers reading source text. Someone has mentioned
a controlled experiment. Readers could demonstrate how well
they have understood what they have read.

> In any case. "Normal" declarations have *first* what is declared (e.g.,
> "function", then the name, and then the parameter list. Which is logical
> -- you first need to know what is declared, before you care about the
> parameter list.

Yes, and jumping back and forth means reading is not linear.
There might be readers, though, who would rather see a function
name and its profile declared without something in between,
interrupting the linear flow of thought (about function).

(Incidentally, would context clauses have to come after what is
declared, too? When I see context clauses, I know what to expect.
Arguably, "generic" serves a similar purpose.)

In any case,

   generic function Minimum
       (type Item is private;
        type Many_Items is Array (Natural Range <>) of Item;
        function "<"(Left, Right: Item) return Boolean is <>)
   <<Minimum>> (List: Many_Items) return Item;

might be another way to indicate where the reader may find
the declared function's profile.




  reply	other threads:[~2012-09-07  1:22 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-28  8:13 Real syntax problems in Ada Dmitry A. Kazakov
2012-08-28 10:20 ` Georg Bauhaus
2012-08-28 10:47 ` Niklas Holsti
2012-08-28 11:33   ` J-P. Rosen
2012-08-31 13:35     ` Robert A Duff
2012-08-28 13:27 ` Vasiliy Molostov
2012-08-28 15:23   ` Dmitry A. Kazakov
2012-08-28 20:18     ` Vasiliy Molostov
2012-08-29  7:25       ` Dmitry A. Kazakov
2012-08-29 10:47         ` Vasiliy Molostov
2012-08-29 11:58           ` Dmitry A. Kazakov
2012-08-30 17:38             ` Vasiliy Molostov
2012-08-28 15:14 ` Adam Beneschan
2012-08-28 16:18   ` J-P. Rosen
2012-08-28 16:39   ` Dmitry A. Kazakov
2012-08-28 21:38     ` Randy Brukardt
2012-08-29  6:58       ` Dmitry A. Kazakov
2012-08-29 10:43         ` stefan-lucks
2012-08-29 10:58           ` stefan-lucks
2012-08-29 13:14           ` Niklas Holsti
2012-08-29 17:52             ` stefan-lucks
     [not found]             ` <fbps38pgcuf8fgioptt39s6u7dme1aqs7r@invalid.netcom.com>
2012-09-02 10:16               ` svaa
2012-08-29 13:33           ` Georg Bauhaus
2012-08-29 17:20             ` Jeffrey Carter
2012-08-29 17:51             ` stefan-lucks
2012-08-30  9:12               ` Georg Bauhaus [this message]
2012-08-28 21:49   ` Randy Brukardt
2012-08-28 23:09     ` Adam Beneschan
2012-08-29  7:34     ` Egil Høvik
2012-08-28 19:41 ` Florian Weimer
2012-08-28 20:53   ` Shark8
2012-08-28 21:07     ` Adam Beneschan
2012-08-28 21:25       ` Shark8
2012-08-28 22:59         ` Adam Beneschan
2012-08-29  7:06       ` Dmitry A. Kazakov
2012-08-30 21:08         ` Randy Brukardt
2012-08-30 22:06 ` sbelmont700
2012-08-30 22:34   ` Adam Beneschan
2012-08-30 22:54     ` William Findlay
2012-08-31  7:39     ` Dmitry A. Kazakov
replies disabled

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