comp.lang.ada
 help / color / mirror / Atom feed
From: "G.B." <bauhaus@futureapps.invalid>
Subject: Re: How to do multiple instances of a generic packages in automated way. (using ravenscar profile)
Date: Thu, 7 Apr 2016 14:36:34 +0200
Date: 2016-04-07T14:36:34+02:00	[thread overview]
Message-ID: <ne5k2d$omh$1@dont-email.me> (raw)
In-Reply-To: <bcaa90eb-61ec-4ebd-868b-9ef4b2285e23@googlegroups.com>

On 07.04.16 14:05, danielnorberto@gmail.com wrote:
> I will reduce everything to explain the problem better:
>
> generic
> 	Size_bytes : integer;
> package buffer is
> protected
> 	put(msg: string);
> 	Entry get(msg : out string);
> Private
> 	Content : string(1..size_bytes);
> end buffer;

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.

  reply	other threads:[~2016-04-07 12:36 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-05 17:09 How to do multiple instances of a generic packages in automated way. (using ravenscar profile) danielnorberto
2016-04-05 17:39 ` Jeffrey R. Carter
2016-04-05 19:39   ` Simon Wright
2016-04-07 12:05 ` danielnorberto
2016-04-07 12:36   ` G.B. [this message]
2016-04-11  9:14     ` Daniel Norber
2016-04-11 13:04       ` Shark8
2016-04-11 17:25         ` Daniel Norber
2016-04-11 15:58       ` Anh Vo
2016-04-11 17:21         ` Daniel Norber
2016-04-11 17:26           ` Anh Vo
2016-04-11 16:59       ` Jeffrey R. Carter
2016-04-11 17:23         ` Daniel Norber
2016-04-11 17:27           ` Jeffrey R. Carter
2016-04-12  5:19           ` Brad Moore
2016-04-26 15:08             ` Daniel Norber
2016-05-05 21:01 ` rieachus
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox