comp.lang.ada
 help / color / mirror / Atom feed
From: Robert A Duff <bobduff@shell01.TheWorld.com>
Subject: Re: Other Ada Standards (was Re: SIGada Conference)
Date: 28 Dec 2003 14:59:05 -0500
Date: 2003-12-28T14:59:05-05:00	[thread overview]
Message-ID: <wccbrpslnna.fsf@shell01.TheWorld.com> (raw)
In-Reply-To: bsmfdi$d8f2i$3@ID-77047.news.uni-berlin.de

"Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> writes:

> Robert A Duff wrote:
> 
> > "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> writes:
> > 
> >> Just allow "with" everywhere "use" is allowed. Then "use A.B" could
> >> literally imply "with A.B".
> > 
> > That would defeat the whole purpose of with_clauses.  The point of
> > with's is that you can see a summary of the interconnections between
> > compilation units all in one spot, right up front.
> 
> Should a reader see these interconnections? Couldn't we bring the famous "it
> is a question of a good IDE" argument here?

Well, I suppose the IDE argument can always be used.  I'm a language
designer at heart, so I like like to provide readability via language
design.  I.e., I have a hammer, so I want to use my hammer.  ;-)

Maybe we should write programs in assembly language, and have a fancy
IDE that can figure out the design from the code, and make it all
readable and wonderful?  Seems like a bad approach to me.

I like the idea of an IDE (or just good-old Emacs) providing
*writeability*.  But usually, *readability* should be made easier by
language design, not by postulating fancy IDE's.

On the other hand, I have nothing against an IDE that can, say, produce
a graphical picture of the interdependencies among packages.

But on the other other hand, I want what I see on the screen (or paper)
to be readable.  I don't want to click on stuff to see what's going on
-- just looking at what's in front of me is far more efficient.

> > The most important aspects of a software design are: what are the
> > pieces, and which pieces interact with which other pieces.  Scattering
> > this information all over the place is a bad idea, IMHO.
> 
> Again, true. But it is not compilation units which interacts, but rather 
> smaller objects.

With clauses give the "big picture".  I don't want to click on some IDE
thingy that tells me this thing depends on everything else under the
Sun.  I want to see the overall design, more or less.

> > Why bother with with at all?  You might as well just say that any
> > reference to a name automatically imports that name, as necessary.
> > There are other languages that do something like that.
> 
> Absolutely. I think that the compilers are enough mature to go without with.
> Can we go so far? [with-ing generic children is really boring] Will
> implying of "with" be backward compatible?

I doubt if it could be made to work in the context of Ada, but other
languages have done it (Java, for example).  But I don't care to think
about that -- I was *not* seriously suggesting that eliminating
with_clauses is a good idea!

> >> So:
> >> 
> >> package A is
> >>    package B is
> >>    ...
> >> end A;
> >> 
> >> with A.B; -- This is OK, implies with A, as usual
> >> package C is
> >>    with A.B; -- This is also OK
> >> 
> >> BTW, this would give numerous addititional possibilities:
> >> 
> >> package X is
> >>    -- public things
> >> 
> >> private
> >>    with Something_Implementational.Not_To_Expose;
> > 
> > It is indeed unfortunate that you can't have with's that apply only to
> > the private part.  IMHO, the language would be better if the with's
> > appeared *inside* the package, either at the start of the visible part,
> > or the start of the private part, or the start of the body.  But I want
> > them together, up front (for each of these parts) -- not scattered all
> > over.
> 
> To enforce this we would need to formally define "start-of-a-part" in RM.

Not too hard.  For example, if the syntax were designed from scratch, it
would not be hard to have an "import clause" that can only appear at the
appropriate place.  Even without that, it's not too hard -- we already
require that "pragma Pure" appear "at the beginning", and there's some
verbiage in the RM to define what that means.

> IMO it is easier to allow it everwhere with a stylistic note that it is
> better to place it as early as possible in the text.

The problem with that is that you and I might have different ideas as to
where it's appropriate to put with_clauses.  So if I'm reading your
code, I have to search all over, because I can never be sure you
interpret the "stylistic note" the same way I do.  Better to define it
formally, and require the compiler to check it, so you and I can
understand each other's code.

- Bob



  reply	other threads:[~2003-12-28 19:59 UTC|newest]

Thread overview: 80+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <468D78E4EE5C6A4093A4C00F29DF513D04B82B08@VS2.hdi.tvcabo>
2003-12-17  1:01 ` SIGada Conference Stephen Leake
2003-12-17  3:19   ` Robert I. Eachus
2003-12-18  6:55     ` Robert C. Leif
2003-12-18 15:23       ` Other Ada Standards (was Re: SIGada Conference) Robert I. Eachus
2003-12-18 18:27         ` Robert A Duff
2003-12-19  7:38           ` Robert I. Eachus
2003-12-19 23:10             ` Robert A Duff
2003-12-19  8:51           ` Russ
2003-12-19 17:03             ` tmoran
2003-12-20  0:43               ` Russ
2003-12-19 23:18             ` Robert A Duff
2003-12-20  7:05               ` Russ
2003-12-20  9:06                 ` Nick Roberts
2003-12-20 17:43                   ` Robert I. Eachus
2003-12-22  0:07                     ` Russ
     [not found]                       ` <bfcib1-r43.ln1@beastie.ix.netcom.com>
2003-12-22 17:10                         ` Robert I. Eachus
2003-12-22 18:25                           ` Larry Hazel
2003-12-23 16:55                             ` Chad R. Meiners
2003-12-24 13:17                               ` Marin David Condic
2003-12-24 14:57                                 ` Robert A Duff
2003-12-25  3:26                                   ` Marin David Condic
2004-01-03 19:03                                   ` Pascal Obry
2003-12-24 20:16                                 ` Russ
2003-12-24 21:41                                   ` Robert A Duff
2003-12-25  2:51                                     ` Robert I. Eachus
2003-12-25  3:42                                     ` Marin David Condic
2003-12-25  6:35                                       ` Russ
2003-12-25 12:34                                         ` Georg Bauhaus
2003-12-25 15:38                                           ` Marin David Condic
2003-12-26 20:09                                             ` Russ
2003-12-27  3:39                                               ` Georg Bauhaus
2003-12-27  7:40                                                 ` Russ
2003-12-27 11:18                                                   ` Georg Bauhaus
2003-12-28  5:56                                                     ` Russ
2003-12-27 11:24                                                 ` Dmitry A. Kazakov
2003-12-27 12:21                                                   ` Georg Bauhaus
2003-12-28 11:44                                                     ` Dmitry A. Kazakov
2003-12-28 13:59                                                       ` Georg Bauhaus
2003-12-28 19:43                                                         ` Robert A Duff
2003-12-28 20:47                                                           ` Dmitry A. Kazakov
2003-12-28 19:54                                                         ` Dmitry A. Kazakov
2003-12-29  6:07                                                           ` Georg Bauhaus
2003-12-29 11:28                                                             ` Dmitry A. Kazakov
2003-12-29 13:36                                                               ` Chad R. Meiners
2003-12-29  6:25                                                           ` Georg Bauhaus
2003-12-27 18:43                                                   ` Robert A Duff
2003-12-28 11:45                                                     ` Dmitry A. Kazakov
2003-12-28 19:59                                                       ` Robert A Duff [this message]
2003-12-30 18:03                                                     ` Peter Richtmyer
2003-12-30 23:02                                                       ` Alexandre E. Kopilovitch
2003-12-27 21:56                                                   ` Russ
2003-12-27 22:52                                                     ` Robert I. Eachus
2003-12-28 11:44                                                     ` Dmitry A. Kazakov
2003-12-28 18:14                                                       ` Robert I. Eachus
2003-12-28 19:55                                                         ` Dmitry A. Kazakov
2003-12-29  2:08                                                           ` Robert I. Eachus
2003-12-29 11:29                                                             ` Dmitry A. Kazakov
2003-12-29 13:44                                                               ` Chad R. Meiners
2003-12-29 17:07                                                                 ` Robert I. Eachus
2003-12-28 23:17                                                       ` Russ
2003-12-28 23:45                                                         ` Wes Groleau
2003-12-27 14:09                                                 ` Marin David Condic
2003-12-27 19:25                                                   ` Robert I. Eachus
2003-12-28  1:47                                                   ` Russ
2003-12-23 10:49                           ` come from joke (was " Peter Hermann
2003-12-23 12:19                             ` come from joke Samuel Tardieu
2003-12-23 17:00                               ` Arthur Evans Jr
2003-12-23 22:03                               ` Wes Groleau
2003-12-25  0:37                                 ` Stephane Richard
2003-12-27  1:00                                   ` John Woodruff
2003-12-24 18:48                               ` Simon Wright
2003-12-23 12:39                             ` come from joke (was Re: Other Ada Standards (was Re: SIGada Conference) Vinzent 'Gadget' Hoefler
2003-12-23 15:50                             ` Georg Bauhaus
2003-12-23 16:03                               ` Vinzent 'Gadget' Hoefler
2003-12-23 16:12                               ` Peter Hermann
2003-12-22 18:29                       ` Warren W. Gay VE3WWG
2003-12-20 19:44                   ` tmoran
2003-12-22 18:22                   ` Warren W. Gay VE3WWG
2003-12-20  0:39             ` Russ
2003-12-20  1:44               ` unknown
replies disabled

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