-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clarifications in Section 3.7 and 5.6.1 regarding "builtin classes" #3590
Comments
Of course builtin should be spelled built-in also in Section 5.6.1.2 |
3.7 also seems to mix the terms operator and function arbitrarily, for example:
I would assume both of these sentences should apply to both operators and functions. And also in 3.7.1:
3.7.2 only defines operators. I'm not sure if it's really that useful to make a distinction between functions and operators with function syntax in the first place, it seems rather arbitrary. |
In my mind, there is an important difference: Functions behave as functions, whereas (built-in) operators generally have semantics which cannot be expressed in terms of a function call (because then I would have expected it to be presented as a built-in function, not an operator). I was hoping that the Modelica specification was aiming for this kind of distinction… |
3.7 begins with:
However, the very next sentence says:
However, all of these "functions" are actually defined as operators, so it's all a bit confused right off the start. And many of the operators don't fit this description anyway. |
Whether it should be spelt built-in or builtin is something we can discuss; and then apply consistently. As for separating between built-in functions and operators with function syntax it is somewhat complicated: One could say that as long as it is a built-in operator with function syntax it doesn't matter that it could currently be described as a function, as long as that is not done. Additionally, whether it could be described as a function has in many cases changed over time, so by being clearer we risk introducing errors Concretely consider:
So, the ones described as operators have headings using the word "operators" and the ones that are functions have "function" in their heading. |
After looking a bit more there was one additional issue:
|
My main concern when opening this ticket was about consistency. The MLS has been written over the years by many different persons and groups and some parts were later rewritten completely, e.g. the flattening part. Fixing all the logical dependencies is non-trivial, so there can be minor inconsistencies here and there. I would suggest to first fix the current test so that it is consistent (e.g. same spelling of built-in everywhere, title reflecting the actual content of a section), without actually changing the content. That should be easy. The discussion about actual changes of the specification (e.g. better defining what are operators and what are functions, or whatever) will probably take more time and debates, but can be done later. |
Section 3.7 is entitled "Built-in Intrinsic Operators with Function Syntax", but it actually describes both built-in operators and built-in functions, so the title could probably be made more accurate as "Built-in Functions and Intrinsic Operators with Function Syntax".
Section 5.6.1.1 contains the following statement:
I would first of all suggest to use the same spelling "built-in" of Section 3.7, so you can get to this section immediately when looking for the "built-in" string in the PDF document.
Besides that, I understand from
Section 4.6
that there are specialized classes:so it is clear that built-in functions are a sub-set of built-in classes, and therefore the look-up rules of 5.6.1.1 apply to them. It is a bit less clear to me that built-in intrinsic operators with function syntax are also a subset of "builtin classes". In fact, I'm not even sure they belong there; are operators classes? Probably not.
So, I would recommend to clarify the statement in 5.6.1.1 by writing it as
The text was updated successfully, but these errors were encountered: