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=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,80bc3e0698be468f X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local01.nntp.dca.giganews.com!nntp.megapath.net!news.megapath.net.POSTED!not-for-mail NNTP-Posting-Date: Mon, 30 Jan 2006 20:09:01 -0600 From: "Randy Brukardt" Newsgroups: comp.lang.ada References: <1138260496.230283.147640@g43g2000cwa.googlegroups.com> <1138283608.433842.76060@z14g2000cwz.googlegroups.com> <87fynaajuh.fsf@mid.deneb.enyo.de> <1138322309.525464.253320@z14g2000cwz.googlegroups.com> <15595105.IY1iVEeMMt@linux1.krischik.com> Subject: Re: Type safety on wikipedia Date: Mon, 30 Jan 2006 20:13:52 -0600 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 Message-ID: <-YadnXqKU6ogW0PenZ2dnUVZ_tidnZ2d@megapath.net> NNTP-Posting-Host: 64.32.209.38 X-Trace: sv3-vu8rmYCcXY4ZsQBqDhn8LYG+PBFcvD459Mi0IUPq89vGe4ljdglkgDocyoNUUxkyfvxPmEUf6Y+NaTi!Pne3ShJcXAW4HONtjB1IrvW9b+cD+uEXVmh2Vu9WX1AmqrmA/Lh/qL0AMHLrmZVb206yxuJtYRMF!xea702GzrRb8Ww== X-Complaints-To: abuse@megapath.net X-DMCA-Complaints-To: abuse@megapath.net X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.32 Xref: g2news1.google.com comp.lang.ada:2716 Date: 2006-01-30T20:13:52-06:00 List-Id: "Jan Andres" wrote in message news:dreihb$712$1@pitr.home.jan... ... > Hmm, but aren't all the restrictions on the scope of access values > actually there in order to guarantee type safety, as long as no unsafe > constructs like 'Unchecked_Access are used? Or is > Unchecked_Deallocation itself considered to be such an unsafe construct? > If so, is there any "safe" alternative in Ada that we can use if we > don't have GC? > > Of course you could simply avoid such constructs as quoted above but > the downside is that the language will not actually enforce this. The language (well, a compiler) can be made to enforce "No Unchecked_Deallocation" using pragma Restrictions (No_Unchecked_Deallocation); Similarly, you can prevent the use of 'Unchecked_Access with pragma Restrictions (No_Unchecked_Access); [Note that these are program-wide, which might restrict the standard packages that you can use.] You can avoid using Unchecked_Deallocation if you can arrange for the access type itself to go away, and then use a storage_pool for the storage. Or, sometimes, you never need to free the data structure anyway (a compiler symbol table comes to mind; it exists until the compile finishes). But both of those are often impractical. Randy.