Discriminants.

Pascal <[email protected]>
Newsgroups gmane.comp.lang.ada.france
Message-ID <[email protected]>
Bonjour, petite question sur les discriminants:
Je souhaite écrire:
type TÉléments is array (Natural range <>) of Integer;
type Typ (Max : Natural := 256) is  record
	Éléments : TÉléments(0..Max-1):=(others=>0);
	end record;
X : Typ(20);
Mais GNAT me renvoi :
"discriminant in constraint must appear alone"

Bien, je n'ai pas trouvé cette contrainte dans le § "3.7  
Discriminants" du manuel, mais les exemples proposés sont conformes.

Bien, je pourrais évidemment déclarer:
type TÉléments is array (Natural range <>) of Integer;
type Typ (Max : Natural := 255) is  record
	Éléments : TÉléments(0..Max):=(others=>0);
	end record;
X : Typ(20-1);

Mais, pourquoi ne pas pouvoir écrire Max-1 ?

Cordialement, Pascal.
http://blady.pagesperso-orange.fr






_______________________________________________
Site WWW de l'association Ada-France: http://www.ada-france.org/
[email protected]
http://www.ada-france.org/mailman/listinfo/ada-france
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.