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

[lib] When to use 'shall' in library clauses? #1086

Closed
jensmaurer opened this issue Nov 21, 2016 · 4 comments
Closed

[lib] When to use 'shall' in library clauses? #1086

jensmaurer opened this issue Nov 21, 2016 · 4 comments
Assignees
Labels
lwg Issue must be reviewed by LWG. not-editorial Issue is not deemed editorial; the editorial issue is kept open for tracking.

Comments

@jensmaurer
Copy link
Member

jensmaurer commented Nov 21, 2016

In the core clauses, we strive to be consistent to use "shall" for requirements on user programs that require a diagnostic when violated. Requirements on the implementation are described in regular present-tense prose. (We sometimes use "shall" in phrases like "the implementation shall ...", in which case no ambiguity arises.)

In the library clauses, the rules are less clear and should be clarified. In particular, since most library requirements on programs cause undefined behavior, rather than an ill-formed program, when violated.

At the very least, for a "Requires" clause, the use of "shall" for runtime preconditions seems redundant.

Whatever we come up with, we should spell out the rules explicitly in the respective introduction sections.

Generalized from #417.

@jwakely
Copy link
Member

jwakely commented Nov 21, 2016

My P0411 proposal is an attempt to stop using Requires for runtime preconditions, so that violations of "shall" requirements in a Requires requires a diagnostic. I have also volunteered to write another huge proposal making the use of "shall" in the library clauses consistent with how it's used in the core clauses.

@jensmaurer
Copy link
Member Author

I agree with the idea to separate runtime preconditions from compile-time diagnosable rules.
If we're in a section clearly labeled as "Preconditions", I find the use of "shall" not really necessary. Sentences with "is" simply read better. I understand that the "Requires" section will have diagnosable conditions, so consistency with core would suggest to continue to use "shall" there.
Further, I'd like to point out that switching "shall" to "is" in clauses marked as [runtime] "Preconditions" by LWG is probably editorial and would save another huge paper.

@jensmaurer jensmaurer added the lwg Issue must be reviewed by LWG. label Nov 16, 2017
@jensmaurer
Copy link
Member Author

jensmaurer commented Mar 25, 2018

See also P0788 by Walter Brown.

@jensmaurer jensmaurer added the not-editorial Issue is not deemed editorial; the editorial issue is kept open for tracking. label Mar 25, 2018
@jensmaurer
Copy link
Member Author

Marshall's "mandating" papers have addressed this issue, and clearly separate diagnosable requirements and runtime preconditions into different descriptive elements.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lwg Issue must be reviewed by LWG. not-editorial Issue is not deemed editorial; the editorial issue is kept open for tracking.
Projects
None yet
Development

No branches or pull requests

2 participants