Combination of with
/then
and given
/yields
#909
Replies: 2 comments
-
Some invariants we should consider:
This implies that the sequence must be {with, given} happens-before {annotated expression} happens-before {then, yields}. We can choose the order among with, given and then, yields. Please note that if we want to support intermixing with, given and/or then, yields, this will be somewhat inconvenient to implement, since non-invocations may also have with/then annotations, but no given/yields annotations. Furthermore, given and yields parameters are stored inside the invocation from an early point, whereas with and then explicitly surround expressions. |
Beta Was this translation helpful? Give feedback.
-
To give my personal opinion:
Mostly because I don't see the direct benefit of being much more flexible than this, but I'm open to being convinced otherwise. Upside to being restrictive is that it's easy to explain. Abbreviating those points with improvised regex syntax:
In terms of evaluation order, I'd prefer if it followed the syntactical order from above left-to-right. (With the exception of computation of the targets of the yields assignments - these go before the annotated expression, if I understand the current implementation intention correctly). Afaict, this is all compatible with what Pieter stated above. |
Beta Was this translation helpful? Give feedback.
-
What should the rules be around combining
with
/then
/given
/yields
? Can they be interleaved arbitrarily, and if so, what are the evaluation rules? Or do we only allow a chain ofwith
s, followed by onegiven
, oneyields
, and one or morethen
s? Are there other options we should consider?Related: #907
Beta Was this translation helpful? Give feedback.
All reactions