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,8591be732d0fce98 X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news4.google.com!proxad.net!feeder1-2.proxad.net!fdn.fr!club-internet.fr!feedme-small.clubint.net!nuzba.szn.dk!news.jacob-sparre.dk!pnx.dk!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Ada OOP alternatives? Date: Thu, 17 Jul 2008 18:27:03 -0500 Organization: Jacob's private Usenet server Message-ID: References: <462e0cf4-1d53-4918-b30b-dd3d8df90f1b@p25g2000hsf.googlegroups.com> <487d9636$0$6543$9b4e6d93@newsspool3.arcor-online.net> <6e5uq2F5g7n6U2@mid.individual.net> NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: jacob-sparre.dk 1216337396 3984 69.95.181.76 (17 Jul 2008 23:29:56 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Thu, 17 Jul 2008 23:29:56 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5512 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5512 Xref: g2news2.google.com comp.lang.ada:6931 Date: 2008-07-17T18:27:03-05:00 List-Id: "Robert A Duff" wrote in message news:wccy741fg0z.fsf@shell01.TheWorld.com... > "(see below)" writes: > >> On 17/07/2008 01:05, in article wcc3am9gytt.fsf@shell01.TheWorld.com, >> "Robert A Duff" wrote: >>> I'd still rather eliminate private parts altogether. >> >> How would you do that while allowing ADT clients to access objects >> directly >> (i.e. not via a pointer a la Java)? > > I'd have the compiler take a peek at the body when compiling the client. > After all, that's what Ada compilers already do for pragma Inline. That's what *some* Ada compilers do. Personally, I think that violates the spirit of Ada (Ichbiah version) by adding unnecessary compilation dependencies. Indeed, I think the whole design of pragma Inline is wrong in Ada. ... > We're just talking about the size of the type, really -- you say > "access objects", but clients can't access the record components > of a private type -- all they can do is declare objects and > pass them around. Ugh. That's surely not true, either, unless you insist on allocating all objects contiguously. And I see absolutely no reason to do that in general -- the limitations that it puts on the programmer are unnecessary and impossible to see. (Particular cases for particular [usually safety-critical] programs are a very different story of course -- but safety-critical users are going to put all kinds of restrictions on themselves which don't mean that they are a good idea for the rest of us.) There are a lot of different ways to design a compilation system, and one thing we've clearly learned from the ARG is that making any sort of assumptions about how "everyone" is going to implement something are almost certainly wrong. Language design has to be more general than that (unless you are willing to have a sole-source language like Eiffel, and those are almost never interesting). Randy.