comp.lang.ada
 help / color / mirror / Atom feed
From: "J-P. Rosen" <rosen@adalog.fr>
Subject: Re: controlled types and point of instanciation
Date: Fri, 16 Mar 2018 17:31:51 +0100
Date: 2018-03-16T17:31:51+01:00	[thread overview]
Message-ID: <p8grhk$14gb$1@gioia.aioe.org> (raw)
In-Reply-To: c016f55f-417f-42c9-84cf-ea68052ebd22@googlegroups.com

Le 16/03/2018 à 15:39, Mehdi Saada a écrit :
> I make the humble request of an exegesis of this text: (from ada 95 the craft of oriented programming)
> "Since Ada.Finalization.Limited_Controlled and Ada.Finalization.Controlled are both library-level types, all controlled types must be derived by instantiation at library level. Since generic packages are treated as being declared at the point of instantiation, this means that JE.Lists can only be instantiated at library level, usually within the specification of another library package. This means that we can no longer use JE.Lists to build opaque types as [bellow]. Instantiating JE.Lists inside a package body is no longer permissible."

This was a rule of Ada95 intended to prevent accessing non existing
objects, but very annoying in practice, precisely because it forbad
instantiating the containers anywhere else than at library level.

Since Ada 2005, it has been replaced by a run-time check, so you don't
need to worry.

-- 
J-P. Rosen
Adalog
2 rue du Docteur Lombard, 92441 Issy-les-Moulineaux CEDEX
Tel: +33 1 45 29 21 52, Fax: +33 1 45 29 25 00
http://www.adalog.fr

  reply	other threads:[~2018-03-16 16:31 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-16 14:39 controlled types and point of instanciation Mehdi Saada
2018-03-16 16:31 ` J-P. Rosen [this message]
2018-03-16 17:14   ` Mehdi Saada
2018-03-16 18:06 ` Mehdi Saada
2018-03-16 21:44   ` Jeffrey R. Carter
2018-03-17  0:54 ` Mehdi Saada
replies disabled

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