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=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,b99897135d6631cc X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!news.glorb.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local1.nntp.dca.giganews.com!nntp.comcast.com!news.comcast.com.POSTED!not-for-mail NNTP-Posting-Date: Sat, 26 Jun 2004 11:16:09 -0500 Date: Sat, 26 Jun 2004 12:16:06 -0400 From: "Robert I. Eachus" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax) X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: memory management and productivity References: <40d69121$1 1@baen1673807.greenlnk.net> <40d932fe 1@baen1673807.greenlnk.net> In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Message-ID: NNTP-Posting-Host: 24.147.90.114 X-Trace: sv3-ADVemKS3L0GSDqya6c8EAIWX8qpzkt7VXvT8DRkdtP4FAxXP5sMQSb24SEpgid9HUHCQDRZZ4EE446E!d0BxhP/Oap2HEJoNWkU71UmhZSCP+0L2A+IJA1563TC5TNYChCJY+nzb1zxXrQ== X-Complaints-To: abuse@comcast.net X-DMCA-Complaints-To: dmca@comcast.net X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.1 Xref: g2news1.google.com comp.lang.ada:1928 Date: 2004-06-26T12:16:06-04:00 List-Id: Russ wrote: > Having it as a library is fine with me -- as long as the library is > *standard* and available with every Ada compiler (or at least the main > free one). If you want, I write you a generic library for Ada 95 that does garbage collection. All you need to do is wrap Ada.Strings.Unbounded_String in a generic along with Unchecked_Conversion. I've never bothered to do it because the cases where I used the technique, it was better to have a non-generic binding. (Slices of arrays created as intermediate values. Slicing two dimensional arrays was most of the work, not the garbage management.) Incidently, the 'fragile' part of that code is not the garbage collection, it is deciding what the lifetime of a particular slice needs to be. If you make the lifetime too short, you either have code that won't compile or get an exception during testing. If you make the scope too long, you run out of storage. (And yes, the liftime of the object is determined by where it is declared, it is getting those declarations in the right place that is difficult.) -- Robert I. Eachus "Reason and experience both forbid us to expect that national morality can prevail in exclusion of religious principles." -- George Washington