-
Notifications
You must be signed in to change notification settings - Fork 125
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
refactor(ListModule): trim dependencies, add defaults, improve docstrings #1484
Conversation
…ect, improve ListType docstrings
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure I understand the dependency on stop_with_error(). It is in GenericUtilitiesModule, which does depend on SimVariablesModule, but the dependencies are minimal.
src/Utilities/List.f90
Outdated
print *, 'Programming error in ListType%insert_after' | ||
error stop 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We might need to check further on the ramifications of this change. I'm thinking stop_with_error() and its use of call exit() was used intentionally, perhaps for API behavior.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think error stop 1
is equivalent to call exit(1)
(with possibly wider compiler support), both terminating with the given exit code. On the other hand stop 1
prints the ret code to stderr but exits with code 0, which I imagine is what we want to avoid?
At least that is my reading of the following
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since gnu, intel, and flang all support an exit()
intrinsic subroutine maybe it makes sense to standardize on that directly, and stop_with_error()
would be unnecessary
One drawback of error stop
is it only supports a variable status code in f2018, while exit()
already does
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it make sense to keep stop_with_error()
in place and use it for all programming errors? It could remain the same or we could pass it a message. If we ever needed to change the behavior, we would only need to change it one place? Or we could get rid of it and just call exit().
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it make sense to keep stop_with_error() in place and use it for all programming errors? It could remain the same or we could pass it a message. If we ever needed to change the behavior, we would only need to change it one place?
That seems good to me. Maybe it could live in a separate module so generic utilities don't depend on simulation-related things?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good to me!
src/Utilities/List.f90
Outdated
print *, "Programming error in ListType%InsertBefore" | ||
error stop 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting this is in here. This must be a remnant from a while back.
… in ArrayHandlers to remove SimModule dependency
SimModule
dependency andsim_message()
/stop_with_error()
usageserror stop 1
associated(x, y)
as defaultisEqual
procedure forContainsObject