-
-
Notifications
You must be signed in to change notification settings - Fork 232
Closed
Description
With the latest version of MTK we now have the prev()
syntax to designate in events which values are from before the triggering of the event (and which are from after the event). I.e.
(X ~ 2.0) => [X ~ pre(X) + 1.0]
designates an event where, once X
reaches the value 2.0
, 1.0
unit for X
is added.
I think it would be nice to support a syntax where one can rather designate which values are from the updated system, i.e. so that one can write:
(X ~ 2.0) => [new(X) ~ X + 1.0]
Advantages include:
- The same syntax is used for the condition and affect part. I.e. right now the
pre()
is implied across all conditions. While this is implicitly obvious, it is still nice to have a syntax be consistent across the entire event. - In the vast majority of cases (at least that I can imagine), there is only a single symbolic variable for the post-event system (and this is typically isolated on the lhs). However, multiple pre-event symbolic variables are not that plausible. The syntax
new(X) ~ ...
simply feels a bit cleaner thanX ~ pre(X + Xup + ...)
.
Considerations:
- Practically, an event declared using the
new
notation could directly (and internally) be converted to one using thepre
notation (but just flipping all variables). - Events using both
new
andpre
should probably be disallowed. - This doesn't actually add any new functionality, and only offers some syntax improvement, so it is relatively low priority.
Metadata
Metadata
Assignees
Labels
No labels