comp.lang.ada
 help / color / mirror / Atom feed
From: "Jeffrey R. Carter" <spam.jrcarter.not@spam.not.acm.org>
Subject: Re: Good/best way to enforce library-level instantiation a generic package
Date: Wed, 18 Mar 2020 10:23:08 +0100
Date: 2020-03-18T10:23:08+01:00	[thread overview]
Message-ID: <r4sp9u$m59$1@dont-email.me> (raw)
In-Reply-To: <r4rs1l$9bu$1@franka.jacob-sparre.dk>

On 3/18/20 2:03 AM, Randy Brukardt wrote:
> "Jeffrey R. Carter" <spam.jrcarter.not@spam.not.acm.org> wrote in message
> news:r4qbs8$192$1@dont-email.me...
>>
>> type T is abstract tagged null record;
>> Name : constant String := Ada.Tags.Expanded_Name (T);
>> pragma Assert
>>     (Ada.Strings.Fixed.Index (Name (Name'First .. Name'Last - 2), ".") = 0,
>>      "Generic_Name must be instantiated at library level");
> 
> That would reject an instance in a library-level child package, which
> probably isn't what the OP wants.

An instance IN a child pkg is not a library-level instance, so the OP would want 
to reject it. But an instance AS a library-level child pkg would be rejected, so 
this doesn't work.

AFAICT, a child pkg can only be a library-level pkg, so "library-level child 
pkg" seems like overqualification.

-- 
Jeff Carter
"My mind is aglow with whirling, transient nodes of
thought, careening through a cosmic vapor of invention."
Blazing Saddles
85

  reply	other threads:[~2020-03-18  9:23 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-16 18:51 Good/best way to enforce library-level instantiation a generic package Vincent Marciante
2020-03-17  1:21 ` Randy Brukardt
2020-03-17 10:11   ` Vincent Marciante
2020-03-17 11:21   ` Jeffrey R. Carter
2020-03-18  1:03     ` Randy Brukardt
2020-03-18  9:23       ` Jeffrey R. Carter [this message]
2020-03-20 20:37         ` Randy Brukardt
2020-03-18 10:27       ` Vincent Marciante
2020-03-17  6:29 ` briot.emmanuel
2020-03-17 10:15   ` Vincent Marciante
replies disabled

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