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,7a3b1c6915ea1273 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.73.229 with SMTP id o5mr1153956pbv.7.1326467163637; Fri, 13 Jan 2012 07:06:03 -0800 (PST) Path: lh20ni177780pbb.0!nntp.google.com!news2.google.com!news1.google.com!newsfeed2.dallas1.level3.net!newsfeed3.dallas1.level3.net!news.level3.com!bloom-beacon.mit.edu!newsswitch.lcs.mit.edu!nntp.TheWorld.com!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: How many Ada compiler bugs are here? Date: Fri, 13 Jan 2012 10:06:02 -0500 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: <01dd6341-9c3c-4dcb-90f8-6ac66c65eb66@z1g2000vbx.googlegroups.com> <98adc34c-deed-4190-9e10-755cb886984f@n39g2000yqh.googlegroups.com> <5cm1d9xlavps$.1tjtc88r9ze21$.dlg@40tude.net> <6d352870-d204-4137-a562-5a0b67db1f80@h13g2000vbn.googlegroups.com> <15d37z3l8zllg$.3z2pj9cy5kvq.dlg@40tude.net> <7610c0ee-db98-4530-afab-f29e187ee7d0@h3g2000yqe.googlegroups.com> <1swdtf9umcv6h.1abrhg4hr4tdd$.dlg@40tude.net> <189376d3-eab5-44a2-a7fc-8a227d1f6d70@k10g2000yqk.googlegroups.com> NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 X-Trace: pcls6.std.com 1326467163 11286 192.74.137.71 (13 Jan 2012 15:06:03 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Fri, 13 Jan 2012 15:06:03 +0000 (UTC) User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.3 (irix) Cancel-Lock: sha1:kGuc1ds2JBBuT2yDBuI2fZbDbMM= Content-Type: text/plain; charset=us-ascii Date: 2012-01-13T10:06:02-05:00 List-Id: "Dmitry A. Kazakov" writes: > No. You can have them in children packages, which is not so uncommon to do. True. You could also create all the objects (maybe there is only one!) in the body of package P itself, and perhaps hand out access-to-T values. > I ran into the issue of required return statement several times. If you > have a hierarchy of managed objects, for which you would like to prevent > stack instances or make them accessible only though proxy objects, etc. > Especially when some fields are not null access. Then you may get this > problem. It can occur pretty late and require a huge amount of redesign. I don't think it can cause huge redesign. I agree with you that it's a language design flaw, but I also agree with AdaMagica that it's a small one. Here's a workaround: function Foo return T is begin raise Constraint_Error; return Foo; -- kludgy recursive call; can't get here! end Foo; If Foo takes parameters, pass them along in the recursive call. No need to gin up a value of type T. > BTW, I always wondered why cannot we have multiple parents of a package in > Ada? Sounds hugely complicated. - Bob