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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,d927b7ea9b65580a X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-11-09 07:36:53 PST Newsgroups: comp.lang.ada Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!uunet!sea.uu.net!sac.uu.net!ash.uu.net!world!news From: Robert A Duff Subject: Re: Style: always declare subrountines? User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Sender: news@world.std.com (Mr Usenet Himself) Message-ID: Date: Sat, 9 Nov 2002 15:36:05 GMT Content-Type: text/plain; charset=us-ascii References: <3dccc023$0$304$bed64819@news.gradwell.net> NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 Organization: The World Public Access UNIX, Brookline, MA Xref: archiver1.google.com comp.lang.ada:30653 Date: 2002-11-09T15:36:05+00:00 List-Id: porton@ex-code.com (Victor Porton) writes: > How do you consider this: > > If one would always declare every subrountine of a package body in the > specification (in the public or in the private part) this excludes the > possibility that one may mistakedly create an internal subrountine with > the same specification as a not yet implemented public procedure and > forget to implement this public procedure and so get wrong program > behavior. > > Stylistic checkers for always declaring in package specification? This bug hardly seems likely enough to worry about. But if you want to do this, put the specs of the internal procedures at the start of the package *body*, not in the private part. For one thing, private parts are not totally private -- child packages can see them. For another, putting more stuff in private parts causes more compile-time costs. - Bob