Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

error: implement general state_type handler #938

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

Merged
perazz merged 7 commits into fortran-lang:master from perazz:error_type
Feb 21, 2025

Conversation

Copy link
Member

@perazz perazz commented Feb 17, 2025
edited
Loading

This PR was spun off #904 for clarity.

Because the adoption of a linalg_state_type was successful and flexible enough, it is proposed to extend the linear algebra error handling type by introducing a new state_type base class as part of the stdlib_error module.

This would provide a unified framework for managing error states across all different modules of stdlib, not only linear algebra but also I/O, filesystem and other modules.

The state_type class has the same contents as linalg_state_type: integer error flag, fixed-size character storage for messages and error locations, and type-bound procedures for error checking and reporting. The existing linalg_state_type now extends state_type, ensuring consistency - and interoperability.

The linear algebra modules still require type(linalg_state_type) outputs. We could make them class(state_type), optional, intent(out), so they would seamlessly handle both derived types. However, in Fortran, polymorphic arguments cannot appear in pure procedures, so another alternative would be to template them with fypp.

relevant discussion: #224 #212 #95 #219

cc: @jvdp1 @jalvesz @fortran-lang/stdlib

jalvesz reacted with rocket emoji
Copy link
Member

@jvdp1 jvdp1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thank you @perazz

perazz reacted with thumbs up emoji
Co-authored-by: Jeremie Vandenplas <jeremie.vandenplas@gmail.com>
Copy link
Member Author

perazz commented Feb 19, 2025

Thank you @jvdp1 for the review. If you agree, I suggest to wait a bit longer for additional comments, and then merge if none, so we can make more progress on ohters.

jvdp1 reacted with thumbs up emoji

Copy link
Contributor

@jalvesz jalvesz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Brilliant @perazz LGTM!

Copy link
Member Author

perazz commented Feb 21, 2025

Thank you @jvdp1 @jalvesz, merging now.

@perazz perazz merged commit 76292d3 into fortran-lang:master Feb 21, 2025
14 checks passed
@perazz perazz deleted the error_type branch February 21, 2025 08:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers

@jvdp1 jvdp1 jvdp1 approved these changes

@jalvesz jalvesz jalvesz approved these changes

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /