comp.lang.ada
 help / color / mirror / Atom feed
From: "Robert I. Eachus" <eachus@mitre.org>
Subject: Re: Constructing a modular type based on the size of an arbitrary type
Date: 1999/09/14
Date: 1999-09-14T23:36:38+00:00	[thread overview]
Message-ID: <37DEDD10.9A6939EE@mitre.org> (raw)
In-Reply-To: 37DE9983.454243@lmco.com



Mark A Biggar wrote:
 
> Unfortunately, I beleive the only way to handle this is to move the
> burden of defining the appropriate modular type out of the generic
> and pass it in as a generic parameter along with the conversion
> functions.

  You don't have to go quite that far.  There is no way to pass the
modulus as a generic formal, since generic formals are never static. 
You could declare the modulus in an outer scope, but the best solution
is probably to pass in the modulus as an attribute of a generic formal. 
Huh?  Simple example:

    generic
      type Modular is mod <>;
    package Foo is
      ...
      type Generic_Mod is new Modular;
      ...
    end Foo;

    At worst this requires declaring a "extra" modular type that is
never used elsewhere just before each generic instantiation.

-- 

                                        Robert I. Eachus

with Standard_Disclaimer;
use  Standard_Disclaimer;
function Message (Text: in Clever_Ideas) return Better_Ideas is...




      reply	other threads:[~1999-09-14  0:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-09-14  0:00 Constructing a modular type based on the size of an arbitrary type Mike Bates
1999-09-14  0:00 ` Mark A Biggar
1999-09-14  0:00   ` Robert I. Eachus [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