From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews.google.com!p73g2000hsd.googlegroups.com!not-for-mail From: Maciej Sobczak Newsgroups: comp.lang.ada Subject: Re: Prohibiting dynamic allocation for the given type Date: Wed, 19 Mar 2008 01:24:57 -0700 (PDT) Organization: http://groups.google.com Message-ID: <89ac4348-4c21-478e-b491-97bfbebfdb86@p73g2000hsd.googlegroups.com> References: <83335709-e099-416b-9967-5ab6aa0aea11@i12g2000prf.googlegroups.com> NNTP-Posting-Host: 128.141.45.252 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: posting.google.com 1205915098 10650 127.0.0.1 (19 Mar 2008 08:24:58 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Wed, 19 Mar 2008 08:24:58 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: p73g2000hsd.googlegroups.com; posting-host=128.141.45.252; posting-account=bMuEOQoAAACUUr_ghL3RBIi5neBZ5w_S User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.1.12) Gecko/20080201 Firefox/2.0.0.12,gzip(gfe),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:20478 Date: 2008-03-19T01:24:57-07:00 List-Id: 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? :-) > 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. -- Maciej Sobczak * www.msobczak.com * www.inspirel.com