Skip to content

Conversation

@wclodius2
Copy link
Contributor

A paper on design by contract that, among other things, proposes the addition of an ASSERT statement
to Fortran 202y.

The new paper, design_by_contract.txt, contains a proposal to allow Fortran programmers to use "Design by Contract", proposing three new statements for the Fortran language: REQUIRES, ASSERT, and ENSURES. As such, among other things, it addresses issue j3-fortran#70 'Add assert statement to Fortran'. [ticket: j3-fortran#70]
In reviewing the paper prior to submitting a pull request I realized that I had misspelled .EQV. as .EQUIV. and that I had forgotten to mention ASSERT at one point where I discussed REQUIRES and ENSURES. [ticket: j3-fortran#70]
@milancurcic
Copy link
Member

Thank you @wclodius2, I read the proposal. Do requires and ensures do anything different from asserts other than being required to be in the prelude and conclusion of a procedure, respectively? Why not use just asserts?

I have a slight preference for imperative mood for statements like this (require instead of requires, assert instead of asserts), which is consistent with other Fortran statements (allocate, deallocate, nullify, open, close, read, write, inquire, change team, form team, etc.)

@nncarlson
Copy link

I would find it useful to have an additional statement INSIST that behaves identically to ASSERT except that it is active in both development and deployment compilation modes; i.e., it is never a null operation.

@wclodius2
Copy link
Contributor Author

wclodius2 commented Aug 4, 2020 via email

@wclodius2
Copy link
Contributor Author

wclodius2 commented Aug 4, 2020 via email

@wclodius2
Copy link
Contributor Author

FWIW I slightly prefer the active voice.

@wclodius2
Copy link
Contributor Author

I don't seem to have write access to the repository, so I have to ask others to make changes for my approval. As it is always an executable construct ASSERT should always be in the active voice. Can someone change all appearances of ASSERTS to ASSERT? When discussed as an attribute statement I believe I should use REQUIRES and ENSURES, while when discussed as an executable statement I believe I should use REQUIRE and ENSURE. Can someone make that selected change?

@nncarlson
Copy link

@wclodius2 I'm not sure what errors you're seeing, but you should be able to make changes to your pull request. Looks like Milan committed a couple changes to it. So perhaps you need to do a git pull on your assert branch to pull those changes into your working copy before you can commit your changes and push them back to the assert branch on your fork of the repo.

Changed ASSERTS, ENSURES, and REQUIRES to ASSERT, ENSURE, and REQUIRE, respectively [ticket: j3-fortran#70]
@wclodius2
Copy link
Contributor Author

It has been a month and none of my three proposals (assertions/design by contract; optional dummy arguments, and module namespaces) have been merged into the repository. Did they "fall off the radar"? Did they need more work? Are they inappropriate for meeting 222, as they are explicitly F202y oriented and so low priority? Are there other reasons I am not thinking of?

@certik
Copy link
Member

certik commented Sep 14, 2020

@wclodius2 in the past we usually merged the pull requests before the meeting once we were happy with the wording and it was the version we wanted to present. I am happy to merge it sooner if you would prefer.

In the last meeting we presented such proposals at the plenary to get feedback from the whole committee. These proposals go into 202y, so the committee does not vote on them. The idea is to get them ready, so that when the committee starts considering proposals for 202y, they are ready.

In order to increase chances of the proposal getting accepted, it's good to involve as much of the wider community as possible. If there is wide support for some feature, it has a much higher chance of getting in.

@wclodius2
Copy link
Contributor Author

wclodius2 commented Sep 14, 2020 via email

@certik
Copy link
Member

certik commented Sep 14, 2020

Ok, let's merge it.

@certik certik merged commit 2f6be42 into j3-fortran:master Sep 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

4 participants