-
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
Flat modelica type aliases #2555
Conversation
Wouldn't it be useful to have a Full Modelica code for all the examples so that one can see how this is transformed? Referring to:
I don't see the benefit of one type being defined by another type.
Flat Modelica is not for building libraries! It's for stand-alone ("save all" kind of) models. |
Web meeting poll: How to proceed?
Conclusion: Postpone. |
This PR seems to contain way to many changes that don't focus on type aliases. We should have a look at the suggested changes to see if there is anything worth preserving. Regarding where we stand on this issue, I think that the type alias topic itself is greatly simplified by the current top level structure, which only gives access to top level constants for expressing modifications in the type aliases, and we've anyway gotten rid of pretty much all non-constant built-in type attributes. That is, type aliases can only created easily handled variants of existing types, plus making arrays of existing types. I also get the impression that if we want to focus on type aliases we need to do so in a fresh PR; there's way too much unrelated discussion above. Maybe we could just make a new decision between these two options?
|
When looking at #2468 I realize that the big question where we seem to disagree regarding type aliases is whether to allow type aliases for arrays (this would be the only way to declare an array type). |
updated the example code in scalars section
Web Meeting: Martin, Hans, Henrik, Gerd, Oliver Goal: Conclusion for scalars: updated the example code |
Since `start` has been removed as an attribute in Flat Modelica except as syntactic sugar, it is better to use use one of the actual attributes for this discussion. Avoiding `nominal` since it has some similarity with `start` and would need to be removed from the set of built-in attributes if we wanted to support the non-constant nominal attribute from FMI.
Web-Meeting: Martin, Hans, Henrik, Gerd, Oliver Rewrite the "No type aliases for records" example to illustrate workarounds to avoid dummy member. Workaround 1:
Workaround 2:
Shall replace the current example in type_aliases.md [Henrik] Discussion:No type aliases for recordsHenrik: Scales extremely bad. |
Examples have been changed as decided above: #2555 (comment) |
Web Meeting: Hans, Martin, Gerd, Henrik, Oliver Decision on type aliases requires a decision on what types shall be abel to represent. What types shall be allowed in Flat Modelica?
To be continued. |
Web Meeting: Hans, Martin, Gerd, Henrik, Oliver What types shall be allowed in Flat Modelica? (continued from above)
All participants of the meeting agree that there is no need to support value modifications in Flat Modelica types. Next meeting: Thursday Jan. 13, 10:30 - 12:00 |
That's fine for OpenModelica, type modifiers and default arguments are applied in the flat model and serve no real purpose. We currently do allow them since they're part of regular Modelica, but it doesn't really matter much to us if we allow or forbid them. |
Web Meeting: Martin, Hans, Henrik, Gerd, Oliver
This has been solved during the discussion of value modifications by having removed record constructors and function default arguments entirely.
This goal is achieved by restrictions applied to modifications. The above question about which type aliases to allow was strongly dependent on which modifications may occur. This should be easy to answer now. Conclusion from having simplified modifications:
Proposal: Poll: Decision: |
Web Meeting: Hans, Henrik, Gerd, Martin, Oliver See decision to not allow array type aliases at #2468. |
This PR is currently a mess with 12 changed files. I'll have to try to restart it so that we can see clearly the changes that relate to type aliases. |
It turned out that all there is on this PR branch is the new supplemental design document type-aliases.md. The actual restriction to not allow array type aliases is taken care of in #2468. |
Initiating draft PR for design work on type aliases.