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,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.129.125.4 with SMTP id y4mr28145340ywc.48.1450164372521; Mon, 14 Dec 2015 23:26:12 -0800 (PST) X-Received: by 10.182.247.67 with SMTP id yc3mr446006obc.0.1450164372470; Mon, 14 Dec 2015 23:26:12 -0800 (PST) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!feeder.eternal-september.org!news.glorb.com!g67no929698qgd.1!news-out.google.com!f6ni23410igq.0!nntp.google.com!mv3no16359649igc.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Mon, 14 Dec 2015 23:26:12 -0800 (PST) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=75.161.116.59; posting-account=lJ3JNwoAAAAQfH3VV9vttJLkThaxtTfC NNTP-Posting-Host: 75.161.116.59 References: <8bc7fd76-f00a-4eea-9715-470af028fc84@googlegroups.com> <1krm4xun4e4ny.jmh9kvf6s0a9.dlg@40tude.net> <12dc7aea-933d-4271-95bd-10df808917e4@googlegroups.com> <5hfb2q9imjfu.zs3xp9gxw0d3.dlg@40tude.net> <5788b259-8886-4ee2-8c3d-7799abfd840e@googlegroups.com> <14acd8b0-a5e9-40fd-b7cc-d319f914d507@googlegroups.com> <2b70cc02-600e-4f4e-b6fe-86d7e01648ef@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: I'm facing an issue with: call to abstract procedure must be dispatching From: Shark8 Injection-Date: Tue, 15 Dec 2015 07:26:12 +0000 Content-Type: text/plain; charset=ISO-8859-1 Xref: news.eternal-september.org comp.lang.ada:28809 Date: 2015-12-14T23:26:12-08:00 List-Id: On Sunday, December 13, 2015 at 7:20:40 PM UTC-7, Jeffrey R. Carter wrote: > > I wouldn't put the state in the private part. > Instead, I'd put it in the body I tend to go with body, though there are some instances where you need to put it in private. (Namely: when child units need to access the internal representation of the data.) > I'd also use "+ 1" or "- 1", since those are clearer. The reason I used Succ and Pred was that I was originally going to [also] include a generic version, which would need to replace Natural w/ the formal type parameter: Generic Type Data_Type is (<>); Default : in Data_Type; Package Generic_Counter is Procedure Inc; Procedure Dec; Function Value Return Data_Type; End Generic_Counter; Package Body Generic_Counter is Data : Data_Type := Default; Procedure Inc is begin Data:= Data_Type'Succ( Data ); end Inc; Procedure Dec is begin Data:= Data_Type'Pred( Data ); end Dec; Function Value return Data_Type is ( Data ); End Generic_Counter;