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 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,5dacec64c8c879fa X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.226.10 with SMTP id ro10mr16377200pbc.6.1328690598074; Wed, 08 Feb 2012 00:43:18 -0800 (PST) X-FeedAbuse: http://nntpfeed.proxad.net/abuse.pl feeded by 78.192.181.72 Path: wr5ni559pbc.0!nntp.google.com!news1.google.com!news4.google.com!feeder1-2.proxad.net!proxad.net!feeder1-1.proxad.net!nntpfeed.proxad.net!78.192.181.72.MISMATCH!gegeweb.42!gegeweb.eu!gegeweb.org!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: Preventing Unchecked_Deallocation? Date: Wed, 08 Feb 2012 08:43:16 +0000 Organization: A noiseless patient Spider Message-ID: References: <33a35da4-6c3e-4ab4-b58f-a9d73565d79a@t30g2000vbx.googlegroups.com> <4350713b-6ac3-4b22-b221-8da2bac52fea@t5g2000yqk.googlegroups.com> <26e4f2a4-edae-4e37-8697-f2390e636a21@z31g2000vbt.googlegroups.com> <07915db7-0e84-4eb5-af69-ee31e10b018f@db5g2000vbb.googlegroups.com> Mime-Version: 1.0 Injection-Info: mx04.eternal-september.org; posting-host="dFCm8HWntFqmDIilBLqEJQ"; logging-data="24079"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1//+SehBLCsVgB7fQwUhRPETa6PshFgYQQ=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (darwin) Cancel-Lock: sha1:1cSnE9WaivQkgwVp+VsH/jJQ380= sha1:B/nQWeZtZiBKJ49E7vD0O/oBbKU= Content-Type: text/plain; charset=us-ascii Date: 2012-02-08T08:43:16+00:00 List-Id: Robert A Duff writes: > Simon Wright writes: > >> In order to represent a UML model, I needed limited objects to represent >> the elements in the model (instances of Class, DataType, Association, >> Operation, Parameter etc) and I wanted to store them in Maps keyed by >> name. I didn't see any choice but to use maps of (name -> access >> element'class). > > You could use Ada.Containers.Maps, but there are still access types > under the covers. But not for limited objects, surely? Seems to me that copying is a Bad Thing when dealing with data that represents objects in the problem domain. Using limited types is one way of approaching this, but I suppose another would be apply conventions, such as insisting on 'in out' usage everywhere??? How do compiler writers deal with symbol tables? (and I did use Ada.Containers.Maps, a first for me having been involved with, and on a project using, the Booch Components! Impressive, although the API is much larger than I needed).