-
Notifications
You must be signed in to change notification settings - Fork 751
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
Calling std::terminate() vs. std::terminate (no parens) #2150
Comments
Can we take a wider look at how we say "call <function-name>" and how we spell that? |
On Jun 11, 2018, at 5:04 AM, Thomas Köppe ***@***.***> wrote:
Can we take a wider look at how we say "call " and how we spell that?
And, if we're going to do that, let's also please reconsider our use of "called" in the sense of "named" or "termed": "called" is such an important term of art that it seems preferable to restrict (as much as possible) its use to the technical sense of "invoked".
For example, we could easily s/called/termed/ in [intro.refs]:
2 The library described in Clause 7 of ISO/IEC 9899:2011 is hereinafter called the C standard library.
3 The operating system interface described in ISO/IEC 9945:2003 is hereinafter called POSIX.
4 The ECMAScript Language Specification described in Standard Ecma-262 is hereinafter called ECMA-262.
As another example, we could s/called/known as/ or s/called/termed/ in footnote 4, which starts "This provision is sometimes called the “as-if” rule, ...".
At a minimum, I urge that we avoid introducing further uses of "call", "called", "calling", etc., unless used in the technical sense of "invoke". We can then do drive-by fixes as opportunity presents.
|
There are multiple issues here: One issue is naming functions as For a function that takes no parameters, such as The other thing that The phrase "calls blah" is ambiguous, particularly when "blah" ends with parentheses. It could mean either "calls the function named by blah [with no arguments]", or "evaluates the expression blah, which is a function call expression". "Calls
Decision:
Which I think means that most of the places that say |
I also think Walter's suggestion is good. Try not to introduce more uses of "called" when we mean something other than an invocation of a function. In contexts where we can't just use "is", "known as" can be used. All else being equal, we should endeavor to define terms separately from stating requirements on those terms, allowing use of "is" instead of "known as" or "called". Eg, in [lex.ccon], we have:
But we should instead separate the definition from the requirements on the implementation, removing the "known as" in the process:
|
I'd like to point out that "called" (as in function call) is slightly ambiguous whether only calls via function call expressions [expr.call] are in scope, or any situation where a function is invoked (e.g. conversion function, constructor, destructor of temporary at end of full-expression etc.) I thought CWG was eager to use "invoked" in such general circumstances, but a second look at existing text might be worthwhile. |
@zygoloid, I believe we should really remove more of the "is called", in particular with std::terminate, since it almost never appears in an expression that the user wrote. I'd suggest for the std::terminate case in particular, "... the function std::terminate is invoked (except.terminate]". This phrasing avoids the parens question and the "is there really an expression that is evaluated" question (for example, what if std::terminate had a default argument: where would temporaries be destroyed?) |
[basic.start.term] uses the latter, [except] mostly uses the former. Decide and harmonize.
The text was updated successfully, but these errors were encountered: