Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [henshin-dev] LoopUnit

Hi Felix,

Am 08.01.2012 04:35, schrieb Riegerf@xxxxxxxxxxxxxxxxxxxxxxx:
Hi Christian,

Quoting Christian Krause <henshin.ck@xxxxxxxxx>:

CountedUnits with positive count can be directly modeled using SequentialUnits (correct me if I'm wrong).

You are correct, but even modeling fairly low counts (> 5) by using SequentialUnits can be quite cumbersome for the user.


To be honest, I do not see a use case in which you would want a CountedUnit, with say, exactly 10 or 20 iterations. Anyway, I think additional user support for creating sequential units with n times the same unit as Enrico suggested is sufficient.

The only interesting case is when the count value is negative, which should have a "loop as long as possible" semantics. Since this is the only interesting case, I suggest that we remove CountedUnit from the model and add a LoopUnit, which behaves like a CountedUnit with a negative count value.

I don't yet see the benefit of removing functionality, but we could add a parameter to the LoopUnit which can be used to track the current iteration. That way, a simple Rule containing only a Parameter and an AttributeCondition could be used to implement various types of loops in a relatively straightforward way. So, is it possible to automatically add a Parameter to a Unit? (Some slight editor rewrite might be needed, but as this effects the Unit's semantics, the interpreter engine needs to be adapted)


Sorry, I don't understand where you want to go with this. From my perspective, I don't want to remove or add functionality, just rename the concepts if you will.

Cheers,
Christian


Felix




Back to the top