while [message #534162] |
Tue, 18 May 2010 05:17  |
Eclipse User |
|
|
|
Hi,
how I can express in ocl:
while (w different from empty sequence) do?
thanks
|
|
|
|
|
|
|
Re: while [message #534937 is a reply to message #534162] |
Thu, 20 May 2010 13:28  |
Eclipse User |
|
|
|
Quote: | The variable element is the iterator variable. The resulting value is accumulated in the variable result, which is also called the accumulator. The accumulator gets an initial value, given by the expression after the equal sign. None of the parameters is optional
The result of the iterate operation is a value obtained by iterating over all elements in a collection. For each successive element in the source collection, the body expression (<expression-with-element-and-result>) is calculated using the previous value of the result variable. A simple example of the iterate operation is given by the following expression, which results in the sum of the elements of a set of integers:
|
Set{1,2,3}->iterate( i: Integer, sum: Integer = 0 | sum + i )
|
|
|
Powered by
FUDForum. Page generated in 0.32515 seconds