Enumerated types_(re)

Tue, 10 Jun 1997 15:53:22 +0200


 
Phil Nelson wrote:
 
> Another problem ... it will make pred() and succ() harder if they must
> do succ(Greater) => Strange and pred(Strange) => Greater.  I think setting
> the initial value would be reasonable, but not allowing a jump in the values.

Another possibility would be to let succ (and inc) just increase the ordinal
value by 1, then test (with the generic range checking procedure) if it's a
valid ordinal value. I'm not sure if succ/inc are supposed to work this way
or the other, what does the standard say?
-- 
Frank Heckenbach, Erlangen, Germany
heckenb@mi.uni-erlangen.de
Turbo Pascal:   http://www.mi.uni-erlangen.de/~heckenb/programs.htm
Internet links: http://www.mi.uni-erlangen.de/~heckenb/links.htm


Frank Heckenbach (heckenb@mi.uni-erlangen.de)

HTML conversion by Lluís de Yzaguirre i Maura
Institut de Lingüística Aplicada - Universitat "Pompeu Fabra"
e-mail: de_yza@upf.es