comp.lang.ada
 help / color / mirror / Atom feed
From: Lutz Donnerhacke <lutz@iks-jena.de>
Subject: Re: [Spark] Using defered constants
Date: Wed, 16 Apr 2003 13:37:11 +0000 (UTC)
Date: 2003-04-16T13:37:11+00:00	[thread overview]
Message-ID: <slrnb9qn43.12t.lutz@taranis.iks-jena.de> (raw)
In-Reply-To: cf2c6063.0304160501.62dcbd9d@posting.google.com

* Rod Chapman wrote:
> Lutz Donnerhacke <lutz@iks-jena.de> wrote in message news:>    7  private
>>    8     --# hide t;
>>    9     type x is new Integer;
>>   10     cx : constant x := 0;
>>   11  end t;
>
> Tricky!  You are trying to arrange a package as follows:
>    Visible spec: SPARK
>    Private part of spec: hidden, Ada95
>    Body: SPARK

Ack.

> This is actually very difficult, since logically the private is
> _is_ part of the body!

But the initialisation of deferred constants is elaborated before the body
of the package. It's impossible to move the initialisation into the body
itself. Therefore the examiner must assume, that the hidden part will
initialisation the deferred constant.

> In partiular, the Examiner does not assume anything much about the
> content of the private part when analysing the body, hence the error that
> you're seeing.

Bad. Sad.

> Obvious point: why "type x is new Integer;"??  Do you really
> need an explicit derived type there?

It's an example. I need an access type there.




  reply	other threads:[~2003-04-16 13:37 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-04-15 13:18 [Spark] Using defered constants Lutz Donnerhacke
2003-04-16 13:01 ` Rod Chapman
2003-04-16 13:37   ` Lutz Donnerhacke [this message]
2003-04-16 15:05     ` Hyman Rosen
2003-04-16 15:15       ` Lutz Donnerhacke
2003-04-16 15:27       ` Vinzent Hoefler
2003-04-23  9:28 ` Peter Amey
2003-04-23 10:52   ` Lutz Donnerhacke
replies disabled

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