Nп/п : 62 из 100
 От   : Randy Brukardt                      2:5075/128        26 сен 23 00:46:07
 К    : Simon Belmont                                         26 сен 23 08:47:03
 Тема : Re: renaming as classwide type
----------------------------------------------------------------------------------
                                                                                 
@MSGID: 1@dont-email.me> bb8c1ead
@REPLY:
<5ab7e1d5-1491-49c3-877d-32bb6e12b43an@googlegroups.com> 3c83f9a7
@REPLYADDR Randy Brukardt <randy@rrsoftware.com>
@REPLYTO 2:5075/128 Randy Brukardt
@CHRS: CP866 2
@RFC: 1 0
@RFC-Message-ID: 1@dont-email.me>
@RFC-References:
<99e103fa-53c3-43b0-8a4f-686ca10424cdn@googlegroups.com> 1@dont-email.me>
<5ab7e1d5-1491-49c3-877d-32bb6e12b43an@googlegroups.com>
@TZUTC: -0500
@TID: FIDOGATE-5.12-ge4e8b94
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) 


--- Microsoft Outlook Express 6.00.2900.5931
 * Origin: A noiseless patient Spider (2:5075/128)
SEEN-BY: 5001/100 5005/49 5015/255 5019/40 5020/715
848 1042 4441 12000
SEEN-BY: 5030/49 1081 5058/104 5075/128
@PATH: 5075/128 5020/1042 4441



   GoldED+ VK   │                                                 │   09:55:30    
                                                                                
В этой области больше нет сообщений.

Остаться здесь
Перейти к списку сообщений
Перейти к списку эх