User Tools

Site Tools


eiffel:faq:loops_across_iteration

Eiffel Loops and Iteration

Loop

from
    i := 0
    n := 10
invariant
    n
until
    i >= 10
loop
    i := i + 1
variant
    n-i
end

Iteration with across

across list_of_customers as customer loop
    Io.put_string (customer.item.name)
    Io.new_line
end
 
 
across 1 |..| 5 as it loop
    Io.put_integer (it.item)
    Io.new_line
end
eiffel/faq/loops_across_iteration.txt · Last modified: 2018/05/17 18:08 by jonathan