comp.lang.ada
 help / color / mirror / Atom feed
From: "Yannick Duchêne (Hibou57)" <yannick_duchene@yahoo.fr>
Subject: Re: Q: SPARK visibility rules and inherit annotations.
Date: Tue, 25 May 2010 22:58:41 +0200
Date: 2010-05-25T22:58:41+02:00	[thread overview]
Message-ID: <op.vc94j3saule2fv@garhos> (raw)
In-Reply-To: 85n6d9F9v4U1@mid.individual.net

Le Fri, 21 May 2010 12:42:53 +0200, Gavino <invalid@invalid.invalid> a  
écrit:
> Firstly, derived types can introduce overloaded enumeration literals,  
> which
> SPARK prohibits.
> Secondly, if the parent type is one declared immediately within the  
> visible
> part of a package, then certain subprograms declared there are implicitly
> declared for the derived type, again a form of overloading.
Yes, I forget about it, and especially about the first one (about  
enumeration literals).

This part of the one which is the most troublesome to me with SPARK, as I  
like to “type ... is new ...” some types are not be mixed and the  
interface defines special function when it is required. At least, when  
mixed is done, this is clearly visible and this is a clear indication on  
source review to look at it three times better than two.

Subtype is nice with SPARK, as validity conditions are checked. But if the  
source is to be as nice with and without SPARK, some troubles comes :  
subtype are not so much nice without SPARK. Ada with SPARK less needs  
derived types, and subtype is enough, but Ada without SPARK, needs derived  
types. So I can't have something which is good without SPARK too... or I  
have to make all numeric types independent, but doing so, I miss the  
expression of relations between these types.

Any way, thanks for your reply, which was the good one (this recalled me a  
detail I had forget, as I'm not really relying on it).

-- 
There is even better than a pragma Assert: a SPARK --# check.



  reply	other threads:[~2010-05-25 20:58 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-19 15:04 Q: SPARK visibility rules and inherit annotations Peter C. Chapin
2010-05-19 15:54 ` Phil Thornley
2010-05-19 21:29   ` Peter C. Chapin
2010-05-20  1:47     ` Yannick Duchêne (Hibou57)
2010-05-20 11:03       ` Gavino
2010-05-20 15:58         ` Yannick Duchêne (Hibou57)
2010-05-21 10:42           ` Gavino
2010-05-25 20:58             ` Yannick Duchêne (Hibou57) [this message]
2010-05-19 16:22 ` Yannick Duchêne (Hibou57)
2010-05-19 20:41   ` Gavino
replies disabled

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