Re: for-loops and subrange types

[email protected]
Newsgroups gmane.comp.compilers.gpc
Message-ID <[email protected]>
This compatibility requirement seems to imply that the control variable  
need not be an integer type.  Does this mean that
 
    Var  letter: char;
 
    for  letter := 'A' to 'Z'  do
 
is legitimate, or that the definers of the language expected  that might 
eventually be allowed?  Or does it merely mean that the  magnitudes must match 
the range, so that
 
    Var  num: smallint;
 
    for  num := 20000 to 40000  do
 
is illegal?
 
 
 
In a message dated 4/26/2013 4:28:41 P.M. Eastern Daylight Time,  
[email protected] writes:

: The  initial-value and the final-value of a sequence-iteration
: of an  iteration-clause of a for-statement shall be of a type
: compatible with  the type of control-variable of the for-statement.
: The initial-value and  the final-value shall be
: assignment-compatible with the type possesed by  the
: control-variable if the statement of the for-statement
: is  executed.

_______________________________________________
Gpc mailing list
[email protected]
https://www.g-n-u.de/mailman/listinfo/gpc
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.