From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-1.9 required=3.0 tests=BAYES_00,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.6 X-Received: by 2002:a37:2d87:: with SMTP id t129mr20356003qkh.88.1634052800880; Tue, 12 Oct 2021 08:33:20 -0700 (PDT) X-Received: by 2002:a5b:502:: with SMTP id o2mr27553397ybp.452.1634052800693; Tue, 12 Oct 2021 08:33:20 -0700 (PDT) Path: eternal-september.org!reader02.eternal-september.org!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Tue, 12 Oct 2021 08:33:20 -0700 (PDT) In-Reply-To: Injection-Info: google-groups.googlegroups.com; posting-host=146.5.2.231; posting-account=lJ3JNwoAAAAQfH3VV9vttJLkThaxtTfC NNTP-Posting-Host: 146.5.2.231 References: <07f8mgdot9tmh8mqen2ogd5dds2gojoleh@4ax.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: The Ravenscar profile and capabilities paradigm From: Shark8 Injection-Date: Tue, 12 Oct 2021 15:33:20 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Xref: reader02.eternal-september.org comp.lang.ada:62977 List-Id: On Tuesday, October 12, 2021 at 9:04:09 AM UTC-6, Luke A. Guest wrote: > On 12/10/2021 16:01, Shark8 wrote:=20 > > On Monday, October 11, 2021 at 1:24:48 PM UTC-6, Doctor Who wrote:=20 > >> On Mon, 11 Oct 2021 16:32:13 +0100, Simon Wright wrote:=20 > >>> Doctor Who writes:=20 > >>>=20 > >>>> someone knows how to introduce the capabilities paradigm in Ada,=20 > >>>> specifically for programs written using the Ravenscar profile ?=20 > >>> > > Type Capability is ( Read, Copy, Whatever ); > There can be a capabiity for literally anything, even ownership and can= =20 > be different depending on object/os service.=20 >=20 > I'd say a tagged type is better than an enum. Possibly. But there's no reason to complicate the general idea in example-form: even = if it's a tagged type you're going to want the capability-instance to be li= mited-private; the implementation of the "permissions" component being a Bo= olean-array or a vector of Capability'Class [most obviously having Capabili= ty be an abstract tagged null record] is mostly irrelevant for that demonst= ration. (And using a vector of tagged-type instead of the array would have = bogged the example down with importing and instantiating the Vector contain= er and setting up multiple non-abstract Capability-descendants, cluttering = the point of the example.)