|
Re: Acceleo : How do I compare the value of the current and the previous iteration in a for loop [message #1733986 is a reply to message #1733932] |
Thu, 02 June 2016 12:11  |
Eclipse User |
|
|
|
Hi
The pure OCL solution is to use the integer Sequence idiom
Sequence{1..N}->forAll(i : Integer | ... ->at(i) ...)
this allows you to refer to i+1/i-1 or whatever.
IIRC Acceleo has a secret "i" variable that dioes this for free. However
it is not in accord with the OMG MOFM2T specification.
Regards
Ed Willink
On 02/06/2016 13:24, Hassen Bazar wrote:
> Is it possible to compare the value of the current and the previous
> iteration in a for loop in Acceleo ? Knowing that LET can be defined
> inside for loop but it will be mutable at each current iteration,
> therefore the previous value will be lost and we will get always only
> the current value. Any idea guys ? Thanks.
|
|
|
Powered by
FUDForum. Page generated in 0.05516 seconds