On 09/28/2010 03:41 PM, Pavel Stehule wrote:
It's not simple - FOR i IN array is natural - Original ADA use a very
similar construct.
No it doesn't. In Ada (Note: not ADA) FOR can only iterate over one
thing: a discrete subtype (e.g. an integer or enumeration type, or a
range of it)[1]. You can say:
for i in my_array'range loop ...
but that iterates over the array's index, not over its values.And there
is no ambiguity with other things you might loop over because there
aren't any.
cheers
andrew
[1]http://www.adaic.org/standards/05rm/html/RM-5-5.html