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: a07f3367d7,cb04cee6116c8ced X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!postnews.google.com!e19g2000prn.googlegroups.com!not-for-mail From: Adam Beneschan Newsgroups: comp.lang.ada Subject: Re: Package's private parts and protected types Date: Wed, 10 Feb 2010 08:05:59 -0800 (PST) Organization: http://groups.google.com Message-ID: References: <7ff3810f-3ee3-4f39-a54c-933ad7d0655c@36g2000yqu.googlegroups.com> <1v2la97s2yyvd.1rcy0ana8mver.dlg@40tude.net> <3bb38996-47f7-4f30-8255-f011501404b5@b10g2000yqa.googlegroups.com> <1qttzk1jbh24i$.xid2h7me3oec.dlg@40tude.net> NNTP-Posting-Host: 66.126.103.122 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1265817959 607 127.0.0.1 (10 Feb 2010 16:05:59 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Wed, 10 Feb 2010 16:05:59 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: e19g2000prn.googlegroups.com; posting-host=66.126.103.122; posting-account=duW0ogkAAABjRdnxgLGXDfna0Gc6XqmQ User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; WOW64; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 3.5.21022; .NET CLR 3.5.30729; .NET CLR 3.0.30618),gzip(gfe),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:9090 Date: 2010-02-10T08:05:59-08:00 List-Id: On Feb 9, 6:56=A0am, Robert A Duff wrote: > AdaMagica writes: > > OK, but then you have a similar problem to Ada83's syntactically > > unneeded bodies which Ada95 solved with a pragma. > > I think that problem is an illusion. =A0There was a problem, > but it was a problem with implementations, not with the > language. =A0How do we know if a given package spec has > a body? =A0Simple: look on the disk and see if there's > a source file containing that body. =A0In GNAT, that would > mean looking for foo.adb. And for other implementations (that put fewer restrictions on the names and locations of source files containing the Ada source), that would mean searching every file on the disk to see if one of them had "package body foo" in it. :) :) I know---those other implementations wouldn't do things this way; they'd provide some other mechanism to allow a programmer to tell the compilation system that a package no longer requires a body---or does require a body. But you should be careful when you say things like "Simple...". Unless, of course, you were joking. Anyway, the problem was certainly solvable in any implementation, although as Randy points out it's still not ideal because it makes it too easy for an accidental error to result in the compiler accepting a package without a body that's supposed to have one, or vice versa, causing incorrect results at runtime that could be puzzling to track down. And that issue exists with GNAT also---you delete some files from your directory with a wildcard, somehow foo.adb accidentally gets deleted along with them, and the compiler still thinks your program is OK. -- Adam