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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,d067a5a7c60c3b40 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!proxad.net!proxad.net!194.117.148.138.MISMATCH!pe2.news.blueyonder.co.uk!blueyonder!news-peer!btnet!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.arcor.de!newsspool1.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: Unchecked_Deallocation vs. delete Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.15.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: <1178728045.890171.6110@q75g2000hsh.googlegroups.com> <1hzydt9ej6az6$.12jl0su9budun.dlg@40tude.net> <1178827771.416316.210790@y80g2000hsf.googlegroups.com> <1178871315.928116.262190@e51g2000hsg.googlegroups.com> Date: Fri, 11 May 2007 18:39:21 +0200 Message-ID: NNTP-Posting-Date: 11 May 2007 18:39:10 CEST NNTP-Posting-Host: 2e0de565.newsspool1.arcor-online.net X-Trace: DXC=ZF5<>TZdk\ZU6b:FjPaGjQic==]BZ:af^4Fo<]lROoRQFl8W>\BH3YR3:H4CfN[Y7YDNcfSJ;bb[UIRnRBaCd_]:a_NoP_W X-Complaints-To: usenet-abuse@arcor.de Xref: g2news1.google.com comp.lang.ada:15759 Date: 2007-05-11T18:39:10+02:00 List-Id: On 11 May 2007 01:15:15 -0700, Maciej Sobczak wrote: > On 11 Maj, 09:35, "Dmitry A. Kazakov" > wrote: > >>> I'm not asking about the spelling (which is ugly for purpose), but >>> about category. >> >> Well, as for categories, what is the benefit of having pointers? If I >> designed Ada I would make referential derived types (of the target type) >> instead. > > That would be mess. Referential derived types (of the target type) > when the target type is actually a base for some other type? These are siblings. > You mean > - pointer as a type derived from Vehicle that can refer to Cars, > Planes and Boats? No. To have this it should be a pointer type to / derived from Vehicle'Class. (When you derive from Vehicle you obtain a member of Vehicle'Class, not the class itself. So, no derived type knows anything about its siblings) >>> Then put a run-time check in this Very_Hard_..._Operator. >> >> That might mean overhead on some architectures. > > Then don't put the test and enjoy undefined behavior, just like with > U_D. This is what "Unchecked" stands for in Unchecked_Deallocation. Undefined operators is in the realm of C++ (:-)). >>>> Further even if a pointer is constructed with new, it >>>> can be subject of GC. >> >>> So? GC does not prevent me from calling U_D or Very_..._Operator. >> >> My comment was about symmetry between new and free. > > OK. But even then, GC is not a package that can be just with'ed. It is > something that has some magic connections with the rest of the runtime > and as such is part of the language implementation. I think GC could be made a well-isolated package, because pointers are typed in Ada. I don't refer to anonymous access types which are agreed being a C-ish mess. But normal access types are named, so you can set GC at an access type and only at it. > The same about U_D > - I still don't see why it is a library procedure. It plays an > important role in the language implementation and if its allocating > counterpart is a built-in operation, then U_D should be built-in as > well. If you are asking about "would be nice," then I would make both primitive operations of the access type interface. And I certainly don't want any more reserved dictionary words. It became a plague in Ada. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de