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.20.105 with SMTP id 96mr14010295qgi.7.1460366054600; Mon, 11 Apr 2016 02:14:14 -0700 (PDT) X-Received: by 10.157.3.17 with SMTP id 17mr51134otv.1.1460366054542; Mon, 11 Apr 2016 02:14:14 -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!7no1511386qgj.0!news-out.google.com!j7ni42igm.0!nntp.google.com!gy3no2107709igb.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Mon, 11 Apr 2016 02:14:14 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=94.126.240.2; posting-account=C8J7NQoAAAD_ybGY7--QIRi6KpLjoH1Z NNTP-Posting-Host: 94.126.240.2 References: <56ff6352-590e-4de7-a361-bc2fec0538fb@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <2db8b996-1c47-4789-97a8-075588598368@googlegroups.com> Subject: Re: How to do multiple instances of a generic packages in automated way. (using ravenscar profile) From: Daniel Norber Injection-Date: Mon, 11 Apr 2016 09:14:14 +0000 Content-Type: text/plain; charset=ISO-8859-1 Xref: news.eternal-september.org comp.lang.ada:30068 Date: 2016-04-11T02:14:14-07:00 List-Id: > > 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"