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,b8b8a54001adc4d2 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!newshub.sdsu.edu!border1.nntp.dca.giganews.com!nntp.giganews.com!local1.nntp.dca.giganews.com!nntp.megapath.net!news.megapath.net.POSTED!not-for-mail NNTP-Posting-Date: Mon, 03 Jan 2005 17:35:45 -0600 From: "Randy Brukardt" Newsgroups: comp.lang.ada References: <1104516913.718856.94090@z14g2000cwz.googlegroups.com> <1104544963.930877.75170@c13g2000cwb.googlegroups.com> <1104595073.731663.180100@c13g2000cwb.googlegroups.com> Subject: Re: Possible Ada deficiency? Date: Mon, 3 Jan 2005 17:37:23 -0600 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4807.1700 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300 Message-ID: NNTP-Posting-Host: 64.32.209.38 X-Trace: sv3-FWkMlL2X9q4aZWdcDPzvhLdOdcs2vImUFUQgcVHZ74yeSXuZmevzsnVBlwLvFWFoT4/6sMiYgTkxLBa!BoUeKBq4h0Wm+cJ5MoP/dkEF3I3NZWh3wOUb+j1TKBCuwticNcX6+rs9chBIZHLqd56pXSm91c4B X-Complaints-To: abuse@megapath.net X-DMCA-Complaints-To: abuse@megapath.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.3.22 Xref: g2news1.google.com comp.lang.ada:7418 Date: 2005-01-03T17:37:23-06:00 List-Id: wrote in message news:1104595073.731663.180100@c13g2000cwb.googlegroups.com... > Yes, but it seems like such an obvious place where bad things could > happen. It seems like only goodness can be bought by having the ability > to hide a type's impelmentation from child packages. I don't see any > downside to providing this ability. That way, one could force a child > package to use the interface provided by the public area of its parent > and prevent the child from manipulating the internal representation of > a type. The purpose of a child package is to extend its parent, often in ways not forseen by the parent's author. You're trying to prevent that purpose. If you don't want access to the private information, then don't write children. You have to at some point trust programmers to do something sensible; it's not the least bit hard to use 'Address or Unchecked_Conversion to access the private information of a package, no matter where you hide it. Since children are obvious syntactically, it is easy to determine if a particular program has any. If your project is creating child packages willy-nilly, it has project management problems far beyond anything a mere programming language can help with. For public packages (like Claw), it's just as easy. Write a child, you're on your own -- because the only reason to write a child is to get access to implementation details. Once you do that, we aren't likely to support the result. Repeat after me: it's not the least bit hard in any programming language to write bad code. Ada can only do so much; you have to have coding rules and the project management to make them stick to get the whole job done. Otherwise, you can write a morass of child packages, use clauses, address clauses to make overlays, and so on to rival any messy C code. (Indeed, these sorts of things are used to translate C to Ada automatically - garbage in, worse garbage out!). Randy.