comp.lang.ada
 help / color / mirror / Atom feed
* Question regarding package
@ 2000-03-26  0:00 joe Tsai
  2000-03-27  0:00 ` Marin D. Condic
  0 siblings, 1 reply; 2+ messages in thread
From: joe Tsai @ 2000-03-26  0:00 UTC (permalink / raw)


Hi,

I have a newbie question.

for example if I wrote generic package call Gen_List.  I can use it with the
following ways,

package Stuff is newGen_List(Integer);
use Stuff;

the question is that if I can assign a package as type?

type thing is
  .....

Thanks

Joe






^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Question regarding package
  2000-03-26  0:00 Question regarding package joe Tsai
@ 2000-03-27  0:00 ` Marin D. Condic
  0 siblings, 0 replies; 2+ messages in thread
From: Marin D. Condic @ 2000-03-27  0:00 UTC (permalink / raw)


joe Tsai wrote:
> for example if I wrote generic package call Gen_List.  I can use it with the
> following ways,
> 
> package Stuff is newGen_List(Integer);
> use Stuff;
> 
> the question is that if I can assign a package as type?
> 
> type thing is
>   .....
> 
Your question is not 100% clear - maybe you should explain a little more
about what you want to accomplish & we can help point the way.

In general, the answer to your question is "no". A package is a
conglomeration of types, objects, subprograms and tasks. Making it
generic does not really change this. A type is a definition of how to
interpret raw memory. (O.K. not *strictly* accurate, but good enough for
this purpose.) How could a type contain actual memory for objects?
Declaring new objects of that type starts getting you into a paradox of
sorts.

You might think of a generic package instantiation as a kind of object
declaration. The generic package is similar to a type and the instance
is similar to an object - a specific occurence of the general
definition. 

If you had something else in mind, post more detail and I'm sure someone
will be glad to point out that I don't know what I'm talking about. :-)

MDC
-- 
=============================================================
Marin David Condic   - Quadrus Corporation -   1.800.555.3393
1015-116 Atlantic Boulevard, Atlantic Beach, FL 32233
http://www.quadruscorp.com/
m c o n d i c @ q u a d r u s c o r p . c o m

***PLEASE REMOVE THE "-NOSPAM" PART OF MY RETURN ADDRESS***

Visit my web site at:  http://www.mcondic.com/

"Because that's where they keep the money."
    --  Willie Sutton when asked why he robbed banks. 
=============================================================




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2000-03-27  0:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-03-26  0:00 Question regarding package joe Tsai
2000-03-27  0:00 ` Marin D. Condic

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