comp.lang.ada
 help / color / mirror / Atom feed
From: mfeldman@seas.gwu.edu (Michael Feldman)
Subject: Re: Subunits of packages vs. subunits of subprograms
Date: 1996/07/13
Date: 1996-07-13T00:00:00+00:00	[thread overview]
Message-ID: <4s8h0o$s6u@felix.seas.gwu.edu> (raw)
In-Reply-To: 31E534FE.12370608@jinx.sckans.edu


In article <31E534FE.12370608@jinx.sckans.edu>,
David Morton  <dmorton@jinx.sckans.edu> wrote:

>Basically, it seems now that the separate keyword's function is to break
>down a lenthy file into many small ones, mainly for easier reading, not
>to speed up developement or help the concept of separate compilation.

Well, that is certainly _a_ function of subunits. I think it goes too
far to always be looking for _one_ purpose, to the exclusion of others.

I agree that it certainly does serve the purpose you describe. I've
found - as a textbook author - that it's a clever way for me to
introduce a package, with full spec but with stubs for all the
bodies of the operations, then bring in each operation body as a
separate (pun intended) example, in a separate file.

Even if GNAT requires that all the body files be available for
code generation, Robert Dewar and others pointed out that these are
_not_ required for syntactic and semantic checking of the package
body. This can be seen as a variant of the fact that Ada does not
require a package body to be present _at all_ in order to do syntax/
semantic checking - even code generation - of a client program. 

Many students don't focus on that either, and insist on writing a 
complete package body before going on to develop a client. In a team
situation, in school or in industry - often the client and the package
body are developed in parallel by different team members (or even
different teams!).

>I think I understand the reasons for it being this way, but although
>it does meet the letter of the RM, it does seem to violate the spirit
>of separate compilation.  Oh well, it's *not* that big a deal...  

Well, if you buy Robert Dewar's definition of compilation as syntax/
semantic checking but no code generation, there's no violation. I've
just been looking in the RM 95, especially Chapter 10, and I find no 
straightforward definition of compilation in it. That is, there's nothing 
like "compilation includes syntax/semantic checking and code generation". 

The details of the various phases of production of an executable program 
are left to the implementer: the door is evidently open to all sorts of 
compilation models; it's the result that counts. 

That's fine - it is not the role of the standard to micromanage  
mechanics.
>
>-- 
>David Morton
> mailto:dmorton@jinx.sckans.edu   http://www.sckans.edu/~dmorton/
> 205 College, Winfield, KS 67156    
> This signature will self-destruct in 10 seconds...

Mike Feldman
------------------------------------------------------------------------
Michael B. Feldman -  chair, SIGAda Education Working Group
Professor, Dept. of Electrical Engineering and Computer Science
The George Washington University -  Washington, DC 20052 USA
202-994-5919 (voice) - 202-994-0227 (fax) 
http://www.seas.gwu.edu/faculty/mfeldman
------------------------------------------------------------------------
       Pork is all that money the government gives the other guys.
------------------------------------------------------------------------
WWW: http://lglwww.epfl.ch/Ada/ or http://info.acm.org/sigada/education
------------------------------------------------------------------------




  parent reply	other threads:[~1996-07-13  0:00 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-07-11  0:00 Subunits of packages vs. subunits of subprograms Tucker Taft
1996-07-11  0:00 ` David Morton
1996-07-11  0:00   ` Robert Dewar
1996-07-13  0:00   ` Michael Feldman [this message]
1996-07-21  0:00     ` Robert A Duff
1996-07-11  0:00 ` Robert Dewar
1996-07-15  0:00 ` James A. Squire
1996-07-21  0:00   ` Robert A Duff
1996-07-24  0:00   ` JamesS1889
replies disabled

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