comp.lang.ada
 help / color / mirror / Atom feed
From: Reivilo Snuved <odevuns@iname.JUNK.com>
Subject: Re: premature usage of incomplete private type
Date: 08 Nov 2001 18:55:40 +0100
Date: 2001-11-08T18:55:40+01:00	[thread overview]
Message-ID: <st4ro5du5f.fsf@aonix.fr> (raw)
In-Reply-To: 43219ulgvi.cfu.robert-j@oberon.s-s-f.de

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 616 bytes --]

robert-j@gmx.de (Robert =?iso-8859-1?Q?J=E4schke?=) writes:

> Hello!
> 
> I'm writing a package for Rational-Arithmetics and there I've got a problem.
> I want to declare a constant of type Rational before the type itself is
> proper defined and I don't know how I can go around this problem:
[snip]

Try this : 

 package My_Math.Rational is
    type Rational is private;
    Zero : constant Rational;
 private
    type Rational is
       record
           Z : Integer;  --  Z�hler
           N : Integer;  --  Nenner
       end record;
    Zero : constant Rational := (Z => 0, N => 1);
 end My_Math.Rational;



  reply	other threads:[~2001-11-08 17:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-11-07 23:00 premature usage of incomplete private type Robert Jäschke
2001-11-08 17:55 ` Reivilo Snuved [this message]
2001-11-07 23:00   ` Robert Jäschke
replies disabled

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