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

Protected attribute for variables in derived types #16

Open
aradi opened this issue Oct 17, 2019 · 7 comments
Open

Protected attribute for variables in derived types #16

aradi opened this issue Oct 17, 2019 · 7 comments
Labels
Clause 8 Standard Clause 8: Attribute declarations and specifications Fortran 202y Proposals targeting the standard after F2023 under consideration Has been submitted to the committee

Comments

@aradi
Copy link
Contributor

aradi commented Oct 17, 2019

It would be awesome, if the protected attribute could also be used in derived types:

  type :: some_big_data_t
    real, allocatable, protected :: data(:,:)
  contains
    procedure :: set_data
    !procedure :: get_data
  end type some_big_data_t

It would help to avoid unnecessary copies when retrieving data from a derived type instance and enable protection against unnoticed manipulation of that data.

@certik certik added Fortran 202y Proposals targeting the standard after F2023 unsubmitted Has not been submitted to the committee yet labels Oct 18, 2019
@certik
Copy link
Member

certik commented Oct 18, 2019

Thanks @aradi for the idea. Would you be interested in putting a proposal together for this? You can send a PR with the draft.

@aradi
Copy link
Contributor Author

aradi commented Oct 21, 2019

Yes, sure, why not. I'll make a proposal.

@aradi
Copy link
Contributor Author

aradi commented Oct 21, 2019

Stupid question: How do you choose the file name for the proposal in the PR?

@certik
Copy link
Member

certik commented Oct 21, 2019 via email

@zjibben
Copy link
Member

zjibben commented Feb 23, 2020

The proposal is now submitted:

https://j3-fortran.org/doc/year/20/20-106.txt

Thanks @aradi!

@aradi
Copy link
Contributor Author

aradi commented Feb 23, 2020

Cool! Thanks @zjibben to support this!

@certik
Copy link
Member

certik commented Feb 25, 2020

@aradi the committee is actively developing a version of this proposal in #156. Unfortunately, it seems that currently there are some issues with the latest version. If you have time, I would encourage that you get involved there. We will happily channel your arguments.

This was referenced Feb 26, 2020
@milancurcic milancurcic added the Clause 8 Standard Clause 8: Attribute declarations and specifications label Oct 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Clause 8 Standard Clause 8: Attribute declarations and specifications Fortran 202y Proposals targeting the standard after F2023 under consideration Has been submitted to the committee
Projects
None yet
Development

No branches or pull requests

4 participants