Files
carbon-lang/proposals
864c832971 Lambdas (#3848)
This document proposes a path forward to add lambdas to Carbon. It
further proposes augmenting function declarations to create a more
continuous syntax between the two categories of functions. In short,
both lambdas and function declarations will be introduced with the `fn`
keyword. The presence of a name distinguishes a function declaration
from a lambda expression, and the rest of the syntax applies to both
kinds. By providing a valid lambda syntax in Carbon, migration from from
C++ to Carbon will be made easier and more idiomatic. In C++, lambdas
are defined at their point of use and are often anonymous, meaning
replacing them solely with function declarations would create an
ergonomic burden compounded by the need for the migration tool to select
a name.

Associated discussion docs:

* [Lambdas Discussion
1](https://docs.google.com/document/d/1rZ9SXL4Voa3z20EQz4UgBMOZg8xc8xzKqA1ufPQdTao/)
* [Lambdas Discussion
2](https://docs.google.com/document/d/14K_YLjChWyyNv3wv5Mn7uLFHa0JZTc21v_WP8RzC8M4/)
* [Lambdas Discussion
3](https://docs.google.com/document/d/1VVOlRuPGt8GQpjsygMwH2B7Wd0mBsS3Qif8Ve2yhX_A/)
* [Lambdas Discussion
4](https://docs.google.com/document/d/1Sevhvjo06Bc6wTigNL1pK-mlF3IXvzmU1lI2X1W9OYA/)

---------

Co-authored-by: Chandler Carruth <chandlerc@gmail.com>
Co-authored-by: Richard Smith <richard@metafoo.co.uk>
2024-09-20 02:08:59 +00:00
..
2024-05-16 23:23:41 +00:00
2021-04-23 17:19:23 -07:00
2022-08-11 12:06:51 -07:00
2022-07-22 16:14:21 -07:00
2024-03-22 18:42:20 +00:00
2022-07-22 16:14:21 -07:00
2022-07-22 16:14:21 -07:00
2024-03-22 18:42:20 +00:00
2022-07-20 07:01:47 +03:00
2022-07-22 16:14:21 -07:00
2022-07-20 14:55:54 -04:00
2024-03-22 18:42:20 +00:00
2024-03-22 18:42:20 +00:00
2022-07-22 16:14:21 -07:00
2022-10-25 12:06:24 -07:00
2022-10-25 12:06:24 -07:00
2021-04-21 13:00:03 -07:00
2024-03-04 16:27:31 +00:00
2022-10-25 12:06:24 -07:00
2022-10-25 12:06:24 -07:00
2021-04-13 20:57:17 -07:00
2024-03-22 18:42:20 +00:00
2021-05-10 16:42:01 -07:00
2021-06-29 10:52:45 -07:00
2022-07-22 16:14:21 -07:00
2022-07-20 07:01:47 +03:00
2021-07-08 10:39:36 -07:00
2022-08-11 12:06:51 -07:00
2022-07-22 16:14:21 -07:00
2022-07-22 16:14:21 -07:00
2022-07-22 16:14:21 -07:00
2021-09-21 09:33:32 -07:00
2022-07-22 16:14:21 -07:00
2022-12-07 15:12:08 -08:00
2021-09-21 15:16:16 -07:00
2021-09-23 10:09:57 -07:00
2021-09-21 09:45:35 -07:00
2021-10-29 16:46:19 -07:00
2022-01-10 10:08:14 -08:00
2022-01-27 11:25:43 -08:00
2022-08-11 12:06:51 -07:00
2022-01-28 20:07:45 -08:00
2023-03-22 21:45:32 -07:00
2023-03-22 21:45:32 -07:00
2022-03-02 13:01:01 -08:00
2022-02-22 17:18:27 -08:00
2022-03-16 14:43:03 -07:00
2022-07-22 16:14:21 -07:00
2023-03-22 21:45:32 -07:00
2022-05-03 15:37:45 -07:00
2022-05-04 13:12:18 -07:00
2022-07-22 16:14:21 -07:00
2022-07-22 16:14:21 -07:00
2022-06-14 19:35:53 -07:00
2024-03-22 18:42:20 +00:00
2022-12-06 15:58:48 -08:00
2022-08-26 11:50:22 -07:00
2023-09-11 21:24:33 +00:00
2022-09-08 15:49:11 -07:00
2022-08-16 09:41:52 -07:00
2024-03-22 18:42:20 +00:00
2022-12-12 14:08:05 -08:00
2023-08-05 05:39:34 +00:00
2022-12-02 16:11:23 -08:00
2023-03-22 21:45:32 -07:00
2023-01-27 19:03:47 -08:00
2023-06-16 11:11:46 -07:00
2023-04-25 18:19:06 -07:00
2024-03-04 16:27:31 +00:00
2023-06-27 15:35:35 -07:00
2023-07-06 21:45:09 +00:00
2024-01-31 23:42:11 +00:00
2024-05-25 02:07:34 +00:00
2024-03-21 21:45:18 +00:00
2024-05-20 19:13:40 +00:00
2024-05-01 22:28:46 +00:00
2024-09-20 02:08:59 +00:00
2024-05-16 23:49:52 +00:00
2024-08-08 23:13:28 +00:00
2024-08-10 00:15:37 +00:00
2024-09-03 23:41:22 +00:00

Proposals

Proposal lists

Directory structure

This directory contains accepted proposals for the carbon-lang repository. For information about declined/deferred proposals, please view the proposal's original pull request.

For accepted proposals, where #### is the corresponding proposal's pull request:

  • p####.md will contain the main proposal text.
  • p#### may be present as an optional subdirectory for related files (for example, images).