Skip to main content

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

Hi,

I don't think that we reduced expressiveness. A CountedUnit with count-value access may now be implemented with a LoopUnit containing a strict/no rollback-sequence that applies a unit and modifies the counter(incl. possible break):
+ initCounter
+ LoopUnit
  +- SequentialUnit (strict/no-rollback)
    +- LoopBodyUnit
    +- ModifyCounter and check break condition
+ destroyCounter

If the counter-object is mapped from initialization to ModCheck to Destruction, the performance should not be an issue. After all, CountedUnits like for-loops are just syntactic sugar. We should treat it the same way and better focus on a solid foundation for implementing editor-derived units to sweeten the usability.

Regards,
Gregor

Am 11.01.2012 15:23, schrieb Riegerf@xxxxxxxxxxxxxxxxxxxxxxx:
Hi Christian,

Quoting Christian Krause <henshin.ck@xxxxxxxxx>:
It's more the fact that most users want to implement a While-Loop rather than a For-Loop (with a fixed count) and it is not really intuitive why one should use a "CountedUnit" for that...

but now, we have actually reduced expressiveness and added complexity for users who want to construct loops with a fixed number of iterations. If we would let the LoopUnit have its current iteration count as a Parameter, different kinds of loops could be constructed without compromising expressiveness, performance nor user effort (Gregor has shown that this can already be done, but is slower and needs a user-generated model to store the current iteration count).

Felix

_______________________________________________
henshin-dev mailing list
henshin-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/henshin-dev




Back to the top