comp.lang.ada
 help / color / mirror / Atom feed
From: "Yannick Duchêne (Hibou57)" <yannick_duchene@yahoo.fr>
Subject: Re: Static bounds of loop - compilation error
Date: Tue, 30 Oct 2012 18:15:36 +0100
Date: 2012-10-30T18:15:36+01:00	[thread overview]
Message-ID: <op.wmz4waacule2fv@cardamome> (raw)
In-Reply-To: op.wmz4cc1nule2fv@cardamome

Le Tue, 30 Oct 2012 18:03:38 +0100, Yannick Duchêne (Hibou57)  
<yannick_duchene@yahoo.fr> a écrit:
> Note that you can also declare the type at the iteration variable too, a  
> good practice, which is even mandatory with SPARK. Unfortunately, doing  
> this, ends in a GNAT bug‑box:
>
>      procedure T is
>         type E is (A, B, C);
>         subtype S is E range A .. B;
>         X, Y : S;
>      begin
>         X := A;
>         Y := B;
>         for I : S in X .. Y loop
>            case I is
>               when A => null;
>               when B => null;
>            end case;
>         end loop;
>      end T;

Oops, sorry, I'm buggy. That's erroneous, the syntax is not good. I don't  
know why GNAT gives a bug box instead. That's only `for I in S range X ..  
Y loop` as in the original message.


-- 
“Syntactic sugar causes cancer of the semi-colons.” [1]
“Structured Programming supports the law of the excluded muddle.” [1]
[1]: Epigrams on Programming — Alan J. — P. Yale University



  reply	other threads:[~2012-10-30 17:15 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-30 13:26 Static bounds of loop - compilation error pascal.malaise
2012-10-30 14:37 ` Georg Bauhaus
2012-10-30 16:10 ` Adam Beneschan
2012-10-30 17:03   ` Yannick Duchêne (Hibou57)
2012-10-30 17:15     ` Yannick Duchêne (Hibou57) [this message]
2012-10-31 13:18       ` Marc C
2012-10-31 16:23 ` pascal.malaise
replies disabled

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