On Wed, 7 May 2008 21:48:47 -0700 (PDT), ophir.geffen@[EMAIL PROTECTED]
wrote:
> The problem is that the package needs to know how to handle most non-
> limited types like Integer, String, Client, Plane, Book, Do***ent, ...
String is an indefinite type.
> Is there a better way to write the package and/or a more correct way
> to declare it when using it?
That depends on what your queue package is. If it is a queue of items with
1. no requirements of the representation of in the queue
2. value copy semantics of insertion and retrieval
then I would use one of the following three variants:
1. Queue internally implemented by an array of elements
2. Queue implemented as a user-defined storage pool
3. Queue implemented as a user-defined stream
For any of these variants you just don't need any Put procedure. Copying
is
predefined private type (cases 1 and 2). Stream attributes are also
predefined. The choice between 1 and 2 depends on whether Item is
definite:
type Item is private; -- 1 would be OK
type Item (<>) is private; -- This is for the variant 2
--
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de


|