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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,5dcca0c20988c23c,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-08-27 00:51:03 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!news-FFM2.ecrc.net!news.iks-jena.de!not-for-mail From: Lutz Donnerhacke Newsgroups: comp.lang.ada Subject: Defining types in private packages for use in parent spec Date: Wed, 27 Aug 2003 07:51:02 +0000 (UTC) Organization: IKS GmbH Jena Message-ID: NNTP-Posting-Host: taranis.iks-jena.de X-Trace: branwen.iks-jena.de 1061970662 16906 217.17.192.37 (27 Aug 2003 07:51:02 GMT) X-Complaints-To: usenet@iks-jena.de NNTP-Posting-Date: Wed, 27 Aug 2003 07:51:02 +0000 (UTC) User-Agent: slrn/0.9.7.4 (Linux) Xref: archiver1.google.com comp.lang.ada:41879 Date: 2003-08-27T07:51:02+00:00 List-Id: How to solve the following problem? It's necessary to define the type Base in the implementation defined private subpackage, because it varies on various implementations. ------------------------------------------------------------------------ package Bigints is type Bigint is limited private; private type Base_Array; type Base_Access is access Base_Array; type Bigint is limited record data : Base_Access; end record; end Bigints; with System; private package Bigints.Implementation is type Base is mod System.Max_Binary_Modulus; procedure Demo(a : in out Bigint); end Bigints.Implementation; with Bigints.Implementation; package body Bigints is subtype Base is Implementation.Base; type Base_Array is array(Positive range <>) of Base; end Bigints; package body Bigints.Implementation is procedure Demo(a : in out Bigint) is begin for i in a.data'Range loop null; end loop; end Demo; end Bigints.Implementation; ------------------------------------------------------------------------ gcc -c bigints.adb gcc -c bigints-implementation.adb bigints-implementation.adb:5:17: prefix for "Range" attribute must be array gnatmake: "bigints-implementation.adb" compilation error