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,XPRIO autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,cd477c49ed6096e8,start X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!fu-berlin.de!uni-berlin.de!not-for-mail From: "Martin Dowie" Newsgroups: comp.lang.ada Subject: AI-344, generics/instances... Date: Thu, 16 Sep 2004 13:58:35 +0100 Organization: BAE SYSTEMS Message-ID: <41498c90$1_1@baen1673807.greenlnk.net> X-Trace: news.uni-berlin.de /avkBVaBNbGtlj4dbRYEHwfnbsAIxZRxpZ3z1sXAq22u3HceLc X-Orig-Path: baen1673807.greenlnk.net!baen1673807!not-for-mail X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4807.1700 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4807.1700 X-Original-NNTP-Posting-Host: baen1673807.greenlnk.net Xref: g2news1.google.com comp.lang.ada:3772 Date: 2004-09-16T13:58:35+01:00 List-Id: Just a thought that popped into my head and I wanted a 'sanity' check on if first... With AI-344 generic packages that define a tagged type no longer have to be instantiated at library level. I was wondering if it would be useful to define a mechanism (pragma?) that allowed an author to insist that a generic package be instantiated at library level. This came to me when I was looking at my Singleton pattern, which is just fine for Ada95 but will be much more open to abuse come Ada0Y. My code looks roughly like this: generic package Patterns.Generic_Singletons is type Singleton is tagged private; private -- Implementation that uses assumes library level instance end Patterns.Generic_Singletons; Perhaps something as simple as: generic package Patterns.Generic_Singletons is pragma Library_Level_Unit; -- new pragma type Singleton is tagged private; private -- Implementation that uses assumes library level instance end Patterns.Generic_Singletons; Our am I missing something? Cheers -- Martin