comp.lang.ada
 help / color / mirror / Atom feed
From: Jeffrey Carter <spam@spam.com>
Subject: Re: Objects and the Stack?
Date: Fri, 17 Dec 2004 00:28:23 GMT
Date: 2004-12-17T00:28:23+00:00	[thread overview]
Message-ID: <HKpwd.1478$9j5.1379@newsread3.news.pas.earthlink.net> (raw)
In-Reply-To: <pan.2004.12.16.17.36.16.856595@nowhere.net>

Freejack wrote:

> It's my understanding that one can eliminate the need for pointers (access
> types) through prudent use of tagged types and classes. However it is also
> my understanding that Gnat at least, when creating instances of Foo'class,
> creates them on the stack.

The fact that pointers are generally not needed in Ada except when 
creating things such as dynamic data structures has nothing to do with 
tagged types. If you create objects of a classwide type, they are put on 
the stack if you declare them there, and in a storage pool if you 
allocate them there.

> So, for kicks, I'm gonna write a package that creates a stack, with the
> stack being a tagged object which gets extended with each new element
> object that's pushed onto it.

I'm not sure what you mean by "extended" here, whether you're referring 
to type extension or a value that becomes larger in 'Size, but this 
doesn't work the way I think you think it will.

-- 
Jeff Carter
"Son of a window-dresser."
Monty Python & the Holy Grail
12



  parent reply	other threads:[~2004-12-17  0:28 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-12-16 22:27 Objects and the Stack? Freejack
2004-12-16 23:13 ` Nick Roberts
2004-12-20 14:50   ` Marc A. Criley
2004-12-20 16:22     ` Marius Amado Alves
2004-12-20 18:31       ` Dmitry A. Kazakov
2004-12-17  0:28 ` Jeffrey Carter [this message]
2004-12-17  8:45   ` Freejack
2004-12-17 11:11     ` Martin Dowie
2004-12-17 11:46     ` Nick Roberts
2004-12-17 19:52       ` Freejack
2004-12-18  4:02         ` Nick Roberts
2004-12-27  4:34         ` Dave Thompson
2004-12-18 19:41       ` Warren W. Gay VE3WWG
2004-12-18 20:50         ` Freejack
2004-12-18 21:15           ` Dmitry A. Kazakov
2004-12-27  4:34         ` Dave Thompson
2004-12-18  0:12     ` Jeffrey Carter
2004-12-18  0:43       ` Jeffrey Carter
replies disabled

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