comp.lang.ada
 help / color / mirror / Atom feed
From: gpriv@axonx.com
Subject: Re: Prohibiting dynamic allocation for the given type
Date: Wed, 19 Mar 2008 06:13:16 -0700 (PDT)
Date: 2008-03-19T06:13:16-07:00	[thread overview]
Message-ID: <25c21bee-f075-4538-8473-ecbd8c20a19c@n77g2000hse.googlegroups.com> (raw)
In-Reply-To: 89ac4348-4c21-478e-b491-97bfbebfdb86@p73g2000hsd.googlegroups.com

On Mar 19, 4:24 am, Maciej Sobczak <see.my.homep...@gmail.com> wrote:
> On 19 Mar, 04:06, gp...@axonx.com wrote:
>
> > Ada is high level language
>
> That does not matter.
> Ada is a high level language, but still provides two ways to create an
> object:
>
> X : Type;
> Y : Type_Ptr := new Type;
>
> If these two methods are available, then apparently there is a
> difference between them and this difference is not in *where* objects
> are created, but *how long* they are allowed to live.
>
> The high-level part of Ada can hide the "where" part, but not "how
> long".
>
> For some types I might want to prohibit one of these two ways of
> object creation.
>
> Prohibiting the first one is easy with limited types that have unknown
> discriminants + factory functions that return pointers.
>
> Prohibiting the second one seems to be impossible.
> For me this is a limitation.
>
> > What's wrong with good old comments atop of type declaration.
>
> What's wrong with C with good comments? :-)

Nothing..

>
> > But if you insist you may do run-time check by
> > defining custom Storage_Pool pool for your object
>
> Storage_Pool is a property of the pointer, not the type.

Are you asking for solutions or simply trolling?

>
> --
> Maciej Sobczak *www.msobczak.com*www.inspirel.com




  parent reply	other threads:[~2008-03-19 13:13 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-18 21:30 Prohibiting dynamic allocation for the given type Maciej Sobczak
2008-03-19  3:06 ` gpriv
2008-03-19  8:24   ` Maciej Sobczak
2008-03-19 11:31     ` Georg Bauhaus
2008-03-19 13:13     ` gpriv [this message]
2008-03-19 13:54       ` Maciej Sobczak
2008-03-19 16:37     ` Eric Hughes
2008-03-20  0:48       ` Robert A Duff
2008-03-20 21:35         ` Eric Hughes
2008-03-19 22:17     ` Georg Bauhaus
2008-03-19 23:40       ` gpriv
2008-03-20 21:11       ` Maciej Sobczak
2008-03-19 14:38   ` Adam Beneschan
2008-03-19 15:43     ` gpriv
2008-03-19 14:12 ` Pascal Obry
2008-03-19 23:08   ` Randy Brukardt
2008-03-20 20:26     ` Simon Wright
2008-03-20 22:03       ` Eric Hughes
2008-03-21  1:04         ` Randy Brukardt
2008-03-20  0:43 ` Robert A Duff
replies disabled

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