comp.lang.ada
 help / color / mirror / Atom feed
From: "Yannick Duchêne (Hibou57)" <yannick_duchene@yahoo.fr>
Subject: Re: Subtypes boundaries
Date: Tue, 15 Jun 2010 01:31:47 +0200
Date: 2010-06-15T01:31:47+02:00	[thread overview]
Message-ID: <op.vebcy90dxmjfy8@garhos> (raw)
In-Reply-To: 2b13f46b-65f9-450a-bb66-68c6093791c4@s9g2000yqd.googlegroups.com

Le Mon, 14 Jun 2010 23:01:17 +0200, Gautier write-only  
<gautier_niouzes@hotmail.com> a écrit:
> To my surprise, it looks legal Ada.
The base type of IDEFIX is ASTERIX, by definition.

[ARM 2005 3.5(5)] just says:
> For a subtype_indication containing a range_constraint, either directly 
> or as part of some other scalar_constraint, the type of the range shall
> resolve to that of the type determined by the subtype_mark of the
> subtype_indication.

Nowhere in 3.5 I could find something explicitly stating when the error  
must be detected (compile time or runtime).

If the ranges was defined using non-literal, like values of type ASTERIX,  
and if these was variables, then there would be no other way except a  
runtime detection of an error.

What disturbed me, is that a literal here, match an ASTERIX while it is  
statically out-of range ?

Needs investigation in the RM (or may be the reference lacks something  
here ?). What is the RM part involved here ?

-- 
There is even better than a pragma Assert: a SPARK --# check.
--# check C and WhoKnowWhat and YouKnowWho;
--# assert Ada;
--  i.e. forget about previous premises which leads to conclusion
--  and start with new conclusion as premise.



  reply	other threads:[~2010-06-14 23:31 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-14 20:25 Subtypes boundaries Nobody
2010-06-14 20:36 ` Jeffrey R. Carter
2010-06-17 18:54   ` Nobody
2010-06-17 18:58     ` Nasser M. Abbasi
2010-06-17 19:17     ` Jeffrey R. Carter
2010-06-17 19:53     ` Ludovic Brenta
2010-06-14 20:43 ` Nobody
2010-06-14 21:01   ` Gautier write-only
2010-06-14 23:31     ` Yannick Duchêne (Hibou57) [this message]
2010-06-15  0:01       ` Peter C. Chapin
2010-06-15  0:58         ` Adam Beneschan
2010-06-15  1:05       ` Nobody
2010-06-15  1:20         ` Adam Beneschan
replies disabled

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