comp.lang.ada
 help / color / mirror / Atom feed
From: Stephen Leake <Stephe.Leake@nasa.gov>
Subject: Re: Defining types in private packages for use in parent spec
Date: 29 Aug 2003 13:02:42 -0400
Date: 2003-08-29T17:04:46+00:00	[thread overview]
Message-ID: <usmnktn0t.fsf@nasa.gov> (raw)
In-Reply-To: slrnbkoon6.o6.lutz@taranis.iks-jena.de

Lutz Donnerhacke <lutz@iks-jena.de> writes:

> 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;

One option is to add an "iterator" subprogram here, that
Bigints.Implementation.Demo can use to walk thru Base_Array.

> with System;
> private package Bigints.Implementation is
>    type Base is mod System.Max_Binary_Modulus;
>    procedure Demo(a : in out Bigint);
> end Bigints.Implementation;

Another option is to move Demo to Bigints (where it can see the array
type). 


-- 
-- Stephe



      parent reply	other threads:[~2003-08-29 17:02 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-08-27  7:51 Defining types in private packages for use in parent spec Lutz Donnerhacke
2003-08-27  8:56 ` Dmitry A. Kazakov
2003-08-27  9:03   ` Lutz Donnerhacke
2003-08-29 17:02 ` Stephen Leake [this message]
replies disabled

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