Try to clean up clause-meaning.#3896
Conversation
|
That is a lot of body of… we better make sure we really like this new terminology. |
I agree that it is used a lot, but to me that is necessary to differentiate between Using "in a when-clause" to refer to "in the body of when-clause" (i.e., excluding its condition) as previously done isn't very clear (apart from the terminology not being applied consistently). Obviously something other than "body" could be used, but we used "body" a few times before. |
|
Just changing body of |
Done. For those clauses. Note that "body of" is used in some other places as well (not changed by this PR), we should clean up that later. |
|
Poll: |
Co-authored-by: Henrik Tidefelt <henrikt@wolfram.com>
| After solving the initialization problem, both \lstinline!b! and \lstinline!pre(b)! are false. | ||
| During transient analysis, \lstinline!initial()! is false, so \lstinline!b! changes from falso to true during the first round of the initial event iteration. | ||
| This triggers the \lstinline!when!-clause, and \lstinline!x! gets reinitialized. | ||
| This triggers the \lstinline!when!-clause body, and \lstinline!x! gets reinitialized. |
There was a problem hiding this comment.
Isn't it better to speak of triggered branches than triggered bodies?
| This triggers the \lstinline!when!-clause body, and \lstinline!x! gets reinitialized. | |
| This triggers the \lstinline!when!-clause branch, and \lstinline!x! gets reinitialized. |
There was a problem hiding this comment.
As above I think that only the body is active/triggered.
There was a problem hiding this comment.
I'd say it's especially when speaking of triggering that branch makes much better sense than body.
There was a problem hiding this comment.
Thinking more I believe that a solution might be something subtly different (which indicates that more time is needed).
I still think that only the body is really triggered, whereas the condition is triggering it.
Both of these are part of the branch, so to me it seems that the branch should be more active (instead of passively getting triggered). Perhaps something like:
| This triggers the \lstinline!when!-clause body, and \lstinline!x! gets reinitialized. | |
| The \lstinline!when!-clause branch triggers, and \lstinline!x! gets reinitialized. |
possibly replace "triggers" by "triggers based on the change in b".
There was a problem hiding this comment.
The difference is very subtle and I don't see why the active way to see it would make more sense than the passive, while at least the passive is more easy to concisely connect with the previous sentence.
Co-authored-by: Henrik Tidefelt <henrikt@wolfram.com>
Co-authored-by: Henrik Tidefelt <henrikt@wolfram.com>
|
I have completed my initial sweep over this now, but need to take a break now and continue later today. |
Co-authored-by: Henrik Tidefelt <henrikt@wolfram.com>
Co-authored-by: Henrik Tidefelt <henrikt@wolfram.com>
Co-authored-by: Henrik Tidefelt <henrikt@wolfram.com>
Co-authored-by: Henrik Tidefelt <henrikt@wolfram.com>
Co-authored-by: Henrik Tidefelt <henrikt@wolfram.com>
|
I think there are so many minor things that it is best to delay this PR (as it is just a clarification, not a new feature). |
Co-authored-by: Henrik Tidefelt <henrikt@wolfram.com>
Co-authored-by: Henrik Tidefelt <henrikt@wolfram.com>
Moving and adjusting line. Co-authored-by: Henrik Tidefelt <henrikt@wolfram.com>
Move modified line Co-authored-by: Henrik Tidefelt <henrikt@wolfram.com>
|
Regarding whether the branch or the body of the branch triggers etc I created the following example to clarify my position: (I'm fully aware that using when in discretized models isn't ideal, but it should still work.) The However, the when-clause-body That's why I don't think stating that a when-clause branch is triggered meaning the latter is clear (even if there are some differences between when-clause and when-clause branch). Using an active verb may be too subtle, but the logic would be that:
|
Co-authored-by: Henrik Tidefelt <henrikt@wolfram.com>
Closes #3840
Not sure if we should add this to 3.7; or delay it.
However, the current situation isn't good either as seen in #3840; and in particular "when-clause" sometimes previously meant "body of a when- or else-when-clause"; and is now written as "body of when-clause".
I believe it is correct, but will try to look again.