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.140.240.11 with SMTP id l11mr15609717qhc.11.1460390284024; Mon, 11 Apr 2016 08:58:04 -0700 (PDT) X-Received: by 10.157.14.207 with SMTP id 73mr207232otj.13.1460390283949; Mon, 11 Apr 2016 08:58:03 -0700 (PDT) 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!7no1663284qgj.0!news-out.google.com!u9ni87igk.0!nntp.google.com!nt3no11072971igb.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Mon, 11 Apr 2016 08:58:03 -0700 (PDT) In-Reply-To: <2db8b996-1c47-4789-97a8-075588598368@googlegroups.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=149.32.224.36; posting-account=Qh2kiQoAAADpCLlhT_KTYoGO8dU3n4I6 NNTP-Posting-Host: 149.32.224.36 References: <56ff6352-590e-4de7-a361-bc2fec0538fb@googlegroups.com> <2db8b996-1c47-4789-97a8-075588598368@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <40997fc7-d8fc-4d78-86aa-23b951ef436c@googlegroups.com> Subject: Re: How to do multiple instances of a generic packages in automated way. (using ravenscar profile) From: Anh Vo Injection-Date: Mon, 11 Apr 2016 15:58:04 +0000 Content-Type: text/plain; charset=ISO-8859-1 Xref: news.eternal-september.org comp.lang.ada:30072 Date: 2016-04-11T08:58:03-07:00 List-Id: On Monday, April 11, 2016 at 2:14:15 AM UTC-7, Daniel Norber wrote: > > > > It might assist us in isolating issues if you let the > > compiler check the reduced source text above, or we might > > incorrectly assume things, including that you might first > > want to seize the opportunity and get a firm grip of Ada. :-) > > > > That being said, with profile Ravenscar active, is there > > a reason why you can't start from a protected type with > > a Size discriminant instead of a generic parameter? Is > > it to do with some version of RavenSPARK in the end? > > > > protected type Buffer (Size : Size_In_Characters) is > > procedure Put (Msg : String); > > entry Get (Msg : out String); > > private > > content : String (1 .. Size); > > end Buffer; > > > > Also note that every String parameter is still allowed to have > > an unspecified number of characters, whereas content has > > a maximum number of them, and also that Get has no way to inform > > its caller about the part of Msg actually filled. > > I was trying your approach, but maybe there is something im missing because the GNAT ADA compiler says: > "discriminant part not allowed in protected body" Indeed, discriminant is allowed in the protected specification only. Since you put it in the protected body, you violated the syntax rule. Anh Vo