Skip to content
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

Purpose of stored-definition with several class definitions, and the within-clause #3466

Open
henrikt-ma opened this issue Jan 18, 2024 · 3 comments

Comments

@henrikt-ma
Copy link
Collaborator

What is the purpose of allowing stored-definition to have zero or several class definitions?

If we are to keep it this way, the definition of the within-clause would need to be updated to better cover the case of not just a single class definition.

@HansOlsson
Copy link
Collaborator

What is the purpose of allowing stored-definition to have zero or several class definitions?

Historically it has been used (e.g., for "SaveTotal") - especially without within. Really annoying users can use it combination with within.

If we are to keep it this way, the definition of the within-clause would need to be updated to better cover the case of not just a single class definition.

I don't see that within causes a problem for it. Consider the following silly example of a package P containing a mo file as follows on Windows:

within P;
model MA
end MA;

model ma
end ma;

I don't know if there's a more relevant use case for this.

@HansOlsson
Copy link
Collaborator

Basically within allows tools to detect if files have just been moved around in the directory; thus it makes sense that there's only one within per file.

@henrikt-ma
Copy link
Collaborator Author

I don't see that within causes a problem for it. Consider the following silly example of a package P containing a mo file as follows on Windows:

within P;
model MA
end MA;

model ma
end ma;

There wouldn't be a clear way to name that file. So in addition to generalizing the within-clause to applying to every class in the stored-definition, we'd also have to say something about the filename-class mapping.

I don't know if there's a more relevant use case for this.

I'd prefer steering away from stored-definition with anything but a single class definition, rather than trying agree on exactly how it should work. As usual, tools would still keep support for legacy files with multiple classes for a long time. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants