|
|
|
Re: how to write "for" logic in ATL [message #969690 is a reply to message #968378] |
Sat, 03 November 2012 13:02 |
|
Op 02/11/12 13:14, Ed Willink schreef:
> The OCL idiom is
>
> Sequence{0..99}->forAll(n | ... )
>
> On 01/11/2012 17:20, Kosala Yapa wrote:
>> for (int n=0; n<100;n++){
>>
>> }
>>
>> How to write this logic in atl?
>>
>> ATL for logic used in collection is a bit different to this requirement.
>> Here, iteration needs to happen until the condition becomes false.
I suppose I can add the following bit of knowledge to this:
http://c2.com/cgi/wiki?RecursionVsLoop
In ATL, you should use recursion rather than loops. It is equally expressive,
and fits better into ATL's mainly functional programming model.
Cheers,
Dennis
Cheers,
Dennis
|
|
|
Powered by
FUDForum. Page generated in 0.03895 seconds