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.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM 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!postnews.google.com!e51g2000hsg.googlegroups.com!not-for-mail From: Maciej Sobczak Newsgroups: comp.lang.ada Subject: Re: Unchecked_Deallocation vs. delete Date: 11 May 2007 01:15:15 -0700 Organization: http://groups.google.com Message-ID: <1178871315.928116.262190@e51g2000hsg.googlegroups.com> References: <1178728045.890171.6110@q75g2000hsh.googlegroups.com> <1hzydt9ej6az6$.12jl0su9budun.dlg@40tude.net> <1178827771.416316.210790@y80g2000hsf.googlegroups.com> NNTP-Posting-Host: 137.138.37.241 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Trace: posting.google.com 1178871316 26888 127.0.0.1 (11 May 2007 08:15:16 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Fri, 11 May 2007 08:15:16 +0000 (UTC) In-Reply-To: User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.0.10) Gecko/20070228 Red Hat/1.5.0.10-0.1.slc3 Firefox/1.5.0.10,gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: e51g2000hsg.googlegroups.com; posting-host=137.138.37.241; posting-account=Ch8E9Q0AAAA7lJxCsphg7hBNIsMsP4AE Xref: g2news1.google.com comp.lang.ada:15749 Date: 2007-05-11T01:15:15-07:00 List-Id: On 11 Maj, 09:35, "Dmitry A. Kazakov" wrote: > > Why not make a > > Very_Hard_To_Use_Unchecked_Deallocation_Built_In_Operator instead? > > Primitive operation of the access type you mean, there is no need to > introduce an operator. If there was a need to introduce 'new' as an operator... > > 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? You mean - pointer as a type derived from Vehicle that can refer to Cars, Planes and Boats? That would make the pointer (OK, "referer") a sibling of those other, concrete types. From when do we have types asymetrically refering to their siblings in the hierarchy? Complete mess. > > 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. > > Or, why not making separate "subtypes" of pointers? > > Sure, I am with you. With the storage pool considered a discriminant of the > access type, it would be easy. But look at the recent debate about > discriminated types. There is no acceptance here. Yes. > >> 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. 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. -- Maciej Sobczak http://www.msobczak.com/