comp.lang.ada
 help / color / mirror / Atom feed
From: Matthew Heaney <matthew_heaney@acm.org>
Subject: Re: Why both "with" and "use"?
Date: 1999/02/13
Date: 1999-02-13T00:00:00+00:00	[thread overview]
Message-ID: <m3r9rtudg5.fsf@mheaney.ni.net> (raw)
In-Reply-To: 7a4j3h$64e@drn.newsguy.com

bill <bill@newsguy.com> writes:

> Also, in Java a package seems to have different purpose than with Ada. In
> Java a package is a collection of classes. In OO Ada, a package usually
> contains one tagged type. or is this not the normal practice?

A package exports a collection of entities that are "highly cohesive."
As such, it often makes sense to bundle types together in the same
package.  For example:

generic
  type Item_Type is private;
package Stacks is

   type Stack_Type is limited private;

   procedure Push 
     (Item : in     Item_Type;
      On   : in out Stack_Type);

   <etc>

   
   type Stack_Iterator is private;

   function Initialize 
     (Stack : Stack_Type) return Stack_Iterator;

   function Get_Item
     (Iterator : Stack_Iterator) return Item_Type;

   procedure Advance 
     (Iterator : in out Stack_Iterator);

  <etc>

end Stacks;


Here, we have an example of a stack type and its iterator type, together
in one package.  This is entirely natural and appropriate.






  parent reply	other threads:[~1999-02-13  0:00 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-02-13  0:00 Why both "with" and "use"? Mike Silva
1999-02-13  0:00 ` Pat Rogers
1999-02-13  0:00   ` bill
1999-02-13  0:00     ` Pat Rogers
1999-02-13  0:00       ` Matthew Heaney
1999-02-13  0:00         ` bill
1999-02-14  0:00         ` Pat Rogers
1999-02-14  0:00           ` Bob Collins
1999-02-14  0:00             ` Pat Rogers
1999-02-16  0:00         ` Samuel Mize
1999-02-13  0:00     ` Matthew Heaney [this message]
1999-02-15  0:00     ` Jean-Pierre Rosen
1999-02-15  0:00       ` Ed Falis
1999-02-16  0:00         ` Jean-Pierre Rosen
1999-02-13  0:00 ` Corey Minyard
1999-02-13  0:00   ` mike
1999-02-13  0:00   ` Matthew Heaney
1999-02-13  0:00     ` bill
1999-02-14  0:00       ` dewar
1999-02-14  0:00       ` dewar
1999-02-14  0:00       ` Matthew Heaney
1999-02-13  0:00     ` Tom Moran
1999-02-14  0:00       ` Matthew Heaney
1999-02-16  0:00     ` Samuel Mize
1999-02-17  0:00       ` Jean-Pierre Rosen
1999-02-18  0:00         ` robert_dewar
1999-02-18  0:00           ` Jean-Pierre Rosen
1999-02-18  0:00             ` robert_dewar
1999-02-19  0:00               ` Jean-Pierre Rosen
1999-02-18  0:00         ` dennison
1999-02-18  0:00           ` robert_dewar
1999-02-19  0:00             ` dennison
1999-02-19  0:00             ` Robert I. Eachus
1999-02-19  0:00               ` robert_dewar
1999-02-23  0:00                 ` Robert I. Eachus
1999-02-19  0:00               ` Brian Hanson
1999-02-19  0:00                 ` robert_dewar
1999-02-19  0:00             ` bourguet
1999-02-19  0:00               ` robert_dewar
1999-02-19  0:00           ` Matthew Heaney
1999-02-19  0:00             ` dennison
1999-02-19  0:00               ` robert_dewar
1999-02-19  0:00                 ` dennison
1999-02-19  0:00                   ` robert_dewar
1999-02-19  0:00                 ` Ada multiple string personalities. why so many? mike
1999-02-19  0:00                   ` robert_dewar
1999-02-19  0:00                   ` Tom Moran
1999-02-19  0:00                     ` Mike Silva
1999-02-22  0:00                       ` Brian Hanson
1999-02-17  0:00       ` Why both "with" and "use"? Matthew Heaney
1999-02-17  0:00       ` dennison
1999-02-17  0:00         ` Samuel Mize
1999-02-17  0:00         ` Nick Roberts
1999-02-17  0:00       ` Jean-Pierre Rosen
1999-02-15  0:00 ` Jean-Pierre Rosen
replies disabled

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