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

[expr.prim.lambda.general] Added missing definition for the term "lambda". #6625

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

Conversation

Bekenn
Copy link
Contributor

@Bekenn Bekenn commented Oct 15, 2023

The unadorned term "lambda" is used interchangeably with lambda-expression in a few places, but is never actually defined. The term "generic lambda" is defined in terms of "lambda". Adding the missing definition seemed like the simplest approach to resolving the issue.

source/expressions.tex Outdated Show resolved Hide resolved
@Bekenn Bekenn requested a review from JohelEGP October 30, 2023 06:00
Copy link
Contributor

@JohelEGP JohelEGP left a comment

Choose a reason for hiding this comment

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

@Bekenn
Copy link
Contributor Author

Bekenn commented Oct 30, 2023

Do you want an amended commit, or should I just change the PR title?

@Bekenn Bekenn changed the title Added missing definition for the term "lambda". [expr.prim.lambda.general] Added missing definition for the term "lambda". Oct 30, 2023
@JohelEGP
Copy link
Contributor

It'd be easier on the editors if the commit message was right from the start.
But they can also fix it when merging the PR.

…bda".

Co-authored-by: Johel Ernesto Guerrero Peña <johelegp@gmail.com>
@Bekenn
Copy link
Contributor Author

Bekenn commented Oct 30, 2023

Updated.

@jensmaurer
Copy link
Member

jensmaurer commented Oct 31, 2023

Hm...

I'm not too fond of splitting up "generic lambda" into "lambda is generic"; I think we use "generic lambda" (in this order) whenever we us that term.

What's the count on plain "lambda" that we would need to turn into "lambda-expression"?

I understand that using "lambda-expression" on one hand and "generic lambda" on the other is a bit non-symmetric in phrasing, but that feels like the lesser evil right now.

@Bekenn
Copy link
Contributor Author

Bekenn commented Nov 1, 2023

Here are the cases I could find:

  • [basic.def.odr]/10 uses the term "non-lambda function"
  • [dcl.spec.auto.general]/2: "or the lambda is a generic lambda" (this is in a note, so maybe not important)
  • [dcl.attr.depend]/1: "The attribute may be applied to a parameter of a function or lambda"
  • [dcl.attr.depend]/1: "lambda call operator" (also [dcl.attr.nodiscard] and [dcl.attr.noreturn])
  • [expr.prim.lambda.general]/6: "A lambda is a generic lambda if the lambda-expression has any generic parameter type placeholders, or if the lambda has a template-parameter-list."
  • [expr.prim.lambda.closure]/4: "(for a non-generic lambda)"
  • [expr.prim.lambda.closure]/5: "Given a lambda with a lambda-capture, the type of the explicit object parameter, if any, of the lambda’s function call operator"
  • [expr.const]/17: "the call operator of a lambda"
  • [defns.prog.def.type]: "non-implementation-provided lambda expression"
  • [futures.async]/8: "the lambda might not be invoked" (this appears in a note)

Some of these can readily be replaced with lambda-expression, but others feel a little bit awkward (e.g. "non-generic lambda"). Some of these uses appear to refer to the closure type rather than the lambda-expression itself.

@tkoeppe tkoeppe added the cwg Issue must be reviewed by CWG. label Nov 12, 2023
@tkoeppe
Copy link
Contributor

tkoeppe commented Nov 12, 2023

CWG discussion: please reword all the instances as discussed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cwg Issue must be reviewed by CWG.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants