comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: Question about library-level functions
Date: Mon, 17 Dec 2012 18:07:05 -0600
Date: 2012-12-17T18:07:05-06:00	[thread overview]
Message-ID: <kaoc3b$ud6$1@munin.nbi.dk> (raw)
In-Reply-To: a7a82a85-48e4-4ded-b090-06f62bd3b0b6@googlegroups.com

"AdaMagica" <christ-usch.grein@t-online.de> wrote in message 
news:a7a82a85-48e4-4ded-b090-06f62bd3b0b6@googlegroups.com...
...
>Creating via anonymous access is evil - how can ou ever deallocate it? This 
>should be verboten by the language.

A few too many words here: "anonymous access is evil" would have been 
enough. (At least for access-to-object.) The rules for accessibility (and 
thus finalization) are impossible to understand and typically require 
dynamic checks. Dynamic accessibility checks are surely evil, as they add 
overhead, create a "tripping hazard" (some uses are OK, others fail at 
runtime, which is not indicated by the specification), and only detect a 
minority of problems (most real uses have to resort to 'Unchecked_Access 
anyway).

These types were a mistake in Ada 95 and expanding their use compounded the 
mistake. Too bad it wasn't obvious from the beginning.

Vis-a-vis your original comment -- Ada 2012 at least gives restrictions that 
let users self-impose what the language does not:
   pragma Restrictions (No_Anonymous_Allocators); -- H.4(8.1/3)
   pragma Restrictions (No_Coextensions); -- H.4(8.2/3)
   pragma Restrictions (No_Access_Parameter_Allocators); -- H.4(8.3/3)

Can't make these the default for compatibility reasons, of course.

                                            Randy.





  parent reply	other threads:[~2012-12-18  0:07 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-15  3:38 Question about library-level functions ytomino
2012-12-15  9:47 ` AdaMagica
2012-12-15 10:50   ` ytomino
2012-12-15 11:38     ` AdaMagica
2012-12-17 19:49       ` Adam Beneschan
2012-12-18  2:26         ` ytomino
2012-12-15 15:23 ` sbelmont700
2012-12-16  6:09   ` ytomino
2012-12-16  9:43 ` Simon Wright
2012-12-16 10:21   ` AdaMagica
2012-12-16 13:07     ` ytomino
2012-12-16 18:31     ` Simon Wright
2012-12-18  3:18       ` ytomino
2012-12-18  0:07     ` Randy Brukardt [this message]
2012-12-16 13:34   ` ytomino
2012-12-16 15:54     ` AdaMagica
2012-12-18  0:09       ` Randy Brukardt
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox