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.

Thanks in advance!

K]]>

The OCL idiom is

Sequence{0..99}->forAll(n | ... )

Regards

Ed Willink

On 01/11/2012 17:20, Kosala Yapa wrote:

> Hi there,

>

> 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.

>

>

>

> Thanks in advance!

> K]]>

>

> 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]]>