Open brice-morin opened 7 years ago
It would be nice to have two different syntaxes if you want to loop over the variable or the indices, like:
foreach ( value in array ) do
...
end
(the type of the value is given by the type of the array) and:
foreach ( index i : Integer in array ) do
...
end
And maybe break/continue in both foreach and while loops :)
Brice: Or a combined one:
for index, value in array do
...
end
The compilers could make some optimizations if we only use index or value.
Jakob:
Yes, a combined one also makes sense. But I guess it should be required to specify the type of the index so that the compiler doesn't need to guess. And I also like the idea of using an index
keyword (and possibly value
as well) so that it is clear what is the value and what is the index.
CEP as a feature: does this mean based on ReactiveX or in connection with Apama? What are the plans for a feature?
This is more a a meta-issue and whould be broken down in individual feature requests
while
loop (typically not incrementing the index)