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

Add namespace modules proposal revision by @wclodius2 #176

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

milancurcic
Copy link
Member

Uploaded for @wclodius2. Related to issue #1.

Comment on lines +145 to +146
use, with :: math, only: vector
use, with:: strings, only: vector
Copy link
Member

Choose a reason for hiding this comment

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

I believe this should be just:

Suggested change
use, with :: math, only: vector
use, with:: strings, only: vector
use, with :: math
use, with :: strings

the code below would still run. I don't think we should allow user, with :: math, only: vector, what would it do? Allow math%vector, but not math%matrix? Python doesn't allow that, I wouldn't allow that either here.

Copy link
Contributor

Choose a reason for hiding this comment

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

FWIW I tried going to the file accept the change and nothing seemed to happen. I wonder if Milan has ownership.

@wclodius2
Copy link
Contributor

wclodius2 commented Jul 31, 2020 via email

@certik
Copy link
Member

certik commented Sep 14, 2020

I personally do not like allowing use, with :: math, only: vector. Also, if it is allowed, I think the proposal needs to explain more clearly what it would do. I personally would not allow it.

But I am happy to merge it if you just want to keep the proposal as is and discuss at the committee.

@wclodius2
Copy link
Contributor

wclodius2 commented Sep 14, 2020 via email

@septcolor
Copy link

septcolor commented Sep 14, 2020

A very peripheral question, but for the J3 meeting, is it usual that participants are given only two weeks for reading proposals and making opinions about it? I am afraid that it is not a sufficiently long time to prepare opinions... (CC: @sblionel) .

@sblionel
Copy link
Member

@septcolor The two-week limit is for new papers, though given that J3 meetings often generate dozens of new papers on the fly, it's not clear to me that this matters. Typically papers trickle in over the time between meetings so that two weeks in advance there are 20-30 papers to review (some of which have been there for months.)

We're at an odd stage in the development in that there are only seven work items for which work remains to be done. These all have topics in the j3-fortran.org discussion board (for J3 members only). So far, only a couple of minor papers have been submitted, none about the work items. I have been encouraging members to draft papers, but many are finding it difficult to devote time to this. If this in relation to 202Y proposals (as @wclodius2 suggests), then I suggest doing all discussion here as, at least for the October meeting, which is abbreviated, we may not have a chance to discuss future ideas.

@wclodius2
Copy link
Contributor

@sblionel so standards development is at an odd state. Enough work has been done on the current draft that there would normally be enough time available to start preliminary work identifying features for the following draft, but because people are having trouble adjusting to COVID-19 telecommuting it is not clear how much progress will be made on the current draft. As a result it is unlikely that any work will be done this session on F202Y, with the possible exception of generics/templates. Understandable, but disappointing.

@certik
Copy link
Member

certik commented Sep 22, 2020

I've been thinking about this.

I don't know if I like with more than namespace. For sure with is easier to type. @wclodius2 can you motivate how with describes that it imports the module as a namespace?

@certik
Copy link
Member

certik commented Sep 22, 2020

My other objection is that I don't understand what use, with :: math, only: vector means. As I suggested, I would not allow it. (I understand your argument about the simplest possible change, but I feel that's secondary.)

@wclodius2
Copy link
Contributor

wclodius2 commented Sep 22, 2020 via email

@wclodius2
Copy link
Contributor

wclodius2 commented Sep 22, 2020 via email

@certik
Copy link
Member

certik commented Sep 22, 2020

Using a module as a namespace you use the module entities always with the module-name.

Yes. I am just trying to understand how the term with describes this. You didn't use with in the above sentence, but you used the term namespace. Update: you did use with in with the module-name. Is that the idea? That with means that you always have to use the entities with the module-name in front?

(I know this is just a term, but for this proposal, the "marketing" is very important, and I want to have a well rounded, well motivated proposal that will work and be intuitive to people.)

P.S. Ada describes their use and with here: https://en.wikibooks.org/wiki/Ada_Programming/Packages#Using_packages

@wclodius2
Copy link
Contributor

wclodius2 commented Sep 22, 2020 via email

@certik
Copy link
Member

certik commented Sep 22, 2020

My apologies, I amended my comment at #176 (comment), yes you did use with.

Will you be able to join our Fortran call this Friday: https://fortran-lang.discourse.group/t/fortran-monthly-call-september-2020/298/8

Let's discuss this there.

Let me try to reformulate my question: I believe that language "keywords" should be natural and intuitive to describe what the feature is doing. So I want to have a motivation. Here is my best effort to motivate the two options:

  • use, namespace :: math The namespace keyword comes from: The math module will be imported as a namespace.
  • use, with :: math The with keyword comes from: The math module will be imported as a namespace where you use the module entities always with the module-name.

But I also have another alternative motivation:

    • use, with :: math The with keyword comes from: The code that contains this line will be used with the math module.

Which of these (if any) make sense to you?

@wclodius2
Copy link
Contributor

wclodius2 commented Sep 22, 2020 via email

@certik certik added the Clause 14 Standard Clause 14: Program units label Apr 23, 2022
@Leonard-Reuter
Copy link
Contributor

What is the current state of this proposal? I think it is a desperately needed feature.
Regarding the discussion over here: I'd also prefer namespace over with. Anybody new to the language will easily understand what the former does, while it requires some guess work for the latter.

@sblionel
Copy link
Member

It's on the list for consideration for Fortran 202Y. The Data subgroup's initial comments are:

  1. Namespace for modules
    The proposals here are multitudinous; much of the functionality is
    already provided by existing syntax, the main thing that looks useful
    would be a syntax for "remote access" to module entities, e.g.
    "modulename % entityname". Not sure % is the best thing for this.
    Medium desirability, Limited scope, Fairly easy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Clause 14 Standard Clause 14: Program units
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants