carbon-lang
carbon-lang copied to clipboard
Update the design docs for functions to reflect the lambdas proposal
#3848 introduced some changes to the design of named functions, as part of generalizing them to encompass lambda expressions. For example:
- They can take positional parameters instead of named parameters.
- They can be defined with
=> expr;instead of-> ReturnType { body } - They can have captures.
Lambda expressions themselves were added to the design documentation in #5300, but docs/design/functions.md and docs/design/README.md should also be updated to reflect the changes to named functions.
should we move lambdas in table of contents (currently under "Unfinished tales") to functions?
Example:
- Functions
- Parameters
autoreturn type- Block and statements
- Lambdas <---- Example
- Control Flow
ifandelse- etc...
This would also mean the short summary for lambdas in the docs/design/README.md should be done too?
That seems like a good idea. I don't think it necessarily needs to be done to resolve this issue, but if it's convenient to do that along the way, great!