Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

This login session: $13.99


devel / comp.lang.ada / renaming as classwide type

SubjectAuthor
* renaming as classwide typeSimon Belmont
+* Re: renaming as classwide typeG.B.
|`* Re: renaming as classwide typeSimon Belmont
| `- Re: renaming as classwide typeRandy Brukardt
`- Re: renaming as classwide typeSimon Wright

1
renaming as classwide type

<99e103fa-53c3-43b0-8a4f-686ca10424cdn@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=10088&group=comp.lang.ada#10088

  copy link   Newsgroups: comp.lang.ada
X-Received: by 2002:ac8:7f81:0:b0:412:2954:3451 with SMTP id z1-20020ac87f81000000b0041229543451mr63375qtj.0.1695324544556;
Thu, 21 Sep 2023 12:29:04 -0700 (PDT)
X-Received: by 2002:a05:6808:3082:b0:3a1:c163:6022 with SMTP id
bl2-20020a056808308200b003a1c1636022mr287403oib.4.1695324544346; Thu, 21 Sep
2023 12:29:04 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.ada
Date: Thu, 21 Sep 2023 12:29:03 -0700 (PDT)
Injection-Info: google-groups.googlegroups.com; posting-host=159.250.202.227; posting-account=ShYTIAoAAABytvcS76ZrG9GdaV-nXYKy
NNTP-Posting-Host: 159.250.202.227
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <99e103fa-53c3-43b0-8a4f-686ca10424cdn@googlegroups.com>
Subject: renaming as classwide type
From: sbelmont700@gmail.com (Simon Belmont)
Injection-Date: Thu, 21 Sep 2023 19:29:04 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1397
 by: Simon Belmont - Thu, 21 Sep 2023 19:29 UTC

is it really illegal to rename an object as it's classwide parent? gnat claims so. Similar results using a type extension as a generic formal "in out" object of classwide type.

declare
type P is interface;
type C is new P with null record;

o : C;
r : P'Class renames o; --error
begin
null;
end;

expected type "P'Class" defined at line
found type "C" defined at line

Re: renaming as classwide type

<ueib27$3mp6k$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=10089&group=comp.lang.ada#10089

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: bauhaus@notmyhomepage.invalid (G.B.)
Newsgroups: comp.lang.ada
Subject: Re: renaming as classwide type
Date: Thu, 21 Sep 2023 23:03:02 +0200
Organization: A noiseless patient Spider
Lines: 20
Message-ID: <ueib27$3mp6k$1@dont-email.me>
References: <99e103fa-53c3-43b0-8a4f-686ca10424cdn@googlegroups.com>
Reply-To: nonlegitur@notmyhomepage.de
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Thu, 21 Sep 2023 21:03:03 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="c7e243b1f5102ec95f19a1728543ba80";
logging-data="3892436"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/iVrTCgvU0qkixPVesBHDUSVpkSS0gOrk="
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
Gecko/20100101 Thunderbird/102.15.1
Cancel-Lock: sha1:YZFg2n558FxxUEuJTbrQreB0zfw=
In-Reply-To: <99e103fa-53c3-43b0-8a4f-686ca10424cdn@googlegroups.com>
Content-Language: en-US
 by: G.B. - Thu, 21 Sep 2023 21:03 UTC

On 21.09.23 21:29, Simon Belmont wrote:
> is it really illegal to rename an object as it's classwide parent? gnat claims so. Similar results using a type extension as a generic formal "in out" object of classwide type.
>
> declare
> type P is interface;
> type C is new P with null record;
>
> o : C;
> r : P'Class renames o; --error
> begin
> null;
> end;
>
> expected type "P'Class" defined at line
> found type "C" defined at line

O does not denote an object of a class-wide type,
I think. However, P'Class (o) does, so that renaming
that would make r be of its declared type P'Class.

Re: renaming as classwide type

<5ab7e1d5-1491-49c3-877d-32bb6e12b43an@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=10090&group=comp.lang.ada#10090

  copy link   Newsgroups: comp.lang.ada
X-Received: by 2002:a05:620a:6086:b0:773:f56a:426 with SMTP id dx6-20020a05620a608600b00773f56a0426mr61034qkb.14.1695338348474;
Thu, 21 Sep 2023 16:19:08 -0700 (PDT)
X-Received: by 2002:a05:6808:158c:b0:3a8:4611:5d13 with SMTP id
t12-20020a056808158c00b003a846115d13mr3419377oiw.3.1695338348219; Thu, 21 Sep
2023 16:19:08 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.ada
Date: Thu, 21 Sep 2023 16:19:07 -0700 (PDT)
In-Reply-To: <ueib27$3mp6k$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=159.250.202.227; posting-account=ShYTIAoAAABytvcS76ZrG9GdaV-nXYKy
NNTP-Posting-Host: 159.250.202.227
References: <99e103fa-53c3-43b0-8a4f-686ca10424cdn@googlegroups.com> <ueib27$3mp6k$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <5ab7e1d5-1491-49c3-877d-32bb6e12b43an@googlegroups.com>
Subject: Re: renaming as classwide type
From: sbelmont700@gmail.com (Simon Belmont)
Injection-Date: Thu, 21 Sep 2023 23:19:08 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 1632
 by: Simon Belmont - Thu, 21 Sep 2023 23:19 UTC

On Thursday, September 21, 2023 at 5:03:06 PM UTC-4, G.B. wrote:
> O does not denote an object of a class-wide type,
> I think. However, P'Class (o) does, so that renaming
> that would make r be of its declared type P'Class.

That seems needlessly pedantic, considering that assignment is fine (o2 : P'Class := o) as well as assigning it to an intermediate pointer (po : access P'Class := o'Access; r : P'Class renames po.all)

Re: renaming as classwide type

<lyediqd06i.fsf@pushface.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=10092&group=comp.lang.ada#10092

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: simon@pushface.org (Simon Wright)
Newsgroups: comp.lang.ada
Subject: Re: renaming as classwide type
Date: Fri, 22 Sep 2023 10:31:01 +0100
Organization: A noiseless patient Spider
Lines: 7
Message-ID: <lyediqd06i.fsf@pushface.org>
References: <99e103fa-53c3-43b0-8a4f-686ca10424cdn@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: dont-email.me; posting-host="17cd267315417908e57bb72aa6f872d4";
logging-data="136070"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/KKv5PFD00eL4qKl5sKIfYx0LGiecJXzA="
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (darwin)
Cancel-Lock: sha1:Hg+p4S3TzOyyW0c6CsvnOyNtZSE=
sha1:XFT/GIIIQSpTVgwb80aRmCRoy6c=
 by: Simon Wright - Fri, 22 Sep 2023 09:31 UTC

Simon Belmont <sbelmont700@gmail.com> writes:

> r : P'Class renames o; --error

This compiles OK with GCC 13.1.0:

r : P'Class renames P'Class (o);

Re: renaming as classwide type

<uetr67$2c95g$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=10124&group=comp.lang.ada#10124

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: randy@rrsoftware.com (Randy Brukardt)
Newsgroups: comp.lang.ada
Subject: Re: renaming as classwide type
Date: Tue, 26 Sep 2023 00:46:07 -0500
Organization: A noiseless patient Spider
Lines: 24
Message-ID: <uetr67$2c95g$1@dont-email.me>
References: <99e103fa-53c3-43b0-8a4f-686ca10424cdn@googlegroups.com> <ueib27$3mp6k$1@dont-email.me> <5ab7e1d5-1491-49c3-877d-32bb6e12b43an@googlegroups.com>
Injection-Date: Tue, 26 Sep 2023 05:45:43 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="f0a5cbfd923c9b47a54100ea42585311";
logging-data="2499760"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX198+KxU8E8ZF4UIcwIMx7P8vS2qTpy0zUI="
Cancel-Lock: sha1:TsTjDSutBBhvzH/DspIQCWbAzCM=
X-Priority: 3
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.7246
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5931
 by: Randy Brukardt - Tue, 26 Sep 2023 05:46 UTC

It's not needless; there is an implicit conversion on an assignment, and it
only needs to work one way. When you rename a variable, the conversion has
to work both ways. But that's problematic, since conversions often involve
checks and we don't want checks popping up in unexpected places (both for
implementation reasons and for readability reasons).

Also, renaming does not change the nominal subtype of an object, regardless
of what subtype is given in the renames. Ada 2022 allows you to omit the
type name altogether since it provides little value.

Randy.

"Simon Belmont" <sbelmont700@gmail.com> wrote in message
news:5ab7e1d5-1491-49c3-877d-32bb6e12b43an@googlegroups.com...
On Thursday, September 21, 2023 at 5:03:06?PM UTC-4, G.B. wrote:
> O does not denote an object of a class-wide type,
> I think. However, P'Class (o) does, so that renaming
> that would make r be of its declared type P'Class.

That seems needlessly pedantic, considering that assignment is fine (o2 :
P'Class := o) as well as assigning it to an intermediate pointer (po :
access P'Class := o'Access; r : P'Class renames po.all)

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor